【问题标题】:replace nexus staging maven plugin with maven-deploy-plugin用 maven-deploy-plugin 替换 nexus staging maven 插件
【发布时间】:2018-11-03 16:40:20
【问题描述】:

我们的项目从我们无法控制的父 pom 继承了 nexus staging maven 插件。我在我的根 pom 中有这个配置来禁用 nexus staging maven 插件,这个配置似乎禁用了默认部署执行。

<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 插件,但是 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 插件。非常感谢任何帮助

【问题讨论】:

    标签: maven nexus


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

      我遇到了类似的问题,为了成功禁用 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>
      

      【讨论】:

        猜你喜欢
        • 2014-10-07
        • 2012-09-26
        • 1970-01-01
        • 2018-01-17
        • 2015-04-09
        • 2012-07-14
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多