springboot打包成jar檔案無法正常執行,解決辦法已經找到
阿新 • • 發佈:2018-11-10
1.pom.xml 指向啟動頁
<!-- 打包包名 -->
<build>
<finalName>bigData</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!--這裡寫上main方法所在類的路徑-->
<configuration>
<mainClass>com.jainfo.DataApplication</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
2專案根目錄下執行此命令
mvn clean package