Using Maven to add local dependencies

Time:2021-3-15

Sometimes projects use__ jar__ Package in__ maven__ If you can’t find it in the library, you can store it in the local library directly__ pom.xml__ Lieutenant general__ jar__ The package is added to the dependency of the project through configuration. The specific configuration is as follows:

<dependency>   
    <groupId>group-id</groupId>   
    <artifactId>artifact-id</artifactId>   
    <version>2.0</version>   
    <scope>system</scope>   
    <systemPath>${project.basedir}/src/main/xxx</systemPath>   
</dependency>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.1.1</version>
    <configuration>
        <webResources>
            <resource>
                <directory>${project.basedir}/src/main/resources/lib</directory>
                <targetPath>WEB-INF/lib</targetPath>
                <filtering>false</filtering>
                <includes>
                    <include>**/*.jar</include>
                </includes>
            </resource>
        </webResources>
    </configuration>
</plugin>`