简体   繁体   中英

replace nexus staging maven plugin with maven-deploy-plugin

Our project inherits nexus staging maven plugin from a parent pom which we don't have control on. I have this configuration in my root pom to disable the nexus staging maven plugin and this configuration seems to disabling the default-deploy execution.

<plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <executions>
            <execution>
              <id>default-deploy</id>
              <phase>none</phase>
            </execution>
          </executions>
          <configuration>
            <serverId>nexus</serverId>
            <nexusUrl>url</nexusUrl>
            <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
          </configuration>
        </plugin>

and I have the maven deploy plugin defined in my root pom, but the maven-deploy plugin seems to be not kicking off

<plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.7</version>
        <executions>
          <execution>
            <id>default-deploy</id>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

I am not able to figure out how i can replace the inherited nexus staging maven plugin with the maven deploy plugin. Any help is much appreciated

您可以通过插件groupID:artefactID限定目标:

mvn org.apache.maven.plugins:maven-deploy-plugin:deploy

I faced a similar issue, and for success disabling of nexus-staging-maven-plugin I only need to add following to my main pom:

<plugin>
    <groupId>org.sonatype.plugins</groupId>
    <artifactId>nexus-staging-maven-plugin</artifactId>
    <extensions>false</extensions>
</plugin>

And as one of my dependencies was disabling maven-deploy-plugin (I reccomend to check it also in your project) I also need to add:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-deploy-plugin</artifactId>
    <configuration>
        <skip>false</skip>
    </configuration>
</plugin>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM