• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Executing a single test in an installed maven jar

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a jar installed in my local ~/.m2 repo and I would like to execute a single test using the '-Dtest' option via a python script. I tried using this command on the command line ' mvn surefire:test -DdependenciesToScan=groupId:artifactId -Dtest=NameOfTest' on the command line however it doesn't seem like maven is not finding the NameOfTest in the groupId:artifactId dependency and returning back with no tests executed? Any way to execute a single test in an already installed maven artifact?
 
Sheriff
Posts: 4632
300
IntelliJ IDE Clojure Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you've used "mvn clean install" to build the jar then by default test cases are not included in the jar. And why would they be? The tests have been run successfully before packaging up in the jar so you don't need to run it again. Right?
 
Salil Surendran
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Cooke wrote:Assuming you've used "mvn clean install" to build the jar then by default test cases are not included in the jar. And why would they be? The tests have been run successfully before packaging up in the jar so you don't need to run it again. Right?


Yes I see your point. I have generated the tests jar. the reason I want to execute the tests in this jar is because as part of a integration test suite I have to execute the tests related to a particular module. So given that I will not have a pom file is there a way to just execute the test purely via a python script just by putting all the arguments like dependencies and dependencies to scan in a command line?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!