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

update default versions for Eclipse Java and Groovy formatters #2458

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jochenberger
Copy link
Contributor

@jochenberger jochenberger commented Apr 2, 2025

Retry after #2381 failed and groovy/groovy-eclipse#1607 was resolved.

@jochenberger jochenberger force-pushed the update-greclipse branch 2 times, most recently from 1514bad to a1b1b65 Compare April 2, 2025 19:59
@jochenberger
Copy link
Contributor Author

Greclipse update causes issues again. Why does this have to be so hard? I wish they were publishing the core formatter as a regular JAR. :-/

@jochenberger
Copy link
Contributor Author

jochenberger commented Apr 2, 2025

There are test failures:

com.diffplug.spotless.extra.groovy.GrEclipseFormatterStepSpecialCaseTest issue_1657_fixed() FAILED (18.8s)
  org.gradle.api.artifacts.ResolveException: [dev.equo.ide:solstice:1.8.1, com.diffplug.durian:durian-swt.os:4.3.1, org.bouncycastle:bcpg-jdk18on:1.80, org.bouncycastle:bcprov-jdk18on:1.80, org.bouncycastle:bcutil-jdk18on:1.80, com.ibm.icu:icu4j:76.1, net.java.dev.jna:jna-platform:5.16.0, jakarta.annotation:jakarta.annotation-api:2.1.1, jakarta.inject:jakarta.inject-api:2.0.1, commons-io:commons-io:2.18.0, commons-logging:commons-logging:1.3.5, org.apache.felix:org.apache.felix.scr:2.2.12, org.eclipse.platform:org.eclipse.compare:3.11.300, org.eclipse.platform:org.eclipse.compare.core:3.8.700, org.eclipse.platform:org.eclipse.core.commands:3.12.300, org.eclipse.platform:org.eclipse.core.contenttype:3.9.600, org.eclipse.platform:org.eclipse.core.databinding:1.13.400, org.eclipse.platform:org.eclipse.core.databinding.observable:1.13.300, org.eclipse.platform:org.eclipse.core.databinding.property:1.10.300, org.eclipse.platform:org.eclipse.core.expressions:3.9.400, org.eclipse.platform:org.eclipse.core.filebuffer
      at com.diffplug.spotless.extra.groovy.GrEclipseFormatterStepSpecialCaseTest.issue_1657_fixed(GrEclipseFormatterStepSpecialCaseTest.java:41)
  Caused by: org.gradle.api.internal.artifacts.ivyservice.TypedResolveException: Could not resolve all files for configuration ':detachedConfiguration1'.
      at app//com.diffplug.spotless.extra.groovy.GrEclipseFormatterStepSpecialCaseTest.issue_1657_fixed(GrEclipseFormatterStepSpecialCaseTest.java:41)
  Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find org.eclipse.jdt:org.eclipse.jdt.groovy.core:5.7.0.
  Searched in the following locations:
    - https://repo.maven.apache.org/maven2/org/eclipse/jdt/org.eclipse.jdt.groovy.core/5.7.0/org.eclipse.jdt.groovy.core-5.7.0.pom
  Required by:
      root project :

I'm at a loss.

@nedtwigg
Copy link
Member

nedtwigg commented Apr 7, 2025

Why does this have to be so hard?

Eclipse p2, haha. One way around it was for Spotless itself to create and publish fat jars. That was laborious and error-prone, and fell more than a year out of date.

So we switched to the Equo p2 implementation, which lets us download metadata straight from the Eclipse p2 sources. The p2 metadata can say when a jar is published on mavenCentral vs when it is only available via p2, and this lets us use pure-maven for JDT.

For the error you inlined above, the Groovy's p2 metadata is now claiming that the jar is published on mavencentral, but it is not. That's the error. If they did publish all their artifacts on mavencentral, that would be amazing! Or if they didn't claim maven coordinates, Equo p2 would download it from their p2 update site, which is what the previous metadata claimed.

This p2 stuff sucks. If there were any other Groovy formatter, I would consider killing the p2 support and deprecating the formatters that rely on it...

@jochenberger
Copy link
Contributor Author

This is all so sad.

For the error you inlined above, the Groovy's p2 metadata is now claiming that the jar is published on mavencentral, but it is not.

So that changed for the current release? Bummer, I was happy that they activated the content.xml creation again. So we're probably going to have to wait another 3 months. 🫤

This p2 stuff sucks. If there were any other Groovy formatter, I would consider killing the p2 support and deprecating the formatters that rely on it...

Maybe we can build something upon https://docs.openrewrite.org/recipes/groovy/format/autoformat. I haven't had a closer look yet though, but I have pretty high hopes in the OpenRewrite project.

@jochenberger
Copy link
Contributor Author

OpenRewrite does publish their artifacts on Maven: https://central.sonatype.com/artifact/org.openrewrite/rewrite-groovy/overview
And there's https://github.com/openrewrite/rewrite/blob/main/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParser.java
This might actually work.

@jochenberger jochenberger force-pushed the update-greclipse branch 2 times, most recently from 1283e07 to c0117b1 Compare April 9, 2025 08:45
…2463)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

2 participants