takari / polyglot-maven

Support alternative markup for Apache Maven POM files
Eclipse Public License 1.0
893 stars 101 forks source link

Revive the project #257

Closed cstamas closed 1 year ago

cstamas commented 1 year ago

High level changes:

lefou commented 1 year ago

What we aim for the lowest supported Maven version? This also determines the lowest supported Java version.

AFAIK, the claimed supported Maven 3.3.x still requires us to support Java 7, which itself is a blocker for the Scala dialect to support newer Scala versions than 2.11.

cstamas commented 1 year ago

@lefou project used 3.6.1, I upped that to 3.6.3, and I was unaware it is intended to go even lower...

lefou commented 1 year ago

@lefou project used 3.6.1, I upped that to 3.6.3, and I was unaware it is intended to go even lower...

At least the project Readme still says: Maven 3.3.1+ and in the Scala dialect pom.xml, there is this note: https://github.com/takari/polyglot-maven/blob/5a92df156dc221792cc06443cab1f4b4f93f1b12/polyglot-scala/pom.xml#L23

We should update the Readme to meet the current minimal requirements.

cstamas commented 1 year ago

Can you please split up your changes (into separate commits) so that changes which only reformat or reorder imports do not clutter the essential changes.

Um, I did not (intend to) reformat anything - unless I inadvertently did that in IDE by reflex... can you point out some files were reformat happened? As those are for sure my mistakes, all I did was:

in the majority of sources... So the end result should be "some imports removed, some imports added". Or is the import ordering maybe off?

lefou commented 1 year ago

Can you please split up your changes (into separate commits) so that changes which only reformat or reorder imports do not clutter the essential changes.

Um, I did not (intend to) reformat anything - unless I inadvertently did that in IDE by reflex... can you point out some files were reformat happened? As those are for sure my mistakes, all I did was:

* plexus components -> JSR330

* plexus Logger -> slf4j

in the majority of sources...

I saw 184 changed files, but missed the fact, that you actually really changed them. It looks to me as some pure order change at first. Sorry for that.

lefou commented 1 year ago

As Maven 3.9 and even Alpha Maven 4.x is required to support Java 8, we should also run test against that runtime.

https://maven.apache.org/docs/history.html

laeubi commented 1 year ago

I think Java 7 is really not something this project should aim at. If there is a demand, one can still use an old release. Same for Maven < 3.8.x ... given that no one has felt to do anything new (except some bugfixes) I think the impact is really low.

lefou commented 1 year ago

I'd like to see an update to the top-level Readme, with the minimal supported versions of Maven 3.9 3.6.3 and Java 8. How hard is it to add Java 8 to the CI setup?

cstamas commented 1 year ago

Currently (master branch) has CI setup as:

This PR updates the CI setup to use shared Takari GH Actions that does:

We could switch to ASF Maven shared GH actions that is very versatile, there we could define a matrix of Maven versions and matrix of Java versions as well.

mosabua commented 1 year ago

So awesome. I totally agree with upping the requirement to Java 11, but don't know for use in terms of usage in other project that might need older Java version. And a newer Maven version as needed is also fine. Probably even more flexible to go to newer.

We should get this merged and then work with the different specialists for the different dialect to get them working again as necessary. You can tell from the git history on the different ones who these contributors mostly are.

lefou commented 1 year ago

I think, unless there are good technical arguments against keeping Java 8 support, we should keep it. Raising the bar for no reasons beside "Java 8 is old" isn't a good argument IMHO. Technically we currently actually do support Java 8 and latest stable Maven also supports Java 8. And it is also reasonable for Maven users to expect plugins to also support the same platforms, (again) unless there are good reasons against it. This PR essentially drops test coverage for Java 8 for no obvious reasons, which I don't like.

laeubi commented 1 year ago

This PR essentially drops test coverage for Java 8 for no obvious reasons, which I don't like.

The obvious reason is: No one feels eager enough to support Java 8. So if you think its important and like to support it, please open a PR to support Java 8. Otherwise this is just the usual demand to projects to take the burden of others what is not acceptable.

lefou commented 1 year ago

I probably missed the point. Isn't the actual code base effectively supporting Java 8? All it needs is to keep a CI job that runs on Java 8. Maybe I overlooked something? Or I don't get what you mean with "support". Are there any reported issues specific to Java 8? If so, maybe we should start with raising the bar only for the offending dialects.

laeubi commented 1 year ago

