spring boot maven打包时报错
来源:互联网 发布:软件著作权 源程序 编辑:程序博客网 时间:2024/05/22 03:45
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.029 sec <<< FAILURE! - in com.example.demo.TmsTransApaApplicationTests
initializationError(com.example.demo.TmsTransApaApplicationTests) Time elapsed: 0.002 sec <<< ERROR!
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
at org.springframework.util.Assert.state(Assert.java:70)
at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.getOrFindConfigurationClasses(SpringBootTestContextBootstrapper.java:202)
at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.processMergedContextConfiguration(SpringBootTestContextBootstrapper.java:137)
at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:409)
at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildDefaultMergedContextConfiguration(AbstractTestContextBootstrapper.java:323)
at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:277)
at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:112)
at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.buildTestContext(SpringBootTestContextBootstrapper.java:82)
at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:120)
at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:105)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTestContextManager(SpringJUnit4ClassRunner.java:152)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:143)
at org.springframework.test.context.junit4.SpringRunner.<init>(SpringRunner.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Results :
Tests in error:
TmsTransApaApplicationTests.initializationError ? IllegalState Unable to find ...
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
解决办法:pom增加配置
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
问题解决
- spring boot maven打包时报错
- spring boot 项目打包时报错 Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.5.
- maven打包案例-spring boot
- Spring boot打包时报错(spring boot Unable to find a single main class from the following candidates)
- 使用myeclipse打包Spring Boot Maven工程
- spring boot入门 (3)--Maven 打包
- Spring Boot Maven 打包可执行Jar文件!
- 聚合maven+spring-boot打包可执行jar
- Maven(spring boot)多环境打包
- Spring Boot Maven 打包可执行Jar文件!
- 聚合maven+spring-boot打包可执行jar
- Maven搭建spring boot启动时报错NoClassDefFoundError: org/apache/juli/logging/LogFactory
- Spring Boot Maven打包去掉不需要的文件
- Spring Boot 使用maven打包替换变量resource、filtering
- Idea Spring boot+Maven 打包war 发布 外部tomcat
- Spring boot Maven 打包引入本地的jar包
- spring boot在maven下的多模块打包
- Spring Boot Kotlin+maven 打包成war包的方法
- bitnami apache 创建虚拟目录
- 抽象工厂模式
- Vue 安装及使用
- C#使用DateTime获取某段日期范围内的所有日期与判断某个日期是否在某段日期范围内
- meven学习笔记2
- spring boot maven打包时报错
- 第25章 造物主的降临——多游戏模型的载入
- OpenGL ES 光照(二)
- sublime指定python版本
- 一次触摸,Android到底干了啥
- ijkplayer播放视频
- Android studio 使用
- 14基于opencv的重映射_SURF特征点检测
- [日推荐]『小睡眠』今夜助你轻松入眠~