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中编译依然不能通过

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