解決idea下maven打包無法加載本地lib/下的jar包問題(程序包XXX不存在)


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>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM