GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-1418

groovy-eclipse-compiler incompatible with tycho 0.14.1

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7.2.Release
    • Component/s: Maven integration
    • Labels:
      None
    • Number of attachments :
      2

      Description

      As part of a tycho build, I'm trying to build some groovy code. The compilation fails with the exception pasted below.
      Please find attached a simple project allowing to reproduce the problem.

      [DEBUG] Source roots:
      [DEBUG] /Users/pascal/dev/tycho-tutorial/net.rapicault.tychotut.simpleGroovyProject/src
      [INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
      [INFO] Compiling 1 source file to /Users/pascal/dev/tycho-tutorial/net.rapicault.tychotut.simpleGroovyProject/target/classes
      [INFO] Classpath: /Users/pascal/dev/tycho-tutorial/net.rapicault.tychotut.simpleGroovyProject/target/classes:
      [INFO] All args: [-cp, /Users/pascal/dev/tycho-tutorial/net.rapicault.tychotut.simpleGroovyProject/target/classes:, -d, /Users/pascal/dev/tycho-tutorial/net.rapicault.tychotut.simpleGroovyProject/target/classes, -g, -source, 1.6, -target, 1.6, -nowarn, -verbose]
      Unrecognized option : -org.osgi.framework.system.packages
      [INFO] Compilation complete. Compiled 0 files.
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 13.663s
      [INFO] Finished at: Wed Mar 28 22:28:50 EDT 2012
      [INFO] Final Memory: 60M/118M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.14.1:compile (default-compile) on project net.rapicault.tychotut.simpleGroovyProject: Compilation failure: Compilation failure:
      [ERROR] Found 0 errors and 0 warnings.
      [ERROR] -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.14.1:compile (default-compile) on project net.rapicault.tychotut.simpleGroovyProject: Compilation failure
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)

        Activity

        Hide
        Andrew Eisenberg added a comment -

        It's strange. There is a compilation failure, but the reason for that failure is not being described. I originally thought that this was a variant of GRECLIPSE-1221 and so I added a java file, but the build is still broken. Even removing the groovy file and compiling results in the same error.

        Show
        Andrew Eisenberg added a comment - It's strange. There is a compilation failure, but the reason for that failure is not being described. I originally thought that this was a variant of GRECLIPSE-1221 and so I added a java file, but the build is still broken. Even removing the groovy file and compiling results in the same error.
        Hide
        Andrew Eisenberg added a comment -

        Finally got around to looking into this. Your project has 2 problems:

        1. You need to add a reference to org.codehaus.groovy in your manifest
        2. You need to add the http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.7 repository

        And I found one problem on our side. It looks like the org.osgi.framework.system.packages compiler option is not being recognized by our compiler. I'm having a deeper look to see why.

        Show
        Andrew Eisenberg added a comment - Finally got around to looking into this. Your project has 2 problems: You need to add a reference to org.codehaus.groovy in your manifest You need to add the http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.7 repository And I found one problem on our side. It looks like the org.osgi.framework.system.packages compiler option is not being recognized by our compiler. I'm having a deeper look to see why.
        Hide
        Andrew Eisenberg added a comment -

        To be more clear about the problem, the compiler was failing because the system property was set, but it wasn't recognized. And, the failure message was not being properly created.

        By simply ignoring the org.osgi.framework.system.packages option, I was able to get the build working. This is not a long term solution, but I will push this into the maven repo as a snapshot build and you can use this to fix your tutorial.

        Here is the description of the system property:

        The system property "org.osgi.framework.system.packages" allows the system bundle to export packages from the parent class loader. If we do not explicitly set this property Equinox will export all the packages visible to the parent class loader.

        See http://old.nabble.com/Question-on-%22org.osgi.framework.system.packages%22-td22936822.html

        This property is used by OSGI, but I am not sure how the JDT batch compiler uses it. I don't see any reference to that property in the batch compiler, so I am still a little confused.

        Pascal, do you have any knowledge on how this property is generated by Tycho?

        Show
        Andrew Eisenberg added a comment - To be more clear about the problem, the compiler was failing because the system property was set, but it wasn't recognized. And, the failure message was not being properly created. By simply ignoring the org.osgi.framework.system.packages option, I was able to get the build working. This is not a long term solution, but I will push this into the maven repo as a snapshot build and you can use this to fix your tutorial. Here is the description of the system property: The system property "org.osgi.framework.system.packages" allows the system bundle to export packages from the parent class loader. If we do not explicitly set this property Equinox will export all the packages visible to the parent class loader. See http://old.nabble.com/Question-on-%22org.osgi.framework.system.packages%22-td22936822.html This property is used by OSGI, but I am not sure how the JDT batch compiler uses it. I don't see any reference to that property in the batch compiler, so I am still a little confused. Pascal, do you have any knowledge on how this property is generated by Tycho?
        Hide
        Andrew Eisenberg added a comment -

        Ahh...I see the property is custom to Tycho's JDTCompiler class. The value of that property is set as the bootclasspathAccessRules and then passed to org.eclipse.tycho.compiler.jdt.CompilerMain, And this class has a org.eclipse.tycho.compiler.jdt.CompilerMain.handleBootclasspath(ArrayList, String) method that processes the access rules for the compiler.

        It should be possible to do something similar for the groovy-eclipse-compiler. The current snapshot is working with tycho, but does not handle access rules.

        Show
        Andrew Eisenberg added a comment - Ahh...I see the property is custom to Tycho's JDTCompiler class. The value of that property is set as the bootclasspathAccessRules and then passed to org.eclipse.tycho.compiler.jdt.CompilerMain , And this class has a org.eclipse.tycho.compiler.jdt.CompilerMain.handleBootclasspath(ArrayList, String) method that processes the access rules for the compiler. It should be possible to do something similar for the groovy-eclipse-compiler. The current snapshot is working with tycho, but does not handle access rules.
        Hide
        Andrew Eisenberg added a comment -

        Resolving this as fixed. Using tycho 0.16.0 and making the change to the pom and the manifest specified in earlier comments, the compilation succeeds.

        Show
        Andrew Eisenberg added a comment - Resolving this as fixed. Using tycho 0.16.0 and making the change to the pom and the manifest specified in earlier comments, the compilation succeeds.
        Hide
        Andrew Eisenberg added a comment -

        Attaching the working project

        Show
        Andrew Eisenberg added a comment - Attaching the working project

          People

          • Assignee:
            Andrew Eisenberg
            Reporter:
            Pascal Rapicault
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: