Spring Boot项目发布为第三方依赖

SpringBoot项目用maven打成jar包,若是不有意配置,是不能做为第三方依赖的,即别的项目不能引用它。若是想将其发布为第三方依赖,须要在其pom文件中作以下处理:html

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <executions>
                <execution>
                    <goals>
                        <goal>repackage</goal>
                    </goals>
                    <configuration>
                        <classifier>exec</classifier>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

参考来源:spring

http://blog.csdn.net/guduyishuai/article/details/60968728maven

https://stackoverflow.com/questions/40089443/how-to-add-a-dependency-to-a-spring-boot-jar-in-another-projectspring-boot

http://docs.spring.io/spring-boot/docs/1.4.1.RELEASE/maven-plugin/examples/repackage-classifier.htmlui

相关文章
相关标签/搜索