`

Maven install 报“...找不到符号”编译错误的信息

阅读更多

项目中,使用的是maven管理,但是有几个jar不是通过maven引入的,是通过外部导入的,在使用maven插件编译的时候,会出现如下的一些错误:

解决方法:

在项目中创建一个目录lib,然后将jar复制到该文件夹下,最后在maven编译插件中配置如下

 

复制代码
 1             <plugin>
 2                 <groupId>org.apache.maven.plugins</groupId>
 3                 <artifactId>maven-compiler-plugin</artifactId>
 4                 <version>3.1</version>
 5                 <configuration>
 6                     <source>1.7</source>
 7                     <target>1.7</target>
 8                     <encoding>UTF-8</encoding>
 9                     <!-- 这里是新添加的-->
10                     <compilerArguments>
11                         <!-- 对应jar放置在项目中的位置-->
12                         <extdirs>lib</extdirs>
13                     </compilerArguments>
14                 </configuration>
15             </plugin>


原文链接:https://www.cnblogs.com/linbo3168/p/6548532.html
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics