您好,登錄后才能下訂單哦!
今天就跟大家聊聊有關(guān)SpringBoot打jar包遇到的xml文件丟失該怎么解決,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
指定資源路徑
<resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> <filtering>true</filtering> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.*</include> </includes> </resource> </resources>
原因:沒有添加jsp打包路徑
解決方案:在pom.xml中添加如下代碼
<build> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/**</include> </includes> <filtering>false</filtering> </resource> <resource> <directory>src/main/java</directory> <excludes> <exclude> **/*.java </exclude> </excludes> </resource> <resource> <directory>src/main/webapp</directory> <!--注意此次必須要放在此目錄下才能被訪問到 --> <targetPath>META-INF/resources</targetPath> <includes> <include>**/**</include> </includes> </resource> </resources> </build>
原因:maven編譯版本問題
解決方案:將版本改為1.4.2.RELEASE(目前只有這個版本打jar包才能解析jsp)
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:repackage (default) on project fulan-demo: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:repackage failed: Unable to find a single main class from the following candidates
原因:沒有指定啟動類的位置
解決方案:在pol.xml中指定啟動類
<properties> <start-class>com.xxx.xxx.xxxApplication</start-class> </properties>
看完上述內(nèi)容,你們對SpringBoot打jar包遇到的xml文件丟失該怎么解決有進一步的了解嗎?如果還想了解更多知識或者相關(guān)內(nèi)容,請關(guān)注億速云行業(yè)資訊頻道,感謝大家的支持。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。