Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile a maven project since groovy-eclipse feature update #262

Closed
jan-krakora opened this issue Feb 3, 2017 · 4 comments
Closed

Comments

@jan-krakora
Copy link

I have a maven project where I use groovy files for unit testing (Spock). I didn't change anything except update groovy-eclipse feature to 2.9.2.xx-201702030026-e46. Since then the project can't be build because of "The project was not built since its build path is incomplete. Cannot find the class file for groovy.lang.GroovyObject. Fix the build path then try building this project".

My system description:
Windows 10 x64
jdk 1.8.0_121
Eclipse 4.6.2

@eric-milles
Copy link
Member

When you look at your project in Project Explorer, do you see groovy-all jar anywhere?

@jan-krakora
Copy link
Author

Yes, it's in Maven dependencies (groovy-all-2.4.7.jar). More info from project properties:

  • Groovy compiler set to 2.4
  • Builders (Faceted Project Validation, Java, Maven Project, Validation)
  • Libraries on build path (Groovy DSL Support, JRE System Library, Maven dependencies)
  • Project Facets (Java, Utility Module)

pom.xml:

...

<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>2.4.7</version>
    <scope>test</scope>
</dependency>

...

<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.3</version>			
    <configuration>
        <source>1.8</source>
	<target>1.8</target>
	<encoding>UTF-8</encoding>
    </configuration>
    <executions>
        <execution>
	    <id>test-compile</id>
	    <phase>process-test-sources</phase>
	        <goals>
	            <goal>testCompile</goal>
		</goals>
		<configuration>
		    <compilerId>groovy-eclipse-compiler</compilerId>
		</configuration>
	</execution>
    </executions>							
    <dependencies>
          <dependency>
              <groupId>org.codehaus.groovy</groupId>
              <artifactId>groovy-eclipse-compiler</artifactId>
              <version>2.9.2-01</version>
          </dependency>
          <dependency>
              <groupId>org.codehaus.groovy</groupId>
              <artifactId>groovy-eclipse-batch</artifactId>
              <version>2.4.3-01</version>
         </dependency>
    </dependencies>					
</plugin>

@jan-krakora
Copy link
Author

There is also a strange record in the eclipse log file:

!ENTRY org.eclipse.jdt.core 4 4 2017-02-03 20:33:17.675
!MESSAGE Internal groovy compiler error.
!STACK 0
BUG! exception in phase 'canonicalization' in source unit 'D:\code\chystat\chystat\chystat-ui-tests\src\test\groovy\cz\diribet\chystat\geb\capability\page\CapabilityAnalysisPage.groovy' ClassNode#getTypeClass for cz.diribet.chystat.geb.module.PageWithNastaveniObdobi is called before the type class is set 
	at org.codehaus.groovy.ast.ClassNode.getTypeClass(ClassNode.java:1520)
	at org.codehaus.groovy.transform.trait.Traits.findHelpers(Traits.java:126)
	at org.codehaus.groovy.transform.trait.TraitComposer.doExtendTraits(TraitComposer.java:110)
	at org.codehaus.groovy.control.CompilationUnit$11.call(CompilationUnit.java:213)
	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1221)
	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:651)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:629)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:606)
	at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.processToPhase(GroovyCompilationUnitDeclaration.java:201)
	at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.analyseCode(GroovyCompilationUnitDeclaration.java:2289)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:926)
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:141)
	at java.lang.Thread.run(Unknown Source)

@jan-krakora
Copy link
Author

I solved the problem updating the groovy to 2.4.8 in my pom.xml file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants