3

I am trying to upgrade my joint Java/Groovy projects to Java 10, but my hopes and aspirations appear to be being smashed upon the jagged rocks of Project Jigsaw.

The relevant section of my Maven 3.6.0 POM looks like

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.5.RELEASE</version>
    <relativePath/>
</parent>
...
<java.version>10</java.version>
<groovy.version>2.5.3</groovy.version>
...
<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>${groovy.version}</version>
    <type>pom</type>
</dependency>

I also have GMavenPlus 1.6.2 installed in the usual way. I have used Groovy 2.5.3 because when compiling with 2.4.13 GMavenPlus gives this error:

[ERROR] Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.6.2:compile (default) on project batch: Execution default of goal org.codehaus.gmavenplus:gmavenplus-plugin:1.6.2:compile failed: Target bytecode 10, 11, or 12 requires Groovy 2.5.3/3.0.0-alpha-4 or newer.  No 2.6 version is supported. -> [Help 1]

However, in Groovy 2.5.3 the module structure is changed to support Java 9 and now we need to import groovy-all with type pom (as above). However, maven keeps trying to download groovy-all-2.5.3.jar, which according to this page doesn't exist any more.

[ERROR] Failed to execute goal on project batch: Could not resolve dependencies for project XXX: Could not find artifact org.codehaus.groovy:groovy-all:jar:2.5.3 in XXX -> [Help 1]

Does anyone know how to get this going?

Ken DeLong
  • 929
  • 2
  • 8
  • 27
  • Upgrading the Spring Boot version fixed that problem! Make it a real answer and I can select it. However, now I get an Eclipse (Photon) error every 30 seconds: Errors occurred during the build. Errors running builder 'Java Builder' on project 'hatch-batch'. org.codehaus.groovy.runtime.memoize.EvictableCache.getAndPut(Ljava/lang/Object;Lorg/codehaus/groovy/runtime/memoize/MemoizeCache$ValueProvider;)Ljava/lang/Object;...I might have to postpone this for a couple months until all these bugs are worked out! – Ken DeLong Nov 08 '18 at 18:42
  • 1
    Also there's no class files on the disk...looks like I need an Eclipse upgrade too. – Ken DeLong Nov 08 '18 at 18:46
  • Yes could be, there is a lot of community upgrades going on for upgraded java version support. – Naman Nov 08 '18 at 18:48

1 Answers1

1

Few suggestions you can follow to resolve this based on compatibility :

  1. You should upgrade to the version org.codehaus.groovy:groovy-all:3.0.0-alpha-3 as the log reads.

  2. You should upgrade to 2.1.0.RELEASE of spring-boot-starter-parent which out of the box supports Java until version 11.

Naman
  • 27,789
  • 26
  • 218
  • 353
  • 1
    Amazingly, it was the Spring Boot upgrade that solved this particular problem, even though the maven build failed long before the compile step. – Ken DeLong Nov 08 '18 at 19:23