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> 

!更好的方式是配置編譯參數<compilerArguments>,添加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>src\main\webapp\WEB-INF\lib</extdirs>
                 </compilerArguments>
              </configuration>
            </plugin>
        </plugins>
    </build>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章