Niranjan Deshpande schrieb: > 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. >
Ecch. Why on earth would you want to do that? Are you aware that snapshots can have a date suffix (in fact, it's the default)? > 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. > You can't do it within maven. You would have to run ant to do this, *then* run maven. Again, the question is: why would you want to do this? > 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. > I recommend reading the pom documentation. It shows all the possible configuration available with maven: http://maven.apache.org/ref/current/maven-model/maven.html See "sourceDirectory". But maven has its built-in conventions for a good reason. You should think seriously about doing things the Maven way, rather than reconfiguring maven to work your way. Regards, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]