Sometimes, when one of your modules is used by different applications, but requires slight changes, you want to create different artifacts, that can be direct dependencies of those applications.
You can do this by using profiles and classifiers.
You can create your pom, the usual way, with profiles…more here, then apply classifiers to the package plugin inside your profile, like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>war</goal>
</goals>
<configuration>
<classifier>standalone</classifier>
</configuration>
</execution>
</executions>
</plugin>
This will produce an artifact with finalName
${artifactId}-${version}-${clasifier}
that will be accessible by specifying the classifier in your dependency.
Just remember to use executions because it will not work otherwise. It will build the artifacts, but will not deploy them.

Wow wie immer ein interessanter Post. Wenn doch nur alle Blogs so qualtitativ hochwertig wären. Ich habe auch einen Blog über kleinere Simulationen, könntest Du mir dazu auch Feedback geben? Meine Simulation. Vielen Dank im Voraus! MFG
Bok Demuth
30 Mar 10 at 11:45 am