I think the code base is Java 8 (maybe even Java 1.7), so probably one can just enable target=1.8 if you just care about class-file support.

Beside that, any issue (either build or compile) has to be addressed, so for example you can checkout the PR and make necessary changes (maybe as easy as setting the target level) could be a first step. Also it is quite easy to setup toolchains with github actions so probably that could be another step.

Still if these are maybe trivial in the end, someone must step up to do so :-)

lefou commented 1 year ago

I still don't get it, sorry. The way you said it, makes me feel like it is obvious, but it isn't. I my eyes, this PR removes the CI job that runs on Java 8 (and that way made sure we support that platform). So when asking me to step up, isn't it exactly what I do, point out that this PR makes our Java 8 story weak?

I don't want to offend anybody. I'm also glad to help if there is anything I can do. It's just not clear to me, what the issue is. The PR description does not tell it.

laeubi commented 1 year ago

That's only something @cstamas can answer, as he has choose to

move to Takari shared GH action (uses Java 11 and 17)

meaning the build will run once for Java 11 and Java 17 (what do not mean we can't compile for lower targets).

So if @cstamas has choose this because (for him) its to complicated to work with the older setup (that do not seem to work no more out of the box), unless someone else want to sort out the issues (for me it won't be an issue not to run on Java 8) I better have a version using Java 11 than one using Java 8 but fails on Maven 3.9.x + ...

cstamas commented 1 year ago

Will get back to here once resolver and maven 3.9.1 is out (week or two)

mosabua commented 1 year ago

I am fine with supporting Java 8 if its easy .. but essentially the latest Java LTS version is 17 and before that 11 .. that should be plenty of a support window.

cstamas commented 1 year ago

Just to explain the "Problems: Kotlin module fails, but am not Kotlin magician to fully fix it (140 test passes OK, but there are 4 failures where KotlinModelWriter is about to inject MavenProject -> OutOfScopeEx" bit: It is def UT issue (so more maven related issue than kotlin) as UT does not init the session scope, but am unsure how to express that in kotlin as I never used it. Will try my best a bit later, until then free feel to push to this PR (or propose any needed changes).

@laeubi @lefou I think the question is rather which Java level we need? IMHO, the history (where Maven versions and corresponding Java versions are listed) is actually "minimal Java version supported by Maven", and that does NOT mean by any means we (polyglot) MUST support those Java versions. For example, many Maven plugins already require Java8, but they still run with Maven 3.8.x (Java 7), essentially meaning the two work if you use their "common denominator" java version that is 8.

This PR does NOT raise the bar (just in CI setup!), but I agree, if we claim we are Java 8 CI should run with Java 8 as well. OTOH, our case is a bit more complicated than in case of "ordinary" Java plugin (or extension), as we should find the "common denominator" for all the languages we support (jruby, kotlin, scala, etc) where all they are usable, and that may be something higher than Java 8 (otherwise the language that requires higher Java than 8 would be "stuck" on some version that may introduce problem, or even simply become "abandoned", as whole language ecosystem moved away).

Or even better, IMHO, polyglot should not "align" Java level as whole (with the Maven versions it supports), but rather with Java that are suitable/required for languages it support). Something like this (do it per module):

So to say, to align modules and state for each language which Java version and why is that version "minimally required". This would mean:

My 5 cents.

lefou commented 1 year ago

Thank you @cstamas for your comments. I agree, we should try to only raise the requirement per dialect, if needed.

This PR does NOT raise the bar (just in CI setup!), but I agree, if we claim we are Java 8 CI should run with Java 8 as well.

I just noticed, that this PR in fact does raise the bar, as the changes in the toolchain/lifecycle introduce classes compiled with Java 11. See this exception, for example:

Output of this PR build with Java 8 ``` 13:42:37 θ64° lefou:~/work/tmp/maven-polyglot review-the-project+* ± eselect java-vm set openjdk-bin-8 13:42:48 lefou:~/work/tmp/maven-polyglot review-the-project+* ± java -version openjdk version "1.8.0_362" OpenJDK Runtime Environment (Temurin)(build 1.8.0_362-b09) OpenJDK 64-Bit Server VM (Temurin)(build 25.362-b09, mixed mode) 13:42:52 lefou:~/work/tmp/maven-polyglot review-the-project+* ± mvn verify [INFO] Error stacktraces are turned on. [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: [INFO] [INFO] Polyglot :: Aggregator [pom] [INFO] Polyglot :: Common [takari-maven-component] [INFO] Polyglot :: Atom [takari-maven-component] [INFO] Polyglot :: Maven Plugin [takari-maven-plugin] [INFO] Polyglot :: Ruby [takari-maven-component] [INFO] Polyglot :: Scala [takari-maven-component] [INFO] Polyglot :: Groovy [takari-maven-component] [INFO] Polyglot :: YAML [takari-maven-component] [INFO] Polyglot :: Clojure [takari-maven-component] [INFO] Polyglot :: XML [takari-maven-component] [INFO] Polyglot :: Java [takari-maven-component] [INFO] Polyglot :: Kotlin [takari-maven-component] [INFO] Polyglot :: Translate Plugin [takari-maven-plugin] [INFO] [INFO] --------------------< io.takari.polyglot:polyglot >--------------------- [INFO] Building Polyglot :: Aggregator 0.4.10-SNAPSHOT [1/13] [INFO] --------------------------------[ pom ]--------------------------------- [INFO] [INFO] --- maven-enforcer-plugin:3.1.0:enforce (enforce-maven) @ polyglot --- [INFO] [INFO] --- maven-enforcer-plugin:3.1.0:enforce (enforce-versions) @ polyglot --- [INFO] [INFO] -----------------< io.takari.polyglot:polyglot-common >----------------- [INFO] Building Polyglot :: Common 0.4.10-SNAPSHOT [2/13] [INFO] -----------------------[ takari-maven-component ]----------------------- [WARNING] Error injecting: io.takari.maven.plugins.configurator.TakariMojoExecutionConfigurator java.lang.TypeNotPresentException: Type io.takari.maven.plugins.configurator.TakariMojoExecutionConfigurator not present at org.eclipse.sisu.space.URLClassSpace.loadClass (URLClassSpace.java:147) at org.eclipse.sisu.space.NamedClass.load (NamedClass.java:46) at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48) at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:85) at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:57) at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:66) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:112) at org.eclipse.sisu.bean.BeanScheduler$CycleActivator.onProvision (BeanScheduler.java:230) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:120) at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66) at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:61) at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:47) at com.google.inject.internal.ProviderToInternalFactoryAdapter.get (ProviderToInternalFactoryAdapter.java:40) at com.google.inject.internal.SingletonScope$1.get (SingletonScope.java:168) at com.google.inject.internal.InternalFactoryToProviderAdapter.get (InternalFactoryToProviderAdapter.java:39) at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1050) at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81) at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51) at java.util.AbstractMap.get (AbstractMap.java:187) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.mojoExecutionConfigurator (DefaultLifecycleExecutionPlanCalculator.java:574) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution (DefaultLifecycleExecutionPlanCalculator.java:176) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions (DefaultLifecycleExecutionPlanCalculator.java:154) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:130) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:144) at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan (BuilderCommon.java:98) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:111) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:298) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: java.lang.UnsupportedClassVersionError: io/takari/maven/plugins/configurator/TakariMojoExecutionConfigurator has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1 (Native Method) at java.lang.ClassLoader.defineClass (ClassLoader.java:756) at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass (URLClassLoader.java:473) at java.net.URLClassLoader.access$100 (URLClassLoader.java:74) at java.net.URLClassLoader$1.run (URLClassLoader.java:369) at java.net.URLClassLoader$1.run (URLClassLoader.java:363) at java.security.AccessController.doPrivileged (Native Method) at java.net.URLClassLoader.findClass (URLClassLoader.java:362) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf (ClassRealm.java:425) at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:42) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239) at org.eclipse.sisu.space.URLClassSpace.loadClass (URLClassSpace.java:139) at org.eclipse.sisu.space.NamedClass.load (NamedClass.java:46) at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48) at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:85) at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:57) at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:66) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:112) at org.eclipse.sisu.bean.BeanScheduler$CycleActivator.onProvision (BeanScheduler.java:230) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:120) at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66) at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:61) at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:47) at com.google.inject.internal.ProviderToInternalFactoryAdapter.get (ProviderToInternalFactoryAdapter.java:40) at com.google.inject.internal.SingletonScope$1.get (SingletonScope.java:168) at com.google.inject.internal.InternalFactoryToProviderAdapter.get (InternalFactoryToProviderAdapter.java:39) at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1050) at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81) at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51) at java.util.AbstractMap.get (AbstractMap.java:187) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.mojoExecutionConfigurator (DefaultLifecycleExecutionPlanCalculator.java:574) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution (DefaultLifecycleExecutionPlanCalculator.java:176) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions (DefaultLifecycleExecutionPlanCalculator.java:154) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:130) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:144) at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan (BuilderCommon.java:98) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:111) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:298) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for Polyglot :: Aggregator 0.4.10-SNAPSHOT: [INFO] [INFO] Polyglot :: Aggregator ............................. SUCCESS [ 0.367 s] [INFO] Polyglot :: Common ................................. FAILURE [ 0.027 s] [INFO] Polyglot :: Atom ................................... SKIPPED [INFO] Polyglot :: Maven Plugin ........................... SKIPPED [INFO] Polyglot :: Ruby ................................... SKIPPED [INFO] Polyglot :: Scala .................................. SKIPPED [INFO] Polyglot :: Groovy ................................. SKIPPED [INFO] Polyglot :: YAML ................................... SKIPPED [INFO] Polyglot :: Clojure ................................ SKIPPED [INFO] Polyglot :: XML .................................... SKIPPED [INFO] Polyglot :: Java ................................... SKIPPED [INFO] Polyglot :: Kotlin ................................. SKIPPED [INFO] Polyglot :: Translate Plugin ....................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.358 s [INFO] Finished at: 2023-02-18T13:42:59+01:00 [INFO] ------------------------------------------------------------------------ [ERROR] Unable to provision, see the following errors: [ERROR] [ERROR] 1) Error in custom provider, java.lang.TypeNotPresentException: Type io.takari.maven.plugins.configurator.TakariMojoExecutionConfigurator not present [ERROR] at ClassRealm[extension>io.takari.maven.plugins:takari-lifecycle-plugin:2.0.9, parent: sun.misc.Launcher$AppClassLoader@7852e922] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule) [ERROR] while locating org.apache.maven.lifecycle.MojoExecutionConfigurator annotated with @com.google.inject.name.Named(value=takari) [ERROR] [ERROR] 1 error: io/takari/maven/plugins/configurator/TakariMojoExecutionConfigurator has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 com.google.inject.ProvisionException: Unable to provision, see the following errors: 1) Error in custom provider, java.lang.TypeNotPresentException: Type io.takari.maven.plugins.configurator.TakariMojoExecutionConfigurator not present at ClassRealm[extension>io.takari.maven.plugins:takari-lifecycle-plugin:2.0.9, parent: sun.misc.Launcher$AppClassLoader@7852e922] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule) while locating org.apache.maven.lifecycle.MojoExecutionConfigurator annotated with @com.google.inject.name.Named(value=takari) 1 error at com.google.inject.internal.InternalProvisionException.toProvisionException (InternalProvisionException.java:226) at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1053) at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81) at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51) at java.util.AbstractMap.get (AbstractMap.java:187) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.mojoExecutionConfigurator (DefaultLifecycleExecutionPlanCalculator.java:574) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution (DefaultLifecycleExecutionPlanCalculator.java:176) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions (DefaultLifecycleExecutionPlanCalculator.java:154) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:130) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:144) at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan (BuilderCommon.java:98) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:111) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:298) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: java.lang.TypeNotPresentException: Type io.takari.maven.plugins.configurator.TakariMojoExecutionConfigurator not present at org.eclipse.sisu.space.URLClassSpace.loadClass (URLClassSpace.java:147) at org.eclipse.sisu.space.NamedClass.load (NamedClass.java:46) at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48) at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:85) at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:57) at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:66) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:112) at org.eclipse.sisu.bean.BeanScheduler$CycleActivator.onProvision (BeanScheduler.java:230) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:120) at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66) at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:61) at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:47) at com.google.inject.internal.ProviderToInternalFactoryAdapter.get (ProviderToInternalFactoryAdapter.java:40) at com.google.inject.internal.SingletonScope$1.get (SingletonScope.java:168) at com.google.inject.internal.InternalFactoryToProviderAdapter.get (InternalFactoryToProviderAdapter.java:39) at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1050) at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81) at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51) at java.util.AbstractMap.get (AbstractMap.java:187) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.mojoExecutionConfigurator (DefaultLifecycleExecutionPlanCalculator.java:574) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution (DefaultLifecycleExecutionPlanCalculator.java:176) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions (DefaultLifecycleExecutionPlanCalculator.java:154) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:130) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:144) at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan (BuilderCommon.java:98) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:111) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:298) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: java.lang.UnsupportedClassVersionError: io/takari/maven/plugins/configurator/TakariMojoExecutionConfigurator has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1 (Native Method) at java.lang.ClassLoader.defineClass (ClassLoader.java:756) at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass (URLClassLoader.java:473) at java.net.URLClassLoader.access$100 (URLClassLoader.java:74) at java.net.URLClassLoader$1.run (URLClassLoader.java:369) at java.net.URLClassLoader$1.run (URLClassLoader.java:363) at java.security.AccessController.doPrivileged (Native Method) at java.net.URLClassLoader.findClass (URLClassLoader.java:362) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf (ClassRealm.java:425) at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:42) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239) at org.eclipse.sisu.space.URLClassSpace.loadClass (URLClassSpace.java:139) at org.eclipse.sisu.space.NamedClass.load (NamedClass.java:46) at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48) at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:85) at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:57) at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:66) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:112) at org.eclipse.sisu.bean.BeanScheduler$CycleActivator.onProvision (BeanScheduler.java:230) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:120) at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66) at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:61) at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:47) at com.google.inject.internal.ProviderToInternalFactoryAdapter.get (ProviderToInternalFactoryAdapter.java:40) at com.google.inject.internal.SingletonScope$1.get (SingletonScope.java:168) at com.google.inject.internal.InternalFactoryToProviderAdapter.get (InternalFactoryToProviderAdapter.java:39) at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1050) at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81) at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51) at java.util.AbstractMap.get (AbstractMap.java:187) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.mojoExecutionConfigurator (DefaultLifecycleExecutionPlanCalculator.java:574) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution (DefaultLifecycleExecutionPlanCalculator.java:176) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions (DefaultLifecycleExecutionPlanCalculator.java:154) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:130) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:144) at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan (BuilderCommon.java:98) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:111) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:298) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) [ERROR] [ERROR] Re-run Maven using the -X switch to enable full debug logging. 13:42:59 θ72° lefou:~/work/tmp/maven-polyglot review-the-project+* 3s 1 ± ```

So, maybe that is what @laeubi already knew or assumed? Unless we find an older version still compatible to Java 8 but also fixing the Maven 3.9 injection problem, we might be out of options. I assume, we won't convice anybody to bring back support of Java 8 in that toolchain.

cstamas commented 1 year ago

That was me and cool you point that out!

In short, what happened: Takari parent POM 50 lifted baseline to Java 11: https://github.com/takari/takari-pom/blob/master/pom.xml#L84 I updated parent POM in takari lifecycle and released 2.1.0 with it: https://github.com/takari/takari-lifecycle/commit/6b3634dbbb4d1d21f9dc3f9e58cd1fa7330922c1#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8R18

And seems I missed this (takari parent 48 vs 50) change, that with parent, I inadvertently upped Java as well from 8 to 11.

Will fix this, will do a lifecycle 2,1,1 release that fixes this, sorry.

laeubi commented 1 year ago

Yes the commons module is the one that actually can be good to keep at a lower level (but I think 8 is really enough).

If I would have to design a matrix I maybe would just:

  1. Use target level per module
  2. Have a profile for each build JVM that list the modules for that JVM with a profile activation according to the java level, then only Java 8 comptible modules are build on a java 8 jvm and so on.

I think it would even be fair enough to simply disable all failing modules, if anyone cares about them they can be integrated later on.

lefou commented 1 year ago

@cstamas Great to hear, it is fixable. I hope, this also points out the importance of having a CI workflow using the minimal supported platform, which would have made that issue visible much earlier.

@laeubi I agree that Java 8 is definitely enough. It's the oldest still supported JDK.

cstamas commented 1 year ago

Created PR https://github.com/takari/takari-lifecycle/pull/113 and let's see what @jvanzyl (or @mosabua ) has to add.

laeubi commented 1 year ago

@lefou I think this is just pointing out you can't build the polyglot with Java 8, but the resulting jar can still be used with Java 8.

e.g. we use this really extensively in Tycho, while Tycho itself requires Java 17 (!) to run the build, we still compile code there for Java target 1.1 (!) (thanks to Eclipse compiler).

Also user of Tycho need Java 17 to run their maven build, but thanks to the advanced Toolchainsupport (and the eclipse compiler support), they can compile their code with whatever JVM they want even in the same build! Also different modules can then run their tests with the desired "real" JVM if needed, but there is no need to have different JVM to run the build itself.

cstamas commented 1 year ago

There is another thing I wanted to bring up: we can raise build time java requirement while keep runtime java requirement lower, meaning, if we state "polyglot minimally requires Java 8" does not mean you CAN build it with Java 8.

Example for this (will be) resolver 1.10.x, where we plan to introduce HTTP/2 transports (https://github.com/apache/maven-resolver/pull/231), and the plan to achieve this is following:

The result is, that resolver existing modules remain Java 8 (so adheres to Maven 3.9.x "minimally supported Java"), while users are able to utilize new HTTP/2 transports IF they run Maven using Java 11 or above. And these days, many of our users run Maven on 11+ Java versions, while again, they also can use release=X to target something lower at runtime.

And if paranoid, you can still setup some IT related things that verifies that at runtime all works as expected on Java8 as well.

lefou commented 1 year ago

Yeah, right. Thanks for completing the picture of options! Yet, that means, there is more work to do, before we re-establish the confidence to the same level as the status quo.

For me, as the maintainer of the Scala dialect, having some integration tests to reproduce issues is essential to keep the tool usable. Loosing this capability (at least without additional further setup) is essentially making my work harder or impossible, due to the overhead.

Being able to build the project with Java 8 is not necessary. But it's the low hanging fruit so to speak, in contrast to setup toolchains support for integration tests. Everything under the assumption, that other dialects have integration tests. As long as these work, I'm happy with any solution. And frankly, I have no idea how hard it is to setup a toolchain matrix for integration tests with Maven. But it feels very complicated.

laeubi commented 1 year ago

So what do you think about the following:

The CI integration jobs verify everything works fine, and one can simply release with a higher java (11) later on.

lefou commented 1 year ago

So what do you think about the following:

* We just use a matrix with Java 8, 11, 17 (@cstamas do you see any problem with that?)

* The pom includes by default all modules that can compile/run java 8

* any module require a higher java version simply is added to the modules with a profile with jdk activation

* each module additionally defines the target level

The CI integration jobs verify everything works fine, and one can simply release with a higher java (11) later on.

That's a good plan!

laeubi commented 1 year ago

For me, as the maintainer of the Scala dialect

By the way one thing that came into my mind (I'm not familiar with Scala so maybe its a bad idea):

It seems there is a scala maven plugin, maybe it would make sense to maintain support of the polyglot-scala there and not as part of this repository? For example "Tycho-Polyglot" extension is also part of the Tycho project and only consuming the polyglot-commons and maybe that would be an option for scala as well, then changes in the scala parts do not require a polyglot release and one is more free in regards of reusing/sharing codes, used scala / java versions and the code is there where the scala experts are.

One could then just maintain a list of polyglot langs and where they are implemented / maintained and probably over time then only polyglot-commons would be required here (even though I wish it actually would be part of maven directly).

lefou commented 1 year ago

If outsourced, the Scala should become a standalone extension, IMHO. It's completely independent, can even be used without the scala-maven-plugin, or could use different versions of it. I know of pure Java projects which use the Scala polyglot extension for pure maintainability reasons. A downside of outsourcing: the whole polyglot universe would become more cluttered.

cstamas commented 1 year ago

@asomov @headius ping... please chime in

headius commented 1 year ago

Missed this one! I will catch up.

headius commented 1 year ago

JRuby 9.4, the current major release, still supports Java 8. The previous release 9.3, now in maintenance mode, also supports Java 8 minimum. JRuby "9.5", the next big version, will bump to Java 11 at least and possibly Java 17.

We have no particular requirements for specific maven versions.

If you need any other input from me here let me know!

cstamas commented 1 year ago

Thanks, so Java 8 as minimum is not a problem for JRuby.

cstamas commented 1 year ago

@lefou @laeubi @headius @asomov @mosabua pls add some green to this PR.

CI now builds with 8, 11, 17.

PR description updated to reflect real changes.

cstamas commented 1 year ago

Commit -2 just updates some commons deps. Commit -1 updates to Maven 3.9.5 to get rid of MANY sec issues this project has, but there is a catch: in Maven model 3.6 exclusions were AG ordered, while from 3.8 order changed to "natural" GA, so adjusted all pom.xmls used for comparisons as needed.

Compiling against 3.9.x retains backward compat, while at the same time gets deprecations visible as well...