Andrea,

I can confirm that changing the maven-eclipse-plugin 
buildOutputDirectory to bin (GEOT-2576) breaks app-schema unit tests 
because it prevents both main and test SPI resources from being 
available at unit test run time in Eclipse (they run fine in maven).

With the default maven settings, Eclipse uses two output folders, 
target/classes for main class files and resources and 
target/test-classes for test classes and resources. When JUnit runs, 
target/classes and target/test-classes are on the classpath (confirmed 
by inspecting running JVM commandline), and all is well.

When maven is configured to use bin for output (GEOT-2576), all class 
files and resources are written to bin, and when JUnit runs bin is on 
the classpath. The problem is that I only see the SPI for resources for 
main. Either the test resources are not being copied, or because of name 
collisions, only the first is copied. In app-schema we have different
META-INF/services/org.geotools.data.DataAccessFactory files
in each of main and test. These would collide if merged into a single 
bin output.

There are subtle differences in .classpath, with an extra attribute on 
the source folders for default output not present in bin output. This is 
presumably how Eclipse orchestrates the multiple classpath directories 
for main and test.

Do you know if we can have separate output folders for main and test 
that are not shared with maven? Does maven-eclipse-plugin support this?

Kind regards,
Ben.


***********

Eclipse .classpath for default output:

   <classpathentry kind="src" path="src/main/java"/>
   <classpathentry kind="src" path="src/main/resources" 
excluding="**/*.java"/>
   <classpathentry kind="src" path="src/test/java" 
output="target/test-classes"/>
   <classpathentry kind="src" path="src/test/resources" 
output="target/test-classes" 
including="**/*.properties|**/*.xml|**/*.xsd|**/META-INF/**" 
excluding="**/*.java"/>
   <classpathentry kind="output" path="target/classes"/>

Eclipse .classpath for bin output:

   <classpathentry kind="src" path="src/main/java"/>
   <classpathentry kind="src" path="src/main/resources" 
excluding="**/*.java"/>
   <classpathentry kind="src" path="src/test/java"/>
   <classpathentry kind="src" path="src/test/resources" 
including="**/*.properties|**/*.xml|**/*.xsd|**/META-INF/**" 
excluding="**/*.java"/>
   <classpathentry kind="output" path="bin"/>

******************

-- 
Ben Caradoc-Davies <[email protected]>
Software Engineer, CSIRO Exploration and Mining
Australian Resources Research Centre
26 Dick Perry Ave, Kensington WA 6151, Australia

------------------------------------------------------------------------------
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to