maven 添加本地jar

方式一

Xml代码 

<dependency> 

<groupId>org.apache</groupId> 

<artifactId>test</artifactId> 

<version>1.0</version> 

<scope>system</scope> 

<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/paypal_base.jar</systemPath> 

</dependency> 


方式二:

添加extdirs将jar包相对路径添加到配置中,如下:

<build>

        <plugins>

            <plugin>

              <artifactId>maven-compiler-plugin</artifactId>

              <configuration>

                  <source>1.6</source>

                  <target>1.6</target>

                  <encoding>UTF-8</encoding>

                  <compilerArguments>

                   <extdirs>srcmainwebappWEB-INFlib</extdirs>

                 </compilerArguments>

              </configuration>

            </plugin>

        </plugins>

    </build>

原文地址:https://www.cnblogs.com/rigid/p/5286943.html