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

Revive the project #257

Merged
merged 16 commits into from
Oct 27, 2023
Merged

Revive the project #257

merged 16 commits into from
Oct 27, 2023

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Feb 13, 2023

High level changes:

  • Updates GH action (uses Java 8, 11 and 17 to build)
  • move to latest released Takari parent POM (but lower takari lifecycle to version 2.0.8 that still runs on Java8)
  • move off plexus component, convert all modules to takari-maven-component packaging (JSR330)
  • move off plexus logging, use Slf4j instead
  • plexus-utils is NOT auto-injected anymore starting with Maven 3.9.0, sort it out
  • fix compared POMs, locations are all now HTTPS (not HTTP)
  • update some stale/vuln deps
  • update to Maven 3.9.5 (was 3.6.3), hence updated POM resources used for output comparison as dependency/exclusion changed from AG to GA.

- move to Takari shared GH action (uses Java 11 and 17)
- move to latest released parent (but there is takari/takari-pom#12)
- move off plexus component, convert all modules to takari-maven-component packaging (JSR300)
- move off plexus logging, use Slf4j
- plexus-utils is NOT auto-injected anymore starting with Maven 3.9.0, sort it out
- fix compared POMs, locations are all now HTTPS (not HTTP)

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

All the rest of modules should be OK, tested with Maven 3.6.3, 3.8.7 and 3.9.0.
@cstamas cstamas self-assigned this Feb 13, 2023
@lefou
Copy link
Contributor

lefou commented Feb 13, 2023

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
Copy link
Member Author

cstamas commented Feb 13, 2023

@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
Copy link
Contributor

lefou commented Feb 13, 2023

@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:

<!-- We cannot use 2.12+, as Maven 3.x requires us to run on Java7 -->

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

Copy link
Contributor

@lefou lefou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@cstamas
Copy link
Member Author

cstamas commented Feb 13, 2023

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... So the end result should be "some imports removed, some imports added". Or is the import ordering maybe off?

@cstamas cstamas mentioned this pull request Feb 13, 2023
@lefou
Copy link
Contributor

lefou commented Feb 13, 2023

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
Copy link
Contributor

lefou commented Feb 13, 2023

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
Copy link
Contributor

laeubi commented Feb 13, 2023

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.

Copy link
Contributor

@laeubi laeubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it works go for it!
If anyone care enough the disabled modules and/or test can be revived later on.

Actually it would be great if polyglot maven would be default distributed with maven, then the impls/test here can simply consume the maven provided artifact to implement the different languages...

@lefou
Copy link
Contributor

lefou commented Feb 14, 2023

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
Copy link
Member Author

cstamas commented Feb 14, 2023

Currently (master branch) has CI setup as:

  • use mvnw as specified by project (currently 3.6.3)
  • uses matrix of Java 8 and Java 11

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

  • use mvnw as specified by project (currently 3.6.3)
  • uses matrix of Java 11 and Java 17

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
Copy link
Member

mosabua commented Feb 17, 2023

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
Copy link
Contributor

lefou commented Feb 17, 2023

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
Copy link
Contributor

laeubi commented Feb 17, 2023

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
Copy link
Contributor

lefou commented Feb 17, 2023

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
Copy link
Contributor

laeubi commented Feb 17, 2023

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
Copy link
Contributor

lefou commented Feb 17, 2023

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
Copy link
Contributor

laeubi commented Feb 17, 2023

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 + ...

Comment on lines 9 to 11
name: Verify
uses: takari/takari-gh-actions/.github/workflows/ci.yml@v1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is almost identically to what we had before, except the newer version of the action/cehckout action. As we want to keep Java 8 coverage, I suggest to either drop that change or pass a changed java-version-matrix to that re-used job.

Maybe the following works. If not, the takari-gh-actions might need to be changed to support changing that value.

Suggested change
name: Verify
uses: takari/takari-gh-actions/.github/workflows/ci.yml@v1
strategy:
matrix:
java-version: ['8', '11', '17']
name: Verify
uses: takari/takari-gh-actions/.github/workflows/ci.yml@v1
with:
java-version: ${{ matrix.java-version }}

See also this docuemntation: https://docs.github.com/en/actions/using-workflows/reusing-workflows#using-a-matrix-strategy-with-a-reusable-workflow

@cstamas
Copy link
Member Author

cstamas commented Feb 17, 2023

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

@mosabua
Copy link
Member

mosabua commented Feb 17, 2023

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
Copy link
Member Author

cstamas commented Feb 18, 2023

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):

  • polyglot-common - minimal java (ie. 7)?
  • polyglot-ruby - minimal Java for JRuby
  • polyglot-kotlin - minimal Java for Kotlin
  • etc

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

  • switch to release compiler flag
  • raise the build required Java level to something that covers all release versions
  • or use toolchains per module?

My 5 cents.

@lefou
Copy link
Contributor

lefou commented Feb 18, 2023

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
Copy link
Member Author

cstamas commented Feb 18, 2023

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: takari/takari-lifecycle@6b3634d#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
Copy link
Contributor

laeubi commented Feb 18, 2023

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
Copy link
Contributor

lefou commented Feb 18, 2023

@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.

But keep build output at Java 8 level.
As if:
* used as extension, p-u MUST NOT be present (as it is in core)
* used as plugin, p-u MUST BE present (as 3.9 does not auto-inject it anymore)
@cstamas
Copy link
Member Author

cstamas commented Aug 27, 2023

@asomov @headius ping... please chime in

@headius
Copy link
Contributor

headius commented Oct 21, 2023

Missed this one! I will catch up.

@headius
Copy link
Contributor

headius commented Oct 26, 2023

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
Copy link
Member Author

cstamas commented Oct 26, 2023

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

@cstamas
Copy link
Member Author

cstamas commented Oct 26, 2023

@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.

Copy link
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding lots of green for @cstamas

🟢

🍏

💚

📗

and some white ✅

Thanks so much for running with this project ...

Compiling against it still retains compatibility with 3.6.x,
but you get latest code with latest deprecations.

One big change: serialization order changed for dependency/exclusion
element, hence order is now ga (was ag). This is merely style,
no semantic value.
@cstamas
Copy link
Member Author

cstamas commented Oct 26, 2023

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...

Copy link
Contributor

@lefou lefou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for re-adding Java 8 CI pipeline, @cstamas !

@cstamas cstamas merged commit 026fb4f into master Oct 27, 2023
4 checks passed
@cstamas cstamas deleted the review-the-project branch October 27, 2023 08:08
laeubi added a commit to laeubi/tycho that referenced this pull request Aug 12, 2024
This is fixed with takari/polyglot-maven#257 and
released with version 0.5.0
laeubi added a commit to eclipse-tycho/tycho that referenced this pull request Aug 12, 2024
This is fixed with takari/polyglot-maven#257 and
released with version 0.5.0
eclipse-tycho-bot pushed a commit to eclipse-tycho/tycho that referenced this pull request Aug 12, 2024
This is fixed with takari/polyglot-maven#257 and
released with version 0.5.0

(cherry picked from commit b62e492)
eclipse-tycho-bot pushed a commit to eclipse-tycho/tycho that referenced this pull request Aug 12, 2024
This is fixed with takari/polyglot-maven#257 and
released with version 0.5.0

(cherry picked from commit b62e492)
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.

5 participants