Unable to find a single main class from the following candidates


關於start-class,spring boot官方手冊是這么說明的:

The plugin rewrites your manifest, and in particular it manages the Main-Class and Start-Class entries, so if the defaults don't work you have to configure those there (not in the jar plugin). The Main-Class in the manifest is actually controlled by the layout property of the boot plugin, e.g.

<build> ... <plugins> ... <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>1.4.0.RELEASE</version> <configuration> <mainClass>${start-class}</mainClass> <layout>ZIP</layout> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> ... </plugins> ... </build>

所以,當你的默認方式不好用的時候,在properties中,加入一個start-class的屬性,用於告訴spring boot maven plugin哪個類是入口類即可。



文/BeeNoisy(簡書作者)
原文鏈接:http://www.jianshu.com/p/b521f819b06a
著作權歸作者所有,轉載請聯系作者獲得授權,並標注“簡書作者”。

 


免責聲明!

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



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