How does springboot use maven to package the local jar package in one piece

If we introduce the jar package into the springboot project locally, how can we package the local jar into the project release package when we package and release it?

1. We need to manually import the local jar package


      1.1 Select the project --> right-click (select as shown below)


     


      1.2 Then add the local jar package that needs to be imported


   


   1.3 After clicking apply, click the ok button, and the imported local jar package will be found in the location shown in the figure below.


  


  2. Create a lib folder in the location shown in the figure below


       


 3. Copy the jar package introduced in step 1 to the lib directory.


4. In the pom file of the project, add the following statement (replace according to your own jar package)

        <dependency>   
            <groupId>com.sap</groupId>  
            <artifactId>sapjco3</artifactId>  
            <version>3.0.12</version>  
            <scope>system</scope>  
            <systemPath>${project.basedir}/src/main/resources/lib/sapjco3.jar</systemPath>  
        </dependency>

  5. Repackage, you will find that the local jar package has been packaged into the release package of the project.

   

2018-1-9 Supplement:

Later, it was found that when using the springboot-1.5.6.RELEASE version, the jar package cannot be entered into the project by relying on the above method.

Add the following code to the pom file:

<plugins>
      <plugin>
          <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
		     <includeSystemScope>true</includeSystemScope>
		</configuration>
      </plugin>
</plugins>



 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324961731&siteId=291194637