I have multimodule maven project
project
-submodule1
- pom.xml
-submodule2
- pom.xml
...
-submoduleN
- pom.xml
-pom.xml
The parent pom contains <distributionManagement> section which is actual for most of the submodels. Each submodule inherits parent pom. But I have 2 sumbodules where I would like to override distributionManagement section. I can achieve it with
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<altDeploymentRepository>cn-archetypes::default::https://repository.company.com/content/repositories/archetypes/</altDeploymentRepository>
</configuration>
</plugin>
Everything is ok except the fact that I would like to disable deployment of snapshots. I could achieve it nexus-staging-maven-plugin with skipStaging=true.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<altDeploymentRepository>cn-archetypes::default::https://repository.company.com/content/repositories/archetypes/</altDeploymentRepository>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<skipStaging>true</skipStaging>
<serverId>cn-archetypes</serverId>
<nexusUrl>https://repository.company.com/</nexusUrl>
</configuration>
</plugin>
But when I do that I got "Return code is: 400, ReasonPhrase: Bad Request."
I tried different combinations of maven-deployment-plugin and nexus plugin but there is no luck. Could someone suggest correct combination of properties for these deploy plugins or other approach to achieve overriding parent distribution management section with disabling staging deployment in a child submodule?