maven打包時,lib文件夾下的jar無法加載(程序包不存在)

maven打包時,lib文件夾下的jar無法加載(程序包不存在)

程序能正常run、debug,但是使用maven進行 package打包時,卻出現" java: 程序包xxxx不存在"的問題。解決辦法如下:
在pom.xml中加入如下代碼:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                    <encoding>UTF-8</encoding>
                    <compilerArguments>
                        <extdirs>${project.basedir}/src/main/webapp/WEB-INF/lib</extdirs>
                    </compilerArguments>
                </configuration>
            </plugin>

問題解決。

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