Ben Caradoc-Davies ha scritto: > 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.
My money is on files being overwritten. Maybe a case in which both main and test try to write out the same META-INF/services/xxx file. I guess there might be tests that do try to do this. Did you spot what exactly is not working, which spi resource is not being properly read? > 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? I fear not, this is the extent of the configuration allowed by the maven eclipse plugin: http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html If this is the case I guess we'll have to move the current configuration into a profile that unaffected people can still use Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ------------------------------------------------------------------------------ _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel