maven中有一个大多数人都忽视或者没有用到过的一个功能——install,大多数java开发人员都了解maven,使用maven进行依赖管理。但使用的大多数功能不过是clean清理、compile编译、package打包,却很少用到install这个功能,接下来就来归纳一下install的使用。
在使用maven管理项目时,我们可以将当前项目直接构建成maven依赖,导入到其他项目中进行使用。
<groupId>com.demo.spring</groupId>
<artifactId>CK567-spring-boot-starter</artifactId>
<version>1.0.0</version>
这是当前项目的pom文件,我们只需要将该项目进行install,然后将上面的pom引入到另一个项目的pom.xml文件中。
<dependencies>
<dependency>
<groupId>com.demo.spring</groupId>
<artifactId>CK567-spring-boot-starter</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
即可。