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.

Dmitry
  • 2,943
  • 1
  • 23
  • 26
ecbrodie
  • 11,246
  • 21
  • 71
  • 120

2 Answers2

1

A common/easy way to solve this kind of problems is to use maven profile. Just create a new profile that includes the plugin with preferred phases.

bsorrentino
  • 1,413
  • 11
  • 19
  • That's good information to know, but still doesn't answer about how I can get the Maven plugin to not execute previous steps in the build lifecycle. – ecbrodie Jul 12 '13 at 21:08
0

You should probably don't fight with it and just run clean appengine:devserver_start instead of clean install. Read my answer here for a more detailed explanation: https://stackoverflow.com/a/17638442/2464295

Community
  • 1
  • 1
ceilfors
  • 2,617
  • 23
  • 33