为什么我会出错从appcfg mvn迁移到gcloud后,Java 8 GAE项目不支持Maven源部署

问题描述

我运行此cmd

gcloud应用部署

并得到此错误

[错误]在存储库[本地(/ Users / gallavie /)中,在当前项目和插件组[org.apache.maven.plugins,org.codehaus.mojo]中找不到前缀'gcloud'的插件。 .m2 /存储库),中央(https://repo.maven.apache.org/maven2)]-> [帮助1] [错误] [错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。 [错误]使用-X开关重新运行Maven以启用完整的调试日志记录。 [错误] [ERROR]有关错误和可能的解决方案的详细信息,请阅读以下文章: [错误] [帮助1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

这是我pom.xml文件中的插件

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

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.3</version>
            <configuration>
                <archiveClasses>true</archiveClasses>
                <webResources>
                    <!-- in order to interpolate version from pom into appengine-web.xml -->
                    <resource>
                        <directory>${basedir}/src/main/webapp/WEB-INF</directory>
                        <filtering>true</filtering>
                        <targetPath>WEB-INF</targetPath>
                    </resource>
                </webResources>
            </configuration>
        </plugin>

        <plugin>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <version>${appengine.target.version}</version>
        </plugin>
    </plugins>
</build>

解决方法

出现该错误的原因是因为您缺少gcloud中的pom.xml依赖项,请尝试向其添加以下内容:

<plugin>
   <groupId>com.google.cloud.tools</groupId>
   <artifactId>appengine-maven-plugin</artifactId>
   <version>2.2.0</version>
</plugin>

有关使用maven部署到Appengine的更多信息,您可以选中此documentation

,

迁移后有类似问题,pom 很好,以下命令有帮助。

mvn clean package install -P dev appengine:deploy -Dapp.deploy.version=app_version

文档 herehere 很有帮助。

,

以下对我有用:

mvn package appengine:deploy

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...