gpt4 book ai didi

google-app-engine - 使用 google appengine maven 插件部署 Jax-RS war

转载 作者:太空宇宙 更新时间:2023-11-03 15:25:18 26 4
gpt4 key购买 nike

我正在尝试制作一个简单的基础项目,以将我使用 Jax-RS 库制作的服务部署到我的 Google 应用引擎云空间。问题是我不知道如何正确配置插件以不继续查找目标文件夹下的 webapp 目录。 Jax-rs 项目的结构将 web.xml 和所有其他 WEB-INF 文件放在资源目录下,而不是 webapp 目录下。有没有办法配置 Maven 插件来部署我已经构建并压缩的 war 文件?

这是我看到的错误

[INFO] Updating Google App Engine Application Unable to find the webapp directory C:\dev\gameTrunk\server\target\HOMMTG-server-1.0 usage: AppCfg [options] [] []

Action must be one of: help: Print help for a specific action.
download_app: Download a previously uploaded app version.
request_logs: Write request logs in Apache common log format.
rollback: Rollback an in-progress update. start: Start the specified server version.

它继续处理所有应用引擎插件目标...

这是我的pom

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<version>2.5.1</version>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</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/resources/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>

这只是插件部分,但除了 WEB-INF 目录的路径外,它与留言簿示例项目几乎完全相同

最佳答案

目前无法配置 appengine-maven-plugin 以使用不同的目录来存放 war 内容。最好创建一个多模块构建,其中一个子模块仅使用 maven-ant-plugin 来组装 war 目录,然后在该目录上运行插件。我认为我们不想在插件中进行配置,因为它并不真正与 maven-war-plugin 保持一致,并且配置它会使您的项目难以无缝地使用 maven-war-plugin future 。

除非您希望将版本号插值到 appengine-web.xml 中,否则您当前在 pom 中对 war-plugin 的配置不是必需的。我很乐意帮助您设置 pom,以便官方 Google App Engine Maven 插件能够为您正常工作。

关于google-app-engine - 使用 google appengine maven 插件部署 Jax-RS war,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14313341/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com