You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jesse Eichar (JIRA)" <ji...@codehaus.org> on 2007/04/03 01:49:06 UTC

[jira] Created: (MGROOVY-25) Groovy scripts compiled by the maven groovy plugin does not have the org.apache.maven.plugin package on its classpath

Groovy scripts compiled by the maven groovy plugin does not have the org.apache.maven.plugin package on its classpath
---------------------------------------------------------------------------------------------------------------------

                 Key: MGROOVY-25
                 URL: http://jira.codehaus.org/browse/MGROOVY-25
             Project: Maven 2.x Groovy Plugin
          Issue Type: Bug
    Affects Versions: 1.0-alpha-2
         Environment: all
            Reporter: Jesse Eichar
         Assigned To: Jason Dillon
            Priority: Minor


consider the following script:

class ScriptClass{
  def testRequirements(){
    def requiredFile=new File("/requiredFile")
    if( !requiredFile.exists ){
      throw new org.apache.maven.plugin.MojoFailureException( "RequiredFile does not exist" )
    }
  }
}

This script will not compile correctly using the compile plugin because the MojoFailureException is not on the classpath.  As a work around you can throw an AssertionError or a RuntimeException but in both cases you get a big ugly stacktrace.  If you can throw a MojoFailureException the maven build will fail cleaning reporting the error and the stack trace can be shown using the -e stack trace.  


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

        

[jira] Commented: (MGROOVY-25) Groovy scripts compiled by the maven groovy plugin does not have the org.apache.maven.plugin package on its classpath

Posted by "Jason Dillon (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MGROOVY-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_91839 ] 

Jason Dillon commented on MGROOVY-25:
-------------------------------------

You need to include *everything* you depend on when compiling, including any Maven or Groovy bits.  They are not currently included to avoid classloading issues.  May eventually add an optional flag to propagate the plugins classpath to the compiler, but right now you need to be very explicit when using groovy:compile or groovy:testCompile.

--jason

> Groovy scripts compiled by the maven groovy plugin does not have the org.apache.maven.plugin package on its classpath
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: MGROOVY-25
>                 URL: http://jira.codehaus.org/browse/MGROOVY-25
>             Project: Maven 2.x Groovy Plugin
>          Issue Type: Bug
>    Affects Versions: 1.0-alpha-2
>         Environment: all
>            Reporter: Jesse Eichar
>         Assigned To: Jason Dillon
>            Priority: Minor
>
> consider the following script:
> class ScriptClass{
>   def testRequirements(){
>     def requiredFile=new File("/requiredFile")
>     if( !requiredFile.exists ){
>       throw new org.apache.maven.plugin.MojoFailureException( "RequiredFile does not exist" )
>     }
>   }
> }
> This script will not compile correctly using the compile plugin because the MojoFailureException is not on the classpath.  As a work around you can throw an AssertionError or a RuntimeException but in both cases you get a big ugly stacktrace.  If you can throw a MojoFailureException the maven build will fail cleaning reporting the error and the stack trace can be shown using the -e stack trace.  

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

        

[jira] Commented: (MGROOVY-25) Groovy scripts compiled by the maven groovy plugin does not have the org.apache.maven.plugin package on its classpath

Posted by "Jason Dillon (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MGROOVY-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_91959 ] 

Jason Dillon commented on MGROOVY-25:
-------------------------------------

To get {{org.apache.maven.plugin.MojoFailureException}} you need to include:

 * org.apache.maven:maven-plugin-api

Though I'm not sure that just by throwing a {{MojoFailureException}} that ugly stack traces will be omitted when using {{groovy:execute}}.  But I've not tired it either ;-)

> Groovy scripts compiled by the maven groovy plugin does not have the org.apache.maven.plugin package on its classpath
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: MGROOVY-25
>                 URL: http://jira.codehaus.org/browse/MGROOVY-25
>             Project: Maven 2.x Groovy Plugin
>          Issue Type: Bug
>    Affects Versions: 1.0-alpha-2
>         Environment: all
>            Reporter: Jesse Eichar
>         Assigned To: Jason Dillon
>            Priority: Minor
>
> consider the following script:
> class ScriptClass{
>   def testRequirements(){
>     def requiredFile=new File("/requiredFile")
>     if( !requiredFile.exists ){
>       throw new org.apache.maven.plugin.MojoFailureException( "RequiredFile does not exist" )
>     }
>   }
> }
> This script will not compile correctly using the compile plugin because the MojoFailureException is not on the classpath.  As a work around you can throw an AssertionError or a RuntimeException but in both cases you get a big ugly stacktrace.  If you can throw a MojoFailureException the maven build will fail cleaning reporting the error and the stack trace can be shown using the -e stack trace.  

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

        

