I don't understand what could be the use-case for including a test-jar in a
"production" project, imo, test folder should always be useful only for the
project it's in.
Apart from that, maybe your problem comes from the "type" tag you're using
in the <dependency> declaration.
In the declaration below, I guess there're several flaws:
* building a test-jar won't install it in the local repo, and also won't
deploy in the remote repo
=> Did you install manually in the repo ?
* once it's been created, are you sure <type>test-jar</type> is the way to
go? I never generated a test-jar myself before. I just tried and saw it
generates ${project.artifactId}-{project.version}-tests.jar.
=> Then shouldn't use <classifier>tests</classifier> and no type (defaults
to jar) instead of what you put?
HTH
Cheers.
2009/12/15 Alan Cassar <[email protected]>
> Hi all,
> I am new to this list and I have a problem with maven transitive
> dependencies which cannot quite figure out and would appreciate any help.
>
> Well, we have a project, lets call it project-core and it has its own pom
> with its own dependencies, all test dependencies are marked as
> <scope>test</scope>. Also, in the same project, we have the plugin to
> generate the test jar:
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-jar-plugin</artifactId>
> <executions>
> <execution>
> <goals>
> <goal>test-jar</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
>
> I have another project which is a war project and as dependencies I have
> included both project-core as
>
> <dependency>
> <groupId>xxx</groupId>
> <artifactId>project-core</artifactId>
> <version>${version}</version>
> <scope>compile</scope>
> </dependency>
>
> and also the test jar as:
>
> <dependency>
> <groupId>xxx</groupId>
> <artifactId>project-core</artifactId>
> <version>${version}</version>
> <scope>compile</scope>
> <type>test-jar</type>
> </dependency>
>
> The transitive dependencies of the project-core are correctly added to my
> lib folder in the war by maven, but the transitive dependencies marked as
> <scope>test</scope> are not. I know that by default these dependencies
> should not be added, but since I added the testing jar, I thought that these
> dependencies should be added. In fact what happens, when the war file is
> deployed, the application fails with ClassNotFound exception when
> classloading the classes in the test jar.
>
> Is it possible somehow to pull in the test transitive dependencies?
>
> Thanks for your help
> Alan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !