Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven 从部署到Nexus中排除具有依赖项的jar_Maven_Maven Shade Plugin - Fatal编程技术网

Maven 从部署到Nexus中排除具有依赖项的jar

Maven 从部署到Nexus中排除具有依赖项的jar,maven,maven-shade-plugin,Maven,Maven Shade Plugin,我正在使用创建一个包含所有依赖项的附加jar。shade阶段链接到package阶段,因此每次我执行mvn包时都会创建带有依赖项的jar 但是,我不希望在mvn部署期间将这个带有依赖项的jar部署到Nexus。如何避免这种情况?实现这一目的的最佳解决方案是将maven shade插件配置放入在部署阶段未激活的配置文件中 实现此目的的最佳解决方案是将maven shade插件配置放入在部署阶段未激活的概要文件中 出于同样的需要,我从GitHub中派生了maven部署插件插件进行更改,以便从部署中排

我正在使用创建一个包含所有依赖项的附加jar。shade阶段链接到package阶段,因此每次我执行
mvn包时都会创建带有依赖项的jar


但是,我不希望在
mvn部署期间将这个带有依赖项的jar部署到Nexus。如何避免这种情况?

实现这一目的的最佳解决方案是将maven shade插件配置放入在部署阶段未激活的配置文件中

实现此目的的最佳解决方案是将maven shade插件配置放入在部署阶段未激活的概要文件中

出于同样的需要,我从GitHub中派生了maven部署插件插件进行更改,以便从部署中排除特定的附加工件,如下所示:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-deploy-plugin</artifactId>
  <version>3.0.0-SNAPSHOT</version>
  <configuration>
    <skipAttachedArtifacts>
      <artifact>
        <groupId>com.sample</groupId>
        <artifactId>something</artifactId>
        <version>${project.version}</version>
        <packaging>jar</packaging>
        <classifier>shaded</classifier>
      </artifact>
    </skipAttachedArtifacts>
  </configuration>
</plugin>

org.apache.maven.plugins

这里是我在apache插件项目上提交的pull请求的链接:

出于同样的需要,我从GitHub中派生了maven部署插件插件进行更改,以便从部署中排除特定的附加工件,如下所示:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-deploy-plugin</artifactId>
  <version>3.0.0-SNAPSHOT</version>
  <configuration>
    <skipAttachedArtifacts>
      <artifact>
        <groupId>com.sample</groupId>
        <artifactId>something</artifactId>
        <version>${project.version}</version>
        <packaging>jar</packaging>
        <classifier>shaded</classifier>
      </artifact>
    </skipAttachedArtifacts>
  </configuration>
</plugin>

org.apache.maven.plugins

这里是我在apache插件项目上提交的pull请求的链接:

为什么您要通过maven shade创建一个补充工件,但不想部署它?我们需要在运行时使用它。正如您所建议的,运行时概要文件可能是正确的选择。让我试试。为什么你要通过maven shade创建一个补充工件,但不想部署它?我们在运行时需要它。正如您所建议的,运行时概要文件可能是正确的选择。让我试一试。你能举个例子吗?我想要的实际上是一样的,但倒过来的:我想要排除部署上的某些依赖项。你能举个例子吗?我想要的实际上是一样的,但倒过来的:我想要排除部署上的某些依赖项。