[ http://jira.codehaus.org/browse/MNG-2427?page=comments#action_69495 ] 

Simone Gianni commented on MNG-2427:
------------------------------------

Yep, the patch is not useful. BUT to have a working test, the source2 folder 
must be BOTH in the resource directory and in the src/main/java directory. This 
is because the test case uses the java classes in the resources dir to load 
them at runtime, AND the compiled version is needed to build the test case 
since at a certain point it does MyBla.class (and thus imports MyBla). So svn 
mv is not a solution, there must be two copies.

Maybe all this could simply be resolved not using MyBla.class.getName() but 
hardcoding the class name :)

> [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

Reply via email to