java spring cloud構建b2b2c分佈式微服務社交電子商務平臺 repackage failed: Unable to find main class

電子商務平臺源碼請加企鵝求求:一零三八七七四六二六。用java實施的電子商務平臺太少了,使用spring cloud技術構建的b2b2c電子商務平臺更少,大型企業分佈式互聯網電子商務平臺,java 推出PC+微信+APP+雲服務的雲商平臺系統,其中包括B2B、B2C、C2C、O2O、新零售、直播電商等子平臺。java

一.錯誤信息spring

SpringBoot進行Maven install操做時報repackage failed: Unable to find main class -> [Help 1]的錯誤,信息以下apache

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.4.RELEASE:repackage (default) on project qfxSpringbootReadPropertiesDemo: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.0.4.RELEASE:repackage failed: Unable to find main class -> [Help 1]微信

[ERROR] maven

[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.spring-boot

[ERROR] ui

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

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

 

二.錯誤緣由

由於沒有正式環境的入口類,項目結構以下:

repackage failed: Unable to find main class

pom.xml文件的<build>配置信息以下:

repackage failed: Unable to find main class

 

三.解決方案1

pom.xml文件的<build>中指定入口類,代碼以下

<configuration>

        <mainClass>com.qfx.App</mainClass>

</configuration>

如圖

repackage failed: Unable to find main class

四.解決方案2

去掉<build>配置信息中spring熱部署的配置,如圖

repackage failed: Unable to find main class

 

五.解決方案3

修改pom.xml配置文件<build>內容以下,添加一個<pluginManagement>標籤,代碼以下

    <build>

        <finalName>test</finalName>

        <pluginManagement>

            <plugins>

                <plugin>

                    <groupId>org.springframework.boot</groupId>

                    <artifactId>spring-boot-maven-plugin</artifactId>

                    <dependencies>

                        <!-- spring熱部署 -->

                        <dependency>

                            <groupId>org.springframework</groupId>

                            <artifactId>springloaded</artifactId>

                            <version>1.2.8.RELEASE</version>

                        </dependency>

                    </dependencies>

                </plugin>

            </plugins>

        </pluginManagement>

    </build>

 

六.再次執行 Maven install,一切正常

相關文章
相關標籤/搜索