In POM we have a version number of the project as

<version>1.4</version>

Instead of hardcoding it each time I take a new build, I would like to
replace it with the one entered by the user when he takes a buld using
maven. I want the user to enter the version number, which will be used
placed in maven's pom.xml and then used by Maven. So this is like modifying
the pom dynamically.

I was thinking to call a ant task (which in turn calls a shell script asking
for the user to enter the version number) from within the pom when the user
executes the *mvn install* command.

Is all this possible with the approach above? How do I call a ant task that
runs BEFORE maven proceeds for all other stuff.
Similar to a constructor that is executed when you create a java object, i
want this task to be run.

Please help.

One more thing: When you execute mvn install, Maven looks for java classes
in this default directory for the compile phase
<project_home>/src/main/java/com/<java_files>
test phase      <project_home>/src/test/java/com/<java_files>

How do I override this directory structure, and make maven look for the java
classes in the place that I decide.

Reply via email to