springboot專案打包提示Unable to find a single main class from the following candidates錯誤

魔豆發表於2018-02-06

提示Unable to find a single main class from the following candidates錯誤的原因是會從所有程式碼裡面掃描包括main方法的類,找到多個類就報錯了。

解決辦法是在pom.xml指定啟動的類:

    <properties>
        <start-class>com.corp.MyApplication</start-class>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

 

相關文章