I'm looking to deploy alongside my jars, wars, etc. an XML file. I can do this manually with a classifier:
mvn deploy:deploy-file -DgroupId=${GROUP_ID} \
-DartifactId=$ARTIFACT_ID \
-Dversion=$VERSION \
-Dpackaging=xml \
-Dclassifier=metadata \
-Dfile=metadata.xml \
-DrepositoryId=releases \
-Durl=http://localhost/nexus/content/repositories/releases \
-DgeneratePom=false
I'd like to have the xml file populated from properties in the pom.xml and have it deployed alongside the main artifact in one simple command, something to apply to all our internal projects.
Is it possible to configure the deploy plugin to do this (and how)? Or do I need to go down some other route (custom maven plugin perhaps)?
The best solution for such purposes is simply using the build-helper-maven-plugin like this:
With such kind of setup you can use the usual
mvn deploy
which will also deploy the additional artifacts which you can attach to your usual build artifacts.