chore(deploy): fix `maven.deploy.skip` problem for submodule

This commit is contained in:
Jerry Lee 2022-06-03 04:09:48 +08:00
parent a3177fe714
commit 52e7d7c49b
3 changed files with 14 additions and 19 deletions

View File

@ -97,13 +97,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>${maven.deploy.skip}</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>

14
pom.xml
View File

@ -44,6 +44,9 @@
<junit5.version>5.8.2</junit5.version>
<kotest.version>5.3.0</kotest.version>
<jmh.version>1.35</jmh.version>
<!-- overridden by submodule that need skip deploy -->
<maven.deploy.skip>false</maven.deploy.skip>
</properties>
<modules>
@ -511,6 +514,11 @@
</executions>
</plugin>
<plugin>
<!--
If you are deploying to Maven Central,
it is the Nexus Staging Plugin that is doing the deployment instead of the `deploy` plugin,
so the configuration of the `deploy` plugin has no effect.
-->
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
@ -519,6 +527,12 @@
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<!--
To make the Nexus deploy plugin skip,
set skipNexusStagingDeployMojo in its configuration to true.
see: https://stackoverflow.com/questions/59552549/preventing-maven-modules-from-being-deployed
-->
<skipNexusStagingDeployMojo>${maven.deploy.skip}</skipNexusStagingDeployMojo>
</configuration>
</plugin>

View File

@ -27,16 +27,4 @@
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>${maven.deploy.skip}</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>