vendredi 31 juillet 2015

Create a new phase in maven?

I'm trying to do this: mvn rest. Is should test all the test cases I've written in a package under main/src/test/java/rest and should not test other cases outside this package or in any other package.

When I do mvn test, it tests all the cases which I do not want.

So my question is it possible? If yes, how?

I've read that it can be done by creating a new plug-in in pom.xml. I read this article on Configuring Plug-ins. I've tried the following but it didn't work out for me.

<plugin>
    <groupId>com.jayway.restassured</groupId>
    <artifactId>spring-mock-mvc</artifactId>
    <version>2.2.0</version>
    <executions>
      <execution>
        <id>rest</id>
        <phase>test</phase>
        <goals>
            <goal>main/src/test/java/rest</goal>
        </goals>
      </execution>
    </executions>
</plugin>

I'm getting the following error when I do: mvn rest

[ERROR] Unknown lifecycle phase "rest". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycl e phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-t est-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site , post-site, site-deploy.

What am I doing wrong? Thank you.

Aucun commentaire:

Enregistrer un commentaire