使用maven-deploy-plugin替换nexus staging maven插件

5
我们的项目继承了一个父POM中的Nexus Staging Maven插件,但我们无法控制它。我在根POM中配置了禁用Nexus Staging Maven插件的选项,但这个配置似乎也禁用了默认的部署执行。请注意,HTML标签已被保留。
<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>

我在根POM中定义了Maven Deploy插件,但似乎这个插件没有启动。

<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>

我不知道如何用maven deploy插件替换继承的nexus staging maven插件。非常感谢任何帮助。

2个回答

1

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

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

0

我遇到了类似的问题,为了成功禁用 nexus-staging-maven-plugin,我只需要在我的主要 pom 文件中添加以下内容:

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

由于我的一个依赖项禁用了maven-deploy-plugin(我建议您在项目中也检查一下),因此我还需要添加:

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接