解决Maven引用本地jar包的问题

配置Maven使用本地Jar包,需要修改pom.xml文件,添加如下XML片段:

1. 引用少量外部jar包时:
<dependency> 
  <groupId>org.apache</groupId> 
  <artifactId>test</artifactId> 
  <version>1.0</version> 
  <scope>system</scope> 
  <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/test.jar</systemPath>
</dependency>


2. 引用很多外部jar包时:
<plugin>
  <artifactId>maven-compiler-plugin</artifactId>
  <configuration>
    <source>1.6</source>
    <target>1.6</target>
    <encoding>UTF-8</encoding>
    <compilerArguments>
      <extdirs>src\main\webapp\WEB-INF\lib</extdirs>
    </compilerArguments>
  </configuration>
</plugin>

猜你喜欢

转载自godandghost.iteye.com/blog/2219457