[ http://jira.codehaus.org/browse/MNG-2427?page=comments#action_69345 ]
Simone Gianni commented on MNG-2427: ------------------------------------ Under eclipse my patch causes an error. This is because eclipse does not have a notion of "resources" folder, so the src/test/resources folder is simply configured as a source folder. This means that under eclipse current trunk seems to complile correctly : .java under src/test/resources are compiled. While adding them to src/test/java causes eclipse to complain : the same .java are in two source folders now, from an eclipse point of view. IIUC, maven does not compile .java inside src/test/resources, and this is why the test was not compiling from maven. So, the patch still solves the problem, but creates some errors in eclipse due to the fact that the src/test/resources is interpreted in a different way in maven than in eclipse. > [PATCH] Maven fresh checkout does not compile > (JavaMojoDescriptorExtractorTest error, source2 folder) > ----------------------------------------------------------------------------------------------------- > > Key: MNG-2427 > URL: http://jira.codehaus.org/browse/MNG-2427 > Project: Maven 2 > Type: Bug > Versions: 2.0.5 > Environment: Linux Gentoo 2.6.12, JDK blackdown 1.4.2 > Reporter: Simone Gianni > Priority: Critical > Attachments: MVN1.patch > > > The JavaMojoDescriptorExtractorTest contains an import for source2.MyBla . > Sources for this classes are in the src/test/resources but not in > src/test/java, so the test does not compile and gives the following error : > [INFO] > ---------------------------------------------------------------------------- > [INFO] Building Maven Plugin Tools for Java > [INFO] task-segment: [install] > [INFO] > ---------------------------------------------------------------------------- > [INFO] [resources:resources] > [INFO] Using default encoding to copy filtered resources. > [INFO] [compiler:compile] > [INFO] Nothing to compile - all classes are up to date > [INFO] [resources:testResources] > [INFO] Using default encoding to copy filtered resources. > [INFO] [compiler:testCompile] > Compiling 1 source file to > /home/sym/workspaces/Apache/maven/components/maven-plugin-tools/maven-plugin-tools-java/target/test-classes > [INFO] > ---------------------------------------------------------------------------- > [ERROR] BUILD FAILURE > [INFO] > ---------------------------------------------------------------------------- > [INFO] Compilation failure > > /home/sym/workspaces/Apache/maven/components/maven-plugin-tools/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java:[30,19] > package source2.sub does not exist > > /home/sym/workspaces/Apache/maven/components/maven-plugin-tools/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java:[94,22] > cannot resolve symbol > symbol : class MyBla > location: class > org.apache.maven.tools.plugin.extractor.java.JavaMojoDescriptorExtractorTest > Copying the source2 directory to src/test/java solved the problem, but I'm > not sure this is the correct behaviour. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
