maven - 为什么在从 appcfg mvn 迁移到 gcloud 后,Java 8 GAE 项目不支持 Maven 源部署错误
问题描述
我运行这个 cmd
gcloud 应用部署
并得到这个错误
[错误] 在当前项目和插件组 [org.apache.maven.plugins, org.codehaus.mojo] 中找不到前缀“gcloud”的插件,可从存储库 [local (/Users/gallavie/.m2/ repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1] [ERROR] [ERROR] 要查看错误的完整堆栈跟踪,请使用 -e 重新运行 Maven转变。[错误] 使用 -X 开关重新运行 Maven 以启用完整的调试日志记录。[ERROR] [ERROR] 有关错误和可能的解决方案的更多信息,请阅读以下文章: [ERROR] [Help 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 的更多信息,您可以查看此文档
推荐阅读
- netsuite - 嵌套案例何时
- c++ - 为什么我的代码说 90 重复了 6 次,而不是 5 次?
- pandas - Pandas groupby 和聚合多个列表
- haskell - 多重列表理解 Haskell
- reactjs - 如何正确将axios响应分配给react函数组件状态
- python - 在 python 中下载 apyori 的问题
- z3 - 如何将 Z3Py 代码转换为 C# 代码(Z3、SAT)
- reactjs - React Hooks/Typescript:“TypeError:blogs.map 不是函数”(我已经将博客键入为“数组”)
- redux - Redux Thunk 有什么用?
- c++ - reinterpret_cast 会导致严格的别名冲突吗?