You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by motes motes <mo...@gmail.com> on 2012/12/10 10:28:09 UTC

Cannot resolve project test dependency in eclipse

I have a project A that creates a test artifact using the maven-jar-plugin

http://maven.apache.org/plugins/maven-jar-plugin/usage.html

I have another project B that have an application that needs some of
the tests classes from A so I add a dependency on the test artifact:

		<dependency>
			<groupId>com.mygroup</groupId>
			<artifactId>A</artifactId>
			<type>test-jar</type>
<!-- 			<scope>test</scope> -->
<!-- 			<scope>runtime</scope> -->
			<version>1.0.0-SNAPSHOT</version>
		</dependency>

But when I run the application in B I keep getting

 java.lang.NoClassDefFoundError

on the test classes from A. If I close project A in eclipse it works
though - I assume that it resolves from the binary test artifact in
.m2. How do I configure maven to resolve test dependencies inside
eclipse?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Cannot resolve project test dependency in eclipse

Posted by Anders Hammar <an...@hammar.net>.
If you're using m2e this question should probably go to the m2e user
mailing list. It's not a generic Maven question as I guess it works from
command-line?

/Anders


On Mon, Dec 10, 2012 at 10:28 AM, motes motes <mo...@gmail.com> wrote:

> I have a project A that creates a test artifact using the maven-jar-plugin
>
> http://maven.apache.org/plugins/maven-jar-plugin/usage.html
>
> I have another project B that have an application that needs some of
> the tests classes from A so I add a dependency on the test artifact:
>
>                 <dependency>
>                         <groupId>com.mygroup</groupId>
>                         <artifactId>A</artifactId>
>                         <type>test-jar</type>
> <!--                    <scope>test</scope> -->
> <!--                    <scope>runtime</scope> -->
>                         <version>1.0.0-SNAPSHOT</version>
>                 </dependency>
>
> But when I run the application in B I keep getting
>
>  java.lang.NoClassDefFoundError
>
> on the test classes from A. If I close project A in eclipse it works
> though - I assume that it resolves from the binary test artifact in
> .m2. How do I configure maven to resolve test dependencies inside
> eclipse?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>