mavenintegration-testingmaven-invoker-plugin

Running a single test with invoker plugin


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?


Solution

  • 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...