第一步:编辑pom.xml的
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>lib</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>lib</classifier>
<excludes>
<exclude>application.properties</exclude>
<exclude>com/geexek/htabletemplate/HtabletemplateApplication.class</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
注意:这里要排除application.properties和com/geexek/htabletemplate/HtabletemplateApplication.class 打包。
打包后的文件:

将这个文件上传到maven私服上即可。
获取对应的maven依赖,就可加入到新的项目中
本文详细介绍了如何编辑Maven的pom.xml文件,配置spring-boot-maven-plugin和maven-jar-plugin,以排除特定文件并打包应用。打包完成后,将jar文件上传到Maven私服,以便于其他项目通过依赖管理进行引用。
1697

被折叠的 条评论
为什么被折叠?



