idea开发,maven编译的时候发现报错:程序包不存在
如上图所示,easypoi是我在lib目录下自己添加的jar包。
但我们在错误代码下又能进到该类的classes文件,就是编译通不过。要解决程序包不存在的问题的话只需要在pom文件下新增如下代码即可
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> <encoding>UTF-8</encoding> <compilerArguments> <extdirs>${project.basedir}/src/main/webapp/WEB-INF/lib</extdirs> </compilerArguments> </configuration> </plugin>
具体的结构看下图,其实就是在build下