[TOC]
- 拉取代码后需要install到本地仓库
- 创建普通maven项目
- pom.xml 加入依赖
<dependencyManagement> <!-- 需要提前install到本地仓库--> <dependencies> <dependency> <groupId>com.wz</groupId> <artifactId>wz-component</artifactId> <version>${wz-component.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>com.wz</groupId> <artifactId>wz-common</artifactId> </dependency> </dependencies> <build> <finalName>${artifactId}</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
- 编写App启动类
@SpringBootApplication public class App { public static void main(String[] args) { SpringApplication.run(App.class, args); } }
- 创建普通maven项目
- 跟pom.xml文件加入
<dependencyManagement> <!-- 引入jitpack 打好的依赖--> <dependencies> <dependency> <groupId>com.github.wz-dazhi.wz-component</groupId> <artifactId>wz-component</artifactId> <version>${wz-component.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>com.wz</groupId> <artifactId>wz-common</artifactId> </dependency> </dependencies> <!-- 加入jitpack仓库 --> <repositories> <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository> </repositories> <build> <finalName>${artifactId}</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
- 编写App启动类
@SpringBootApplication public class App { public static void main(String[] args) { SpringApplication.run(App.class, args); } }