idea開發工具 maven項目
該項目用到maven打包編譯,本地開發jar包使用maven管理,部分依賴jar包放在WEB-INF/lib目錄下,項目開發過程tomcat正常啟動開發,
然而部署使用maven install命令打war包時,則會出現“程序包xxx不存在的”錯誤
解決方案是讓maven既加載maven庫中的jar包,又要加載本地WEB-INF/lib下的jar包。
方法是在pom.xml文件中添加一段配置:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.8</source> <target>1.8</target> <encoding>UTF-8</encoding> <compilerArguments> <extdirs>${project.basedir}/src/main/webapp/WEB-INF/lib</extdirs> </compilerArguments> </configuration> </plugin>