SpringBlade项目使用Docker打包部署时,打包到blade-common 模块报错。

Blade 未结 1 913
zhengfuyou
zhengfuyou 剑童 2020-07-30 17:06

[INFO] Reactor Summary for SpringBlade 2.7.1:

[INFO]

[INFO] SpringBlade ........................................ SUCCESS [  8.964 s]

[INFO] blade-common ....................................... FAILURE [  3.070 s]

[INFO] blade-service-api .................................. SKIPPED

[INFO] blade-user-api ..................................... SKIPPED

[INFO] blade-auth ......................................... SKIPPED

[INFO] blade-gateway ...................................... SKIPPED

[INFO] blade-ops .......................................... SKIPPED

[INFO] blade-admin ........................................ SKIPPED

[INFO] blade-dict-api ..................................... SKIPPED

[INFO] blade-develop ...................................... SKIPPED

[INFO] blade-resource ..................................... SKIPPED

[INFO] blade-seata-order .................................. SKIPPED

[INFO] blade-seata-storage ................................ SKIPPED

[INFO] blade-desk-api ..................................... SKIPPED

[INFO] blade-service ...................................... SKIPPED

[INFO] blade-desk ......................................... SKIPPED

[INFO] blade-log .......................................... SKIPPED

[INFO] blade-system-api ................................... SKIPPED

[INFO] blade-system ....................................... SKIPPED

[INFO] blade-user ......................................... SKIPPED

[INFO] blade-demo-api ..................................... SKIPPED

[INFO] blade-demo ......................................... SKIPPED

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  19.808 s

[INFO] Finished at: 2020-07-30T16:57:31+08:00

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.7.RELEASE:repackage (default) on project blade-common: Execution default of goal org.springframewor

k.boot:spring-boot-maven-plugin:2.2.7.RELEASE:repackage failed: Unable to find main class -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

[ERROR]

[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :blade-common


1条回答
  • 主要错误是这个:Unable to find main class

    解决办法有两种:

    1、在blade-common的pom内加上如下配置

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                    <finalName>${project.name}</finalName>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>${docker.plugin.version}</version>
                <configuration>
                    <skipDockerBuild>true</skipDockerBuild>
                </configuration>
            </plugin>
        </plugins>
    </build>

    2、在blade-common内随意一个类增加一个空的

    public static void main(String[] args) {
       
    }


    0 讨论(0)
提交回复