How can I achieve in Maven that when executing "mvn install" from the command line will automatically decide to build the artifact (jar/war) only if that artifact has not already been installed in the local repository?
I've already tried with profiles, the problem here is that in the "activation" task I cannot reference my local repository through a Maven property. I cannot hardcode the local repository as that would break my build in a different environment.
I also tried a workaround by touching a file in a previous phase, e.g. initialize and then check for the existence of the file as activation condition, but this doesn't work because the activation condition is evaluated before the initializing is performed.
Any hints or ideas how to solve this problem?
Thanks, Peter