repackage failed: Unable to find main class

简介: Maven install

一.错误信息

SpringBoot进行Maven install操作时报repackage failed: Unable to find main class -> [Help 1]的错误,信息如下

[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]

[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

二.错误原因

因为没有正式环境的入口类,项目结构如下:

repackage failed: Unable to find main class

pom.xml文件的配置信息如下:

repackage failed: Unable to find main class

三.解决方案1

pom.xml文件的中指定入口类,代码如下

com.qfx.App

如图

repackage failed: Unable to find main class

四.解决方案2

去掉配置信息中spring热部署的配置,如图

repackage failed: Unable to find main class

五.解决方案3

修改pom.xml配置文件内容如下,添加一个标签,代码如下

<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,一切正常(企业架构源码可以加求球:三五三六二四七二五九)

目录
相关文章
|
1月前
|
Go
Error: Package awesomeProject contains more than one main function Consider using File kind instead
Goland编辑器运行时出现“edit configuration”窗口,阻碍代码执行。解决方法:右键点击源文件运行。问题源于Go语言不支持函数重载,同一包内不能有两个同名函数,导致多入口冲突。初学者在main包中使用了多个Go源文件,应改为仅有一个源码文件来避免此问题。
|
1月前
|
Linux
报错 Package ‘oniguruma‘, required by ‘virtual:world‘, not found
报错 Package ‘oniguruma‘, required by ‘virtual:world‘, not found
125 0
No package ‘gobject-introspection-1.0‘ found
No package ‘gobject-introspection-1.0‘ found
169 0
No package ‘libmarco-private‘ found
No package ‘libmarco-private‘ found
41 0
No package ‘vte-2.91‘ found
No package ‘vte-2.91‘ found
55 0
No package ‘dconf‘ found
No package ‘dconf‘ found
86 0
No package ‘libmatekbd‘ found
No package ‘libmatekbd‘ found
50 0
No package ‘polkit-gobject-1‘ found
No package ‘polkit-gobject-1‘ found
87 0
No package ‘libmate-menu‘ found
No package ‘libmate-menu‘ found
43 0
四十二、 ERROR org.apache.pig.Main - ERROR 2998: Unhandled internal error. Found class jline.Terminal
四十二、 ERROR org.apache.pig.Main - ERROR 2998: Unhandled internal error. Found class jline.Terminal
四十二、 ERROR org.apache.pig.Main - ERROR 2998: Unhandled internal error. Found class jline.Terminal

热门文章

最新文章