无法在Google App Engine上部署Maven项目?

时间:2018-10-08 17:34:48

标签: java eclipse maven google-app-engine pom.xml

我的maven项目在本地运行良好,但只是没有部署在gcloud上。以下是错误日志和pom.xml文件:-

  

错误日志:-

[INFO] Scanning for projects...
[WARNING] The POM for com.google.appengine:appengine-maven-plugin:jar:1.9.66 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for com.google.appengine:appengine-maven-plugin:1.9.66: Plugin com.google.appengine:appengine-maven-plugin:1.9.66 or one of its dependencies could not be resolved: Failure to find com.google.appengine:appengine-maven-plugin:jar:1.9.66 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (14 kB at 9.4 kB/s)
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 kB at 14 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.744 s
[INFO] Finished at: 2018-10-08T22:43:01+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'appengine' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/shashankk/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
  

pom.xml:-

<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>LiveInBliss</groupId>
  <artifactId>LiveInBliss</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <build>
  <!-- [START resources] -->
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <!-- [END resources] -->

    <plugins>


   <plugin>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>9.4.0.M0</version>
</plugin> 



    <plugin>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <version>1.9.66</version>
        </plugin>




      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.2.1</version>
      </plugin>
    </plugins>
  </build>
  <dependencies>
  <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.1.0</version>
    <type>jar</type>
    <scope>provided</scope>
  </dependency>
  <!-- https://mvnrepository.com/artifact/javax.mail/mail -->
<dependency>
    <groupId>javax.mail</groupId>
    <artifactId>mail</artifactId>
    <version>1.4</version>
</dependency>

  <dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud</artifactId>
  <version>0.8.0</version>
</dependency>
<dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-storage</artifactId>
  <version>1.34.0</version>
</dependency>
<dependency>                        <!-- http://dev.mysql.com/doc/connector-j/en/ -->
  <groupId>mysql</groupId>
  <artifactId>mysql-connector-java</artifactId>
  <version>6.0.5</version>
</dependency>
<dependency>
  <groupId>com.google.cloud.sql</groupId>
  <artifactId>mysql-socket-factory-connector-j-6</artifactId>
  <version>1.0.10</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
  <maven.compiler.target>1.8</maven.compiler.target>
<!--
    INSTANCE_CONNECTION_NAME from Cloud Console > SQL > Instance Details > Properties
    or `gcloud sql instances describe <instance> | grep connectionName`
-->
    <INSTANCE_CONNECTION_NAME>live-in-bliss:northamerica-northeast1:liveinbliss-99</INSTANCE_CONNECTION_NAME>
    <user>root</user>
    <password>my_password</password>
    <database>my_database</database>
    <sqlURL>jdbc:mysql://google/$liveinbliss?cloudSqlInstance=$live-in-bliss:northamerica-northeast1:liveinbliss-99&amp;socketFactory=com.google.cloud.sql.mysql.SocketFactory&amp;user=$root&amp;password=$my_password&amp;useSSL=false</sqlURL>
  </properties>

</project>

我想我已经添加了所有必需的依赖项,但仍然不知道是什么原因造成的。

此外,我不知道为什么,但是存在与JRE相关的错误:-请参见以下两个图像:-

enter image description here

他们需要Java 1.8,并且我已经设置了Java 1.8,如下图所示:-

enter image description here

请帮助我。

谢谢!

0 个答案:

没有答案