Closed hjoeren closed 1 year ago
Thanks for the report. Adapting to the breaking API changes is further complicated by the fact that m2e-core requires Java 17.
https://github.com/wilkinsona/spring-javaformat/tree/m2e-2.0. I haven't yet checked if JDT has moved to Java 17 as well.
Just tried to build the m2e-2.0-branch of the fork: Out of the box I was not able to package the whole project but after disabling some modules and excluding some plugins I got it working.
(I used the sdkman environment)
After installing the plugin in 2022-09 with the generated site-archive, at first glance everything was alright ("Update Maven Project" was working, Copyright header was generated, auto-formatting worked, ...)
Reasons why I had to disable some modules/exclude some plugins:
io.spring.javaformat.eclipse.tests
module: Missing requirement: io.spring.javaformat.eclipse.tests 0.0.35.qualifier requires 'osgi.bundle; org.junit.jupiter.api 0.0.0' but it could not be found
Can't read [java.scripting.jmod]
error: No public or protected classes found to document.
java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x4bc47d2c) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x4bc47d2c
Diffs I made to package the project:
diff --git a/pom.xml b/pom.xml
index 8e1477c..0bed82b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -377,7 +377,7 @@
<target>${java.version}</target>
</configuration>
</plugin>
- <plugin>
+ <!--<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
@@ -388,7 +388,7 @@
</goals>
</execution>
</executions>
- </plugin>
+ </plugin>-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
@@ -598,9 +598,9 @@
<modules>
<module>spring-javaformat</module>
<module>spring-javaformat-maven</module>
- <module>spring-javaformat-gradle</module>
+ <!--<module>spring-javaformat-gradle</module>-->
<module>spring-javaformat-eclipse</module>
- <module>spring-javaformat-intellij-idea</module>
+ <!--<module>spring-javaformat-intellij-idea</module>-->
</modules>
<profiles>
<profile>
diff --git a/spring-javaformat-eclipse/pom.xml b/spring-javaformat-eclipse/pom.xml
index 4300f9d..5f1bd68 100644
--- a/spring-javaformat-eclipse/pom.xml
+++ b/spring-javaformat-eclipse/pom.xml
@@ -88,7 +88,7 @@
</build>
<modules>
<module>io.spring.javaformat.eclipse</module>
- <module>io.spring.javaformat.eclipse.tests</module>
+ <!--<module>io.spring.javaformat.eclipse.tests</module>-->
<module>io.spring.javaformat.eclipse.feature</module>
<module>io.spring.javaformat.eclipse.site</module>
</modules>
diff --git a/spring-javaformat/spring-javaformat-formatter-eclipse-jdk11/pom.xml b/spring-javaformat/spring-javaformat-formatter-eclipse-jdk11/pom.xml
index eb0b837..43fccad 100644
--- a/spring-javaformat/spring-javaformat-formatter-eclipse-jdk11/pom.xml
+++ b/spring-javaformat/spring-javaformat-formatter-eclipse-jdk11/pom.xml
@@ -151,7 +151,7 @@
</execution>
</executions>
</plugin>
- <plugin>
+ <!--<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<executions>
@@ -183,7 +183,7 @@
</configuration>
</execution>
</executions>
- </plugin>
+ </plugin>-->
</plugins>
</build>
<dependencies>
diff --git a/spring-javaformat/spring-javaformat-formatter-eclipse-jdk8/pom.xml b/spring-javaformat/spring-javaformat-formatter-eclipse-jdk8/pom.xml
index 8957826..7fa6999 100644
--- a/spring-javaformat/spring-javaformat-formatter-eclipse-jdk8/pom.xml
+++ b/spring-javaformat/spring-javaformat-formatter-eclipse-jdk8/pom.xml
@@ -151,7 +151,7 @@
</execution>
</executions>
</plugin>
- <plugin>
+ <!--<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<executions>
@@ -183,7 +183,7 @@
</configuration>
</execution>
</executions>
- </plugin>
+ </plugin>-->
</plugins>
</build>
<dependencies>
diff --git a/spring-javaformat/spring-javaformat-formatter-eclipse-runtime/pom.xml b/spring-javaformat/spring-javaformat-formatter-eclipse-runtime/pom.xml
index c537bd4..1b8d8c0 100644
--- a/spring-javaformat/spring-javaformat-formatter-eclipse-runtime/pom.xml
+++ b/spring-javaformat/spring-javaformat-formatter-eclipse-runtime/pom.xml
@@ -23,7 +23,7 @@
</dependencies>
<build>
<plugins>
- <plugin>
+ <!--<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
@@ -38,7 +38,7 @@
</configuration>
</execution>
</executions>
- </plugin>
+ </plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Superseded by #352
During "Updating Maven Project" in Eclipse 2022-09, a
NoSuchMethodException
occurs. Here is the output of the Eclipse Error Log:(If helpful) here is the session data:
After the update from Eclipse 2022-06 to 2022-09,
org.eclipse.m2e:m2e-core:2.0.3
is in use, and it looks like several classes were replaced by records.ProjectConfigurationRequest
is one of those replaced classes:https://github.com/eclipse-m2e/m2e-core/blob/2.0.3/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/ProjectConfigurationRequest.java
Here is the commit with the replacement of classes with records: https://github.com/eclipse-m2e/m2e-core/commit/c3ade997e33c06d9a5863aa4985446bdb71e49a2