我一直在使用 Maven 程序集插件来创建 uber jar 并部署到 Artifactory。 我切换到 Maven 阴影插件来遮蔽一些依赖项。 现在我的 jar 没有在安装阶段部署。
在maven程序集插件文档中:
When the assembly is created it will use the assemblyId as the artifact's classifier and will attach the created assembly to the project so that it will be uploaded into the repository in the install and deploy phase.
这不是着色插件的情况。 如何配置maven pom来部署使用shaded插件创建的uber jar?
最佳答案
你必须告诉maven-shade-plugin to attach阴影 Artifact 可以通过以下方式完成:
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>jackofall</shadedClassifierName> <!-- Any name that makes sense -->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
</project>
关于maven - 使用 maven-shaded-plugin 安装 uber jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60862915/