Springboot自定义parent并打可执行jar

parent:

定义依赖版本

<dependencyManagement>

.......

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-dependencies</artifactId>

<version>2.1.3.RELEASE</version>

<type>pom</type>

<scope>import</scope>

</dependency>

.......

</dependencyManagement>


子项目

<parent>

<groupId>com.xiuluo</groupId>

<artifactId>parent</artifactId>

<version>1.0-SNAPSHOT</version>

</parent>


<build>

<plugins>

<plugin>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-maven-plugin</artifactId>

<executions>

<execution>

                    <id>spring-boot-repackage</id>

<phase>package</phase>

                    <goals>

<goal>repackage</goal>

                    </goals>

</execution>

</executions>

<configuration>

<mainClass>com.xiuluo.ApiApplication</mainClass>

</configuration>

</plugin>

</plugins>

</build>

然后直接mvn package即可

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。