zoukankan      html  css  js  c++  java
  • SpringBoot 在IDEA中用MAVEN打包报错

    今天在打包的时候遇到一个报错,项目可以正常运行但是就是无法使用MAVEN 的insert和package进行打包

    报错如下

    [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.262 s <<< FAILURE! - in com.example.demo.IotInterfaceApplicationTests
    Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.262 s <<< FAILURE! - in com.example.demo.IotInterfaceApplicationTests
    com.example.demo.IotInterfaceApplicationTests  Time elapsed: 0.261 s  <<< ERROR!
    
    java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
    [INFO] 
    [INFO] Results:
    [INFO] 
    [ERROR] Errors: 
    Errors: 
      IotInterfaceApplicationTests » IllegalState Unable to find a @SpringBootConfig...
    
    [INFO] 
    [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
    Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
    
    
    [INFO] 

    解决方法:

    在POM.XML添加
    
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
    
  • 相关阅读:
    页面渲染速度增加的方法和建议
    五(六)、Package & import
    五(五)、构造器 & JavaBean &this
    五(四)、封装性
    五(三)、方法
    五(二)、匿名对象
    五(一)、类&对象概述
    六、java 异常处理
    四、java 数组
    三、java 基础提炼
  • 原文地址:https://www.cnblogs.com/java-h/p/13323216.html
Copyright © 2011-2022 走看看