首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >appengine-maven-plugin在代码更改后不自动部署代码

appengine-maven-plugin在代码更改后不自动部署代码
EN

Stack Overflow用户
提问于 2014-09-02 21:17:33
回答 1查看 284关注 0票数 1

我有一个appengine maven项目,它使用了新推荐的模块结构。所以我有一个ear模块,它包含两个war子模块。我从ear目录中使用run mvn appengine:devserver来运行代码。我希望maven在我保存任何代码更改后立即部署它,这样我就可以刷新浏览器并查看更改,但这似乎不起作用。这是我的耳塞。

target/${project.artifactId}-${project.version}/*/WEB-INF/classes org.apache.maven.plugins maven-ear-plugin 2.85库warcom.google.appengine appengine-maven-plugin ${appengine.target.version} 2

代码语言:javascript
复制
<dependencies>
    <dependency>
        <groupId>com.blah.app</groupId>
        <artifactId>A</artifactId>
        <version>1.0-SNAPSHOT</version>
        <type>war</type>
    </dependency>
    <dependency>
        <groupId>com.blah.backend</groupId>
        <artifactId>B</artifactId>
        <version>1.0-SNAPSHOT</version>
        <type>war</type>
    </dependency>
</dependencies>

按照我在buildOuputput目录中build指令下添加的关于https://developers.google.com/appengine/docs/java/tools/maven的建议,我还指定了

代码语言:javascript
复制
<configuration>
  <fullScanSeconds>2</fullScanSeconds>
</configuration>

在appengine-maven-plugin插件下。我还在netbeans中启用了在保存时编译选项,但maven似乎没有在devappserver运行时扫描classes文件夹和部署更改。

现在,对于每一个小的变化,我都被困在干净的构建/部署周期中。我真的很感激在这方面的任何帮助。

EN

回答 1

Stack Overflow用户

发布于 2014-10-31 06:55:20

我设法让它在Eclipse中工作,方法是从编译阶段调用war: managed并在m2e配置中添加一个映射,这样它就可以在Eclipse中的增量构建中运行它。我不确定这在Netbeans中是如何工作的,但也许我的Eclipse解决方案会对您有所帮助。

以下是我的pom的相关部分:

这是配置war的部分:爆炸执行:

代码语言:javascript
复制
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.4</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>
            <executions>
                <execution>
                    <phase>compile</phase>
                    <goals>
                        <goal>exploded</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

这是配置m2e的部分(在pom.xml的build部分):

代码语言:javascript
复制
      <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        org.apache.maven.plugins
                                    </groupId>
                                    <artifactId>
                                        maven-war-plugin
                                    </artifactId>
                                    <versionRange>
                                        [2.4,)
                                    </versionRange>
                                    <goals>
                                        <goal>
                                            exploded
                                        </goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute>
                                        <runOnIncremental>true</runOnIncremental>
                                        <runOnConfiguration>true</runOnConfiguration>
                                    </execute>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25624372

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档