org.codehaus.groovy.maven.plugin.CompileState implementation causes errors in 
<module/> builds
----------------------------------------------------------------------------------------------

                 Key: MGROOVY-184
                 URL: http://jira.codehaus.org/browse/MGROOVY-184
             Project: GMaven
          Issue Type: Bug
          Components: compile, stub generation
    Affects Versions: 1.0-rc-4
         Environment: -
            Reporter: Jason Smith
            Assignee: Jason Dillon
            Priority: Critical


The same instance of CompileState is being passed to every GMaven mojo.  During 
the build, the CompileState singleton is being loaded with files to compile 
when stubs are generated, then cleared when the Compile occurs.

The problem with this is that GenerateStubs can happen irrespective of Compile. 
 

My issue occurs because I am using the maven-source-plugin, which causes 
GenerateStubs to be run out of turn, after Compile.  The next project to be 
compiled in the <module/> build gets the resulting "forced-compile" files from 
the previous build.  And because some dependencies aren't there in the next 
build in the chain, the compilation fails.

In my case, GMaven is trying to compile a custom Maven Mojo class into another 
project, and that project does not reference the Maven dependencies.  

I am not sure the best way to fix this.  If the CompileState class used the 
current MavenProject as a key, that would work (since a single project will 
have the same forced-compile files throughout the build).  I suppose the 
MavenProject could be passed in as an argument.  I'm not totally up on Plexus, 
so there might be a way to discover the current project info during the build...

The issue seems to me, from hacking into the source, that there is an 
assumption that GenerateStubs will always be followed by Compile, in order, for 
each project.  While this is usually the case, it appears that it is not 
necessarily always the case.  

This is a subtle yet important bug, as it can result in classes being compiled 
into the wrong projects without warning (if all the dependencies happen to line 
up).  






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

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to