当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Add one spring-boot project as a jar to another project

问题描述:

I have spring-boot project, wich I packaged into JAR-file, and now I want to add this jar-file to another project, can I implement it?

网友答案:

You have to specify the main class in your maven configuration or gradle configuration. Also in any case exclude from scanning the main class and other classes that might cause conflicts.

Same applies for your dependencies in case of conflicts.

网友答案:

(1) You must build Spring Boot application in JAR files (It's fat JAR, executable JAR file). This JAR file has G-A-V (GroupId, Artifact and Version). You must run Maven install command to add this JAR file to local repository.

(2) Use build tool (like Maven or Gradle) to add this file to dependency list in normal way.

分享给朋友:
您可能感兴趣的文章:
随机阅读: