步驟
1、新建一個(gè)完整的springboot項(xiàng)目蠢挡,留待制作jar包
2儒鹿、在該項(xiàng)目的pom文件build標(biāo)簽內(nèi)添加插件
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
<classifier>exec</classifier>
</configuration>
</plugin>
</plugins>
</build>
3化撕、mvn clean
4、mvn compile
5约炎、mvn install
注意:mvn package是打jar包植阴,并存放在項(xiàng)目的target目錄下,而mvn install是打jar包圾浅,并安裝到本機(jī)的maven倉庫掠手,即m2文件夾內(nèi)
6、在另一個(gè)項(xiàng)目的pom文件中直接引入該jar包狸捕,類似于:
<dependency>
<groupId>com.software</groupId>
<artifactId>springbootjar</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>