I'm building NARs on multiple platforms (Mac and Windows). The build is complicated and can't be done via the Maven NAR plugin as such, but I'm building the nar files myself and using the mvn
command-line tool for deployment.
The typical way to do deployment is in one shot, e.g.
mvn deploy:deploy-file \
-Dfile=foobar.jar \
-Dpackaging=jar \
-Dfiles=foobar-x86_64-MacOSX-gcc-shared.nar,foobar-x86_64-Windows-MSVC-shared.nar \
-Dclassifiers=x86_64-MacOSX-gcc-shared,x86_64-Windows-MSVC-shared \
-Dtypes=nar,nar \
-DgroupId=com.example \
-DartifactId=foobar \
-Dversion=1.0.0-SNAPSHOT \
-Durl=$URL \
-DrepositoryId=nexus
However, because the builds are running on different boxes, the publishing step can't happen in one shot. Ideally, I'd like to be able to "append" the attachments to the primary artifact as the builds finish. ie.,
Run this once:
mvn deploy:deploy-file \
-Dfile=foobar.jar \
-Dpackaging=jar \
-DgroupId=com.example \
-DartifactId=foobar \
-Dversion=1.0.0-SNAPSHOT \
-Durl=$URL \
-DrepositoryId=nexus
Then on the Mac build slave:
mvn deploy:deploy-file \
-Dfiles=foobar-x86_64-MacOSX-gcc-shared.nar \
-Dclassifiers=x86_64-MacOSX-gcc-shared \
-Dtypes=nar \
-DgroupId=com.example \
-DartifactId=foobar \
-Dversion=1.0.0-SNAPSHOT \
-Durl=$URL \
-DrepositoryId=nexus
Then on the Windows build slave:
mvn deploy:deploy-file \
-Dfiles=foobar-x86_64-Windows-MSVC-shared.nar \
-Dclassifiers=x86_64-Windows-MSVC-shared \
-Dtypes=nar \
-DgroupId=com.example \
-DartifactId=foobar \
-Dversion=1.0.0-SNAPSHOT \
-Durl=$URL \
-DrepositoryId=nexus
The first command works fine, of course. But the two build slave commands fail with
The parameters 'file' for goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file are missing or invalid
because it thinks it needs the primary artifact.
How can I specify that I'm appending to the publication, not creating an entirely new one?