无法使用谷歌云中的mvn复制文件的工件错误

问题描述 投票:2回答:1

我在尝试使用maven在bitnami谷歌云图像上构建应用程序时遇到错误。当我在Windows上部署它时,构建工作正常。你有什么想法吗?

在下面的图像中,我删除了javax.faces以确认maven跟踪其依赖关系,但是,它仍然会在此之后发出错误。

任何帮助,将不胜感激。

image: maven tracks dependency but generates an error message

<project 
    xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>Armentano</groupId>
  <artifactId>gp2pl</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <name>POC #1</name>

    <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
            <source>1.8</source>
            <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.7</version>
            <configuration>
            <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
    </plugins>
    </build>

    <repositories>
    <repository>
        <id>jvnet-nexus-releases</id>
        <name>jvnet-nexus-releasees</name>
        <url>https://maven.java.net/content/repositories/releases</url>
    </repository>
    </repositories>

    <dependencies>  
        <!-- Java Server Faces -->
        <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>7.0</version>
        <scope>provided</scope>
        </dependency>

        <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.faces</artifactId>
        <version>2.2.10</version>
        </dependency>

        <!-- Hibernate -->
        <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>4.3.4.Final</version>
        </dependency>

        <!-- MySQL -->
        <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.12</version>
        </dependency>

    </dependencies>

</project>
java maven google-cloud-platform bitnami
1个回答
0
投票

你可以尝试两个想法解决这个问题。 1.-按照步骤在链接[1]中根据GCP配置maven,以防您没有GCP如何推荐。 2.-使用更高版本的“org.apache.maven.plugins”,如下所示:

 <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-compiler-plugin</artifactId>
   <version>3.8.0</version>
   <configuration>
     <source>1.8</source>
     <target>1.8</target>
   </configuration>
 </plugin>

或者检查apachemavenspŕoject设置[2]

[1]https://cloud.google.com/appengine/docs/standard/java/tools/maven#setting_up_maven
[2]https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html
© www.soinside.com 2019 - 2024. All rights reserved.