I'm looking into replacing the maven-deploy-plugin with the nexus-staging-maven-plugin.
Now some of the sub-modules of my project (e.g. integration test modules) are not to be deployed to the Nexus server. I used to disable the deployment of these modules via the "maven.deploy.skip" property. I cannot find anything comparable for the nexus-staging-maven-plugin, though. Is there another way for skipping single modules from deployment using this plug-in?
I also tried to bind the plug-in to the pseudo phase "none" as described here, but examining the effective POM, there is still the injected execution of the plug-in (I assume that's due to the way how it replaces the existing deploy plug-in).
The easiest way I found to deal the limitations of nexus-staging-maven-plugin is to isolate any module you do not want to deploy into a separate Maven profile, and exclude it when a deploy occurs. Example:
In the above example, I avoid building and deploying the "test" and "benchmark" modules. If you want to run unit tests without deploying them, use separate runs:
You can set the configuration property
skipNexusStagingDeployMojo
of a given submodule to true. See more configuration properties documented in the Nexus book chapter about deployment to staging.Faced similar problem. Solution that worked for me was adding deployment plugin with skip as true in modules that need to be excluded from deploy task.