[jira] Commented: (MGROOVY-25) Groovy scripts compiled by the maven groovy plugin does not have the org.apache.maven.plugin package on its classpath

Posted by "Jesse Eichar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MGROOVY-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_91958 ] 

Jesse Eichar commented on MGROOVY-25:
-------------------------------------

Do you know the plugin for this.  I've been scouring the maven website and have come up empty so far...  I would request that in the future at some point (no big hurry) that certain plugins are on the class path by default.  I would expect the same ones as are available when developing a java-based groovy plugin since this is similar.  

Let me know if I am off track.

FYI I've had great luck with this plugin.

> Groovy scripts compiled by the maven groovy plugin does not have the org.apache.maven.plugin package on its classpath
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: MGROOVY-25
>                 URL: http://jira.codehaus.org/browse/MGROOVY-25
>             Project: Maven 2.x Groovy Plugin
>          Issue Type: Bug
>    Affects Versions: 1.0-alpha-2
>         Environment: all
>            Reporter: Jesse Eichar
>         Assigned To: Jason Dillon
>            Priority: Minor
>
> consider the following script:
> class ScriptClass{
>   def testRequirements(){
>     def requiredFile=new File("/requiredFile")
>     if( !requiredFile.exists ){
>       throw new org.apache.maven.plugin.MojoFailureException( "RequiredFile does not exist" )
>     }
>   }
> }
> This script will not compile correctly using the compile plugin because the MojoFailureException is not on the classpath.  As a work around you can throw an AssertionError or a RuntimeException but in both cases you get a big ugly stacktrace.  If you can throw a MojoFailureException the maven build will fail cleaning reporting the error and the stack trace can be shown using the -e stack trace.  

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

        

[jira] Commented: (MGROOVY-25) Groovy scripts compiled by the maven groovy plugin does not have the org.apache.maven.plugin package on its classpath

Posted by "Jesse Eichar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MGROOVY-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_91838 ] 

Jesse Eichar commented on MGROOVY-25:
-------------------------------------

I tried looking for a maven plugin that I could add as a dependency but couldn't find one.  If you can find one maybe that can be the fix.  But it seems to be part of the default maven.  

I think this is the area to look for.  This may just be a case of ignorance on my part and not a bug at all.

> Groovy scripts compiled by the maven groovy plugin does not have the org.apache.maven.plugin package on its classpath
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: MGROOVY-25
>                 URL: http://jira.codehaus.org/browse/MGROOVY-25
>             Project: Maven 2.x Groovy Plugin
>          Issue Type: Bug
>    Affects Versions: 1.0-alpha-2
>         Environment: all
>            Reporter: Jesse Eichar
>         Assigned To: Jason Dillon
>            Priority: Minor
>
> consider the following script:
> class ScriptClass{
>   def testRequirements(){
>     def requiredFile=new File("/requiredFile")
>     if( !requiredFile.exists ){
>       throw new org.apache.maven.plugin.MojoFailureException( "RequiredFile does not exist" )
>     }
>   }
> }
> This script will not compile correctly using the compile plugin because the MojoFailureException is not on the classpath.  As a work around you can throw an AssertionError or a RuntimeException but in both cases you get a big ugly stacktrace.  If you can throw a MojoFailureException the maven build will fail cleaning reporting the error and the stack trace can be shown using the -e stack trace.  

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

        

[jira] Closed: (MGROOVY-25) Groovy scripts compiled by the maven groovy plugin does not have the org.apache.maven.plugin package on its classpath

Posted by "Jason Dillon (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MGROOVY-25?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Dillon closed MGROOVY-25.
-------------------------------

    Resolution: Won't Fix

You need to include everything your code depends on in the modules dependencies.

> Groovy scripts compiled by the maven groovy plugin does not have the org.apache.maven.plugin package on its classpath
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: MGROOVY-25
>                 URL: http://jira.codehaus.org/browse/MGROOVY-25
>             Project: Maven 2.x Groovy Plugin
>          Issue Type: Bug
>    Affects Versions: 1.0-alpha-2
>         Environment: all
>            Reporter: Jesse Eichar
>         Assigned To: Jason Dillon
>            Priority: Minor
>
> consider the following script:
> class ScriptClass{
>   def testRequirements(){
>     def requiredFile=new File("/requiredFile")
>     if( !requiredFile.exists ){
>       throw new org.apache.maven.plugin.MojoFailureException( "RequiredFile does not exist" )
>     }
>   }
> }
> This script will not compile correctly using the compile plugin because the MojoFailureException is not on the classpath.  As a work around you can throw an AssertionError or a RuntimeException but in both cases you get a big ugly stacktrace.  If you can throw a MojoFailureException the maven build will fail cleaning reporting the error and the stack trace can be shown using the -e stack trace.  

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