Tag Archives: How to Introduces Local Jar Package

Springboot Project: How to Introduces Local Jar Package

Jar package

The path of the jar package is in the boot-inf/lib directory

Create a jar folder under the Resources folder and paste the jar package in.

Enter POM file to join

        <dependency>
            <groupId>com.jayZhou</groupId>
            <artifactId>aaaa-client-sso</artifactId>
            <version>1.0-1.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/jar/aaaa-client-sso-1.0-1.0.jar</systemPath>
        </dependency>

Groupid, artifactid and version can be written freely

You also need to add it on the last side and type it in when you pack it

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

So far, the jar package has been successfully introduced

War package

(this method is not attempted)

The jar package is in the WEB-INF/lib directory

You need to add the following to the POM file

     <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.4</version>
                    <configuration>
                        <webResources>
                            <resource>
                                <directory>src/main/resources/jar/</directory>
                                <targetPath>WEB-INF/lib/</targetPath>
                                <includes>
                                    <include>**/*.jar</include>
                                </includes>
                            </resource>
                        </webResources>
                    </configuration>
                </plugin>