You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Matthew McCullough <ma...@ambientideas.com> on 2007/10/03 17:10:08 UTC

Eclipse:Eclipse Exports Test Resources

I am working on a project that has three layers (poms) that roughly represent
a MVC stratification.

In the lowest layer, we have src/main/test/resources/ourapp.properties
that drives some of the unit tests.

In the next layer, we have src/main/test/resources/ourapp.properties
with more complex configuration that drives the more complex unit tests at
the 2nd layer of the app.

Then, at the final (view) layer, we have the same file yet again.

My problem is that in the eclipse-generated .project and .classpath files,
the test/resources directory is mounted as a source directory in Eclipse AND
it is marked as exported (e.g. shared with further-up-the-chain projects). 
Is is this second part -- that test classpath entries are exported -- that
seems broken.  Code farther up the layers in Eclipse (when one project
depends on another) should not (and does not) care about what is in the test
directory of a lower layer.

To draw a parallel to this in maven command line builds, the Eclipse plugin
is almost performing the same thing as if mvn jar:jar was putting the
test/resources into the produced jar.  We all know that would be bad, and by
default jar:jar doesn't put test resources into resultant JARs.  So why does
the Eclipse project export test resources up to higher layers?

Worst of all, I could just work around this by unchecking the "export"
checkbox on the project properties for that classpath entry in Eclipse --
but that checkbox is greyed out in for that particular test/resources entry. 
Why would that be?  I've had co-workers test the same thing and achieve the
same results.

Thanks in advance for your insights.  If you wish to reproduce this, just

1) maven-archetype two new projects
2) set a dependency on the 2nd to the first
3) put some resources in the first (lowest level) project in the
test/resources directory
4) mvn eclipse:eclipse both projects
5) Import both into eclipse
6) Notice that the lowest level project exports its test/resources directory
up to the higher level project (bad!)

Matthew McCullough
Ambient Ideas, LLC
-- 
View this message in context: http://www.nabble.com/Eclipse%3AEclipse-Exports-Test-Resources-tf4562377s177.html#a13020855
Sent from the Maven - Users mailing list archive at Nabble.com.


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