xyb*_*rek 2 java google-app-engine web.xml maven
什么Maven插件可用于具有appengine-web.xml应用程序生成基于Maven的运行配置文件,例如-Pdev或-Pprod
例:
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>myapp-dev</application>
<version>1</version>
<static-files/>
<threadsafe>true</threadsafe>
<precompilation-enabled>false</precompilation-enabled>
</appengine-web-app>
Run Code Online (Sandbox Code Playgroud)
对于a -Pdev,当配置文件是-Pprod
应用程序名称将是: <application>myapp-prod</application>
您可以使用maven-war-plugin来更改应用程序的版本和名称
在appengine-web.xml上,写下以下行
<application>${appengine.app}</application>
<version>${version.number.gae}</version>
Run Code Online (Sandbox Code Playgroud)
这是你需要的maven插件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warSourceDirectory>${project.basedir}/src/main/webapp</warSourceDirectory>
<webappDirectory>${project.build.directory}/${project.artifactId}</webappDirectory>
<filters>
<filter>src/main/resources/application.properties</filter>
<filter>src/main/webapp/WEB-INF/appengine-web.xml</filter>
</filters>
<webResources>
<resource>
<directory>src/main/webapp</directory>
<filtering>true</filtering>
<includes>
<include>**/appengine-web.xml</include>
<include>**/web.xml</include>
<include>open_graph/**</include>
</includes>
</resource>
</webResources>
<!-- Exclude all timestamp specific static files. (see maven-resource-plugin in this pom.xml) -->
<warSourceExcludes>css/**,flash/**,mobile/**,images/**,<!--js/**,-->sounds/**,channel.html</warSourceExcludes>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
和maven配置文件
<profiles>
<profile>
<id>dev</id>
<properties>
<appengine.app>my-gae-dev</appengine.app>
<version.number.gae>1</version.number.gae>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<appengine.app>my-gae-prod</appengine.app>
<version.number.gae>1</version.number.gae>
</properties>
</profile>
</profiles>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2123 次 |
| 最近记录: |