• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Maven Surefire Plugin Failure - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugi

 
luize casaretti
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, guys.

I'm trying to update spring version from 2.3.0.RELEASE to 2.4.0, so I changed it at pom.xml and I've got the error:
LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test)

I tried to include this maven-surefire-plugin below in my pom.xml, but I still have got the same error.


Entire pom.xml
 
luize casaretti
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my C:\Project\target\surefire-reports I get:

However, no imports presented problem.
 
Tim Holloway
Saloon Keeper
Posts: 28653
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think it's Surefire. Looks like you are missing a test-scope Spring library from your POM.

Specifically, the one that contains org.springframework.test.context.TestContextAnnotationUtils class.

Just because imports are all good isn't enough, unfortunately. Stuff that connects dynamically won't be seen as missing until something actually needs them.
 
Stephan van Hulst
Bartender
Posts: 15741
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are several issues with your POM:

  • You don't need direct dependencies on dom4j, commons-compress, commons-io, org.apache.poi:poi and spring-boot-starter-tomcat. Remove them.
  • Your poi-scratchpad version doesn't match the version of your other org.apache.poi dependencies. Use ${apache.poi.version}.
  • You have a direct dependency on hibernate-core, overriding the version that is provided by spring-boot-starter-data-jpa. Remove it.
  • You have a direct dependency on org.hibernate:hibernate-validator, a renamed version of which is provided by spring-boot-starter-data-jpa. Remove it.
  • Stop excluding org.hibernate.validator:hibernate-validator.
  • Remove the tomcat-embed-el exclusion from spring-boot-starter-validation.
  • Remove the junit-vintage-engine exclusion from spring-boot-starter-test.
  • Update the Servlet and Mail dependencies to match your Spring version.
  • Remove the Jakarta EE API and the Jakarta EL API dependencies.
  • Your OJDBC dependency is located in a repository that you haven't referenced. Instead, use the coordinates of the version that is located in Maven Central.
  • Fix versions for your build plugins.

  • Try out this POM:

    This probably doesn't fix the problem that Surefire reports, for that you will have to share with us the test class that fails.
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic