maven依賴非maven庫中jar的方法

直接上代碼

pom.xml中:紅色字體內容是重點,這樣在使用maven編譯打包時就會引用這裏的依賴了,不會導致編譯失敗了。

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<encoding>${maven.compiler.encoding}</encoding>
<source>1.6</source> 
<target>1.6</target>
<compilerArguments>
<extdirs>src\main\webapp\WEB-INF\lib</extdirs>
</compilerArguments>

</configuration>
<executions>
<execution>
<phase>compile</phase>
</execution>
</executions>
</plugin>

但是在IDE中也需要單獨引用jar包,不然在IDE中編譯依然不能通過

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