0
点赞
收藏
分享

微信扫一扫

将公共的代码抽离出来,打成公共的lib包的方法


第一步:编辑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 打包。

打包后的文件:

将公共的代码抽离出来,打成公共的lib包的方法_intellij-idea

将这个文件上传到maven私服上即可。

获取对应的maven依赖,就可加入到新的项目中


举报

相关推荐

0 条评论