tags:

views:

55

answers:

1

Hi,

Is it possible to create a pom file so it can be used inside another pom to add test scope dependencies?

So in module E's pom.xml I have:

<dependencies>
  <dependency>
    <groupId>com.example</artifactId>
    <artifactId>D</artifactId>
    <type>pom</type>
    <scope>test</scope>
  </dependency>
</dependencies>   

So that if D's pom.xml contains dependencies on artifacts A, B, C, then these artifacts are in the compilation and execution classpath of E's tests.

NOTE: the reason I want such a pom, and not rely on regular dependency resolution is that I have created a tests jar using maven-jar-plugin:test-jar and using that jar as a dependency causes maven to not use its transitive dependencies. (see http://jira.codehaus.org/browse/MNG-1378)

UPDATE: this does not work for me (maybe because I'm trying to use it for the test scope): http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-pom-best-practice.html

+1  A: 

Apparently this is not possible: http://jira.codehaus.org/browse/MNG-2975

IttayD