Maven-failsafe-plugin fails to execute integration tests
See original GitHub issueWhen using the maven-filesafe-plugin the integration-test goal fails during build.
The following error happens under snapshot and 1.4.0.M3 versions. The same configuration is working fine under 1.3.5.RELEASE version.
Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.19.1:integration-test (default) on project demo: Execution default of goal org.apache.maven.plugins:maven-failsafe-plugin:2.19.1:integration-test failed: There was an error in the forked process
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
at java.lang.Class.createAnnotationData(Class.java:3521)
at java.lang.Class.annotationData(Class.java:3510)
at java.lang.Class.getAnnotation(Class.java:3415)
at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.isValidJUnit4Test(JUnit4TestChecker.java:65)
at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:52)
at org.apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:98)
at org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:311)
at org.apache.maven.surefire.junit4.JUnit4Provider.setTestsToRun(JUnit4Provider.java:191)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:134)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
-> [Help 1]
Plugins are configured in the following way:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
I created a minimal project available here: https://github.com/JIIMI/Spring-Boot-Maven-Failsafe-Plugin-Issue
Issue Analytics
- State:
- Created 7 years ago
- Comments:39 (15 by maintainers)
Top Results From Across the Web
java - Maven fail-safe not executing tests - Stack Overflow
I've included my surefire plugin configuration as well, since I am using it to execute unit tests during the test phase of the...
Read more >Maven Failsafe Plugin – Inclusions and Exclusions of Tests
There are certain times when some tests are causing the build to fail. Excluding them is one of the best workarounds to continue...
Read more >Maven Failsafe Plugin – Usage
If you need to run your integration tests multiple times, just use multiple executions of the integration-test goal. You will need to specify...
Read more >failsafe:integration-test - Apache Maven
Run integration tests using Surefire. Attributes: Requires a Maven project to be executed. Requires dependency resolution of artifacts in scope: ...
Read more >Maven Failsafe Plugin – Frequently Asked Questions
maven -failsafe-plugin is designed for running integration tests, and decouples failing the build if there are test failures from actually ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A workaround is to configure a classifier for the repackaged jar. This allows Failsafe to use the original jar:
Another workaround is to downgrade to the
maven-failsafe-plugin
to2.18.1
. Funnily enough, I’ve actually reported the issue to the failsafe tracker but it got rejected.