Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1094

Use "root.maven" classloader for GroovyShell

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-4
    • 1.0-JSR-4
    • Ant integration
    • None
    • Mac OSX 10.4.2 Apple JDK 1.4.2_09 Maven-1.0.2

    Description

      Groovy can be integrated to Maven, but the functionality is limited because "root" classloader in Maven is passed to as the classloader for GroovyShell. Groovy script cannot access Maven classes such as MavenUtils since Maven classes are loaded into "root.maven" classloader, which is the child classloader of "root".
      The attached patch modifies the code to use "root.maven", and allows to perform operations like this.

      def anotherPom = MavenUtils.getProject(new FIle("other/project/project.xml", pom.context)

      I hope this fix is included to achieve better integration with maven.

      Attachments

        1. Groovy.java.patch
          3 kB
          k2n

        Activity

          People

            guillaume Guillaume Sauthier
            k2n k2n
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: