"Stepping on the pit record" IDEA maven project packaging dependencies depend on the jar package

Ho1aAs 2022-08-06 12:24:30 阅读数:505

steppingpitrecordideamaven

问题描述

默认打包jar,没有pom.xml的dependencies依赖

Using packaging plug-in

在pom.xml添加插件maven-assembly-plugin

 <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<!--jar包名称-->
<finalName>${project.artifactId}-${project.version}</finalName>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
<!--manifest.mf配置-->
<!--为了做premain而修改的-->
<manifestEntries>
<Premain-Class>Xxx</Premain-Class>
<Agent-Class>Xxx</Agent-Class>
<Can-Redefine-Classes>true</Can-Redefine-Classes>
<Can-Retransform-Classes>true</Can-Retransform-Classes>
</manifestEntries>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

欢迎关注我的CSDN博客 :@Ho1aAs
版权属于:Ho1aAs
本文链接:https://blog.csdn.net/Xxy605/article/details/126133543
版权声明:本文为原创,转载时须注明出处及本声明

copyright:author[Ho1aAs],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/218/202208061216040099.html