3

Following is the directory structure for my integration tests

 /src/it/first-test  
           -->my-test  
               -->build.log
               -->inoker.properties
               -->pom.xml
               -->verify.groovy

When I try to run a single integration tests as described https://maven.apache.org/plugins/maven-invoker-plugin/usage.html. It gives a message that ' No projects were selected for execution' Here is the command I used to invoke the project

/src/main> mvn invoker:run -Dinvoker.test=first-test/my-test*

How should I make sure the test is run?

user_mda
  • 18,148
  • 27
  • 82
  • 145
  • It looks like you misunderstood the docs how to structure your integration tests. The first integration test should be located `/src/it/first-test` the second integration test should be located `/src/it/second-test` which means your folder `my-test` should be removed...Furthermore you should start the integration test from your project root and not by `mvn invoker:run ` you should use `mvn verify -Dinvoker.test=first-test` instead... – khmarbaise Dec 30 '15 at 17:03
  • Thank you, this worked. Do you want to answer it so I can accept it? – user_mda Dec 30 '15 at 17:05

2 Answers2

7

It looks like you misunderstood the docs how to structure your integration tests. The first integration test should be located /src/it/first-test the second integration test should be located /src/it/second-test which means your folder my-test should be removed...Furthermore you should start the integration test from your project root and not by mvn invoker:run you should use mvn verify -Dinvoker.test=first-test instead...

khmarbaise
  • 92,914
  • 28
  • 189
  • 235
3

It looks like you are executing it from src/main. Try it again from the root of the project (where the pom.xml is located).

Robert Scholte
  • 11,889
  • 2
  • 35
  • 44