使用springboot+maven出现的问题
来源:互联网 发布:Cisco网络排错 编辑:程序博客网 时间:2024/06/05 20:47
问题描述:
springboot 在执行maven install 时候出现以下错误
[INFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:repackage (default) on project springcloud-common: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:repackage failed: Unable to find a single main class from the following candidates [com.itmuch.cloud.common.Application, com.itmuch.cloud.common.utils.SmsUtils] -> [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
解决办法:
1、在pom.xml文件中加入主类,用于指定加载的主类(在properties中,加入一个start-class的属性,用于告诉spring boot maven plugin哪个类是入口类即可)
<properties> <start-class>com.itmuch.cloud.common.Application</start-class> </properties>
2、在build中添加如下配置
<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>
最好执行maven install即可
[INFO] ------------------------------------------------------------------------[INFO] BUILD SUCCESS[INFO] ------------------------------------------------------------------------[INFO] Total time: 10.173 s[INFO] Finished at: 2017-07-01T23:46:02+08:00[INFO] Final Memory: 23M/277M[INFO] ------------------------------------------------------------------------
阅读全文
0 0
- 使用springboot+maven出现的问题
- 使用 Intellij idea Springboot maven 的一个小小的问题
- myeclipse 使用maven出现的问题
- gradle使用maven仓库出现的问题
- Mybatis使用maven打包出现的问题
- 使用Maven打包出现问题
- springBoot JPA 查询中出现的问题
- 使用idea搭建springboot的maven项目
- springboot+maven+tomcat问题
- 使用Maven创建SpringBoot
- SpringBoot集成外部jar包无法使用maven打jar包的问题
- springboot整合springSecurity出现的问题,post,delete,put无法使用
- maven+myeclipse出现的问题
- 配置maven出现的问题
- 创建maven出现的问题
- Idea使用Maven创建多模块SpringBoot项目问题记录
- SpringBoot使用多实例QUARTZ出现重复执行问题
- maven使用及出现编译错误问题
- 欢迎使用CSDN-markdown编辑器
- (error) MISCONF Redis is configured to save RDB snapshots...解决
- javaweb三大技术点之servlet
- 【R语言 数据探索】实战 Diamonds数据集探索
- 正则表达式
- 使用springboot+maven出现的问题
- 字符字节流体系
- 表单验证
- LINUX下添加多个网卡的排序问题
- Python数据分析-NumPy库常用用法总结
- FloatingActionButton实现 展开/折叠 的多级悬浮菜单
- 《Python数据分析与挖掘实战》实战篇第一章拓展思考——偷漏税用户识别
- 基于optitrack的四旋翼飞行器室内定点悬停simulink程序
- 2017年下半学年PHP学习总结