0

When I build my application with maven, I run mvn clean install. As a part of the install lifecycle, I run appengine:devserver_start from Google's GAE Maven plugin. This appears to be already bound to a step in the lifecycle and therefore it reruns some build steps from the beginning, even though me running mvn install did those. For example, the resources step is rerun. I had my own Java script run to download the latest resources for my build. But because of appengine:devserver_stop, I need to uselessly run this cript again because the resources step is re-executed.

I can think of two ways I can avoid this, but I'm not sure how to configure both ways. The first would be to somehow skip re-running build steps that I've already run. The other way would be to change the Maven POM properties just for the plugin execution. I have a Maven property set, either to true or false, that I can use to set the skip setting for the Java script I use during resources (because I run this script using the exec-maven-plugin). Think of this as a Maven property that can be set with the -D flag. Can I have this property changed just for the plugin?

If you are having trouble thinking about my scenario, consider what happens when you run mvn compile install. All build lifecycle steps until compile will run, then all compile steps until install will run, including compile.

4

2 回答 2

1

解决此类问题的常见/简单方法是使用maven profile。只需创建一个包含具有首选阶段的插件的新配置文件。

于 2013-07-11T07:15:35.143 回答
0

您可能不应该与之抗争,而应该运行clean appengine:devserver_start而不是clean install. 在此处阅读我的答案以获得更详细的解释: https ://stackoverflow.com/a/17638442/2464295

于 2013-07-15T14:45:22.300 回答