[
https://issues.apache.org/jira/browse/OODT-88?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Brian Foster resolved OODT-88.
------------------------------
Resolution: Fixed
- fixed in r1050179
This patch has resolved this issued the best it's going to be resolved
The problem lies in the eclipse plug-in creating more than one classpathentry
tag that defines resources to be copied into an output directory where that
output directory is a sub-directory of another's output directory (Eclipse IDE
doesn't like this). For example, when mvn eclipse:eclipse is run on
cas-metadata it creates a .classpath file with the following two entries:
{noformat}
<classpathentry kind="src" path="src/test" output="target/test-classes"
including="**/*.java"/>
<classpathentry kind="src" path="src/testdata"
output="target/test-classes/org/apache/oodt/cas/metadata"
including="extern-config.xml|copyandrewrite.test.conf|extern-config.xml|met_extr_preconditions.xml|samplemet.xml|testExtractor|testfile.txt|testfile2.txt.met|testfile2.txt|tika-mimetypes.xml"
excluding="**/*.java"/>
{noformat}
As you can see the second classpathentry's 'output' directory is a
sub-directory of the first . . . for the eclipse plug-in version 2.6, it
creates this .classpath file and just warns about it, whereas for versions 2.7
and greater it would throw an error and bail and not create the .classpath
file.
*THE CATCH*
Even though version 2.6 of the maven eclipse plug-in is used and a .classpath
file is generated, Eclipse IDE will still complain that the project has build
errors. It will look something like the following:
{noformat}
Cannot nest output folder
'metadata/target/test-classes/org/apache/oodt/cas/metadata' inside output
folder 'metadata/target/test-classes'
{noformat}
Because of this error, the test-classes directory will not have it's resource
config files copied in and Eclipse IDE will fail it's JUnit tests because it
fails to find this test resources in its classpath.
*THE WORK-AROUND*
I haven't figured out a way to get rid of the error, however, if you want to
run a components JUnit tests in Eclipse IDE do the following:
1) mvn eclipse:eclipse
2) mvn test
3) (even if the tests fail) go to Eclipse IDE now and refresh your project, the
unit-tests will now run, because mvn test has already set up test-classes
directory.
*WARNING TO WORK-AROUND*
If you change the components code, unit-test code, resource config files,
etc... in any way you must again run 'mvn clean test' (so that the test-classes
directory gets re-populated with your updates) before your can run the
unit-tests in Eclipse IDE with the updates.
*WHEN WILL YOU SEE THIS ERROR*
If pom.xml for the component you are using contains a <testResources> tag, then
you will get this error. This is because by default the maven eclipse plug-in
will create the first entry in the .classpath example above and then will
create the second entry if your pom.xml has <testResources> which need to be
copied.
> mvn eclipse:eclipse fails to merge resources
> --------------------------------------------
>
> Key: OODT-88
> URL: https://issues.apache.org/jira/browse/OODT-88
> Project: OODT
> Issue Type: Bug
> Affects Versions: 0.1-incubating
> Environment: none
> Reporter: Brian Foster
> Assignee: Brian Foster
> Priority: Minor
> Fix For: 0.2
>
> Attachments: OODT-88.2010-12-15.patch.txt
>
>
> issue explained here (versions of eclipse plugin, 2.7 and above, causes build
> error):
> http://jira.codehaus.org/browse/MECLIPSE-576
> my purposed fix is adding the following to core/pom.xml:
> {noformat}
> <plugin>
> <artifactId>maven-eclipse-plugin</artifactId>
> <version>2.6</version>
> </plugin>
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.