is there possible to have maven version check in POM, to make a maven project download a plugin only if maven 2?

StackOverflow https://stackoverflow.com/questions/5820393

문제

The problem is that Maven 3 seems to support the spock-maven plugin native, but maven 2 requires the spock-maven plugin. With Maven 3 however, building the project fails when maven-spock plugin is included.

In my team, some of the guys have not yet switched to Maven 3, so I need this POM to build with both Maven versions.

도움이 되었습니까?

해결책

Spock works just fine without the spock-maven plugin, both with Maven 2 and Maven 3. The plugin is completely optional and enables some advanced features like being able to use any class name for Spock specifications, freeing you from the Maven Surefire naming conventions (*Test etc.). Unfortunately, the plugin cannot be made to work with Maven 3.

To sum up, the solution is to remove the plugin and, if necessary, rename existing Spock specifications to adhere to the usual test class naming conventions.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top