Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to maven 3.9.x #1557

Closed
laeubi opened this issue Oct 19, 2022 · 2 comments · Fixed by #2093
Closed

Update to maven 3.9.x #1557

laeubi opened this issue Oct 19, 2022 · 2 comments · Fixed by #2093
Milestone

Comments

@laeubi
Copy link
Member

laeubi commented Oct 19, 2022

Once maven 3.9 is out we should migrate and use it.

Maven 3.9 will remove all deprecated API and is a perquisite if we later want to be prepared for maven 4.

Also there are some important new features Tycho can leverage in 3.9.x:

  • MNG-7630 - Support listing of workspace models apache/maven#913 could be used as an alternative way to discover other projects we can use in p2 dependency resolution, currently Tycho solely relies on the session projects, but this is nothing easily handled inside an IDE where there is no "session" that covers a single run but multiple (repeated) ones that probably only cover one project a a few.
@laeubi laeubi added this to the 4.0 milestone Oct 19, 2022
@gtsh
Copy link

gtsh commented Feb 11, 2023

3.9.0 has been released end of Jan 2023. And promptly maven execution fails, not only for modules containing a tycho plugin.
Any maven project starts to fail, as soon as the tycho extension is configured somewhere towards the fs root in .mvn/extensions.xml.
Steps to reproduce:

1.) Generate a minimal maven project using an archetype.
2.) Configure .mvn/extensions.xml. with


org.eclipse.tycho
tycho-build
... any Version gt 2.7.0 ...

3.) mvn install
Results in:
mvn clean install
[INFO] Scanning for projects...
[ERROR] Internal error: java.lang.NullPointerException: Cannot invoke "org.apache.maven.repository.internal.ModelCacheFactory.createCache(org.eclipse.aether.RepositorySystemSession)" because "this.modelCacheFactory" is null -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException: Cannot invoke "org.apache.maven.repository.internal.ModelCacheFactory.createCache(org.eclipse.aether.RepositorySystemSession)" because "this.modelCacheFactory" is null
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:108)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:821)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:270)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
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.NullPointerException: Cannot invoke "org.apache.maven.repository.internal.ModelCacheFactory.createCache(org.eclipse.aether.RepositorySystemSession)" because "this.modelCacheFactory" is null
at org.apache.maven.project.DefaultProjectBuilder.createModelCache (DefaultProjectBuilder.java:1002)
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:362)
at org.sonatype.maven.polyglot.TeslaProjectBuilder.build (TeslaProjectBuilder.java:43)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects (DefaultGraphBuilder.java:349)
at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor (DefaultGraphBuilder.java:340)
at org.apache.maven.graph.DefaultGraphBuilder.build (DefaultGraphBuilder.java:76)
at org.eclipse.tycho.build.TychoGraphBuilder.build (TychoGraphBuilder.java:97)
at org.apache.maven.DefaultMaven.buildGraph (DefaultMaven.java:453)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:196)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:172)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:100)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:821)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:270)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
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] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException

C:\Users\Freshco\Projects\Junk\y>mvn clean install
[INFO] Scanning for projects...
[ERROR] Internal error: java.lang.NullPointerException: Cannot invoke "org.apache.maven.repository.internal.ModelCacheFactory.createCache(org.eclipse.aether.RepositorySystemSession)" because "this.modelCacheFactory" is null -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException: Cannot invoke "org.apache.maven.repository.internal.ModelCacheFactory.createCache(org.eclipse.aether.RepositorySystemSession)" because "this.modelCacheFactory" is null
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:108)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:821)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:270)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
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.NullPointerException: Cannot invoke "org.apache.maven.repository.internal.ModelCacheFactory.createCache(org.eclipse.aether.RepositorySystemSession)" because "this.modelCacheFactory" is null
at org.apache.maven.project.DefaultProjectBuilder.createModelCache (DefaultProjectBuilder.java:1002)
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:362)
at org.sonatype.maven.polyglot.TeslaProjectBuilder.build (TeslaProjectBuilder.java:43)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects (DefaultGraphBuilder.java:349)
at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor (DefaultGraphBuilder.java:340)
at org.apache.maven.graph.DefaultGraphBuilder.build (DefaultGraphBuilder.java:76)
at org.eclipse.tycho.build.TychoGraphBuilder.build (TychoGraphBuilder.java:97)
at org.apache.maven.DefaultMaven.buildGraph (DefaultMaven.java:453)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:196)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:172)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:100)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:821)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:270)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
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] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException

@laeubi
Copy link
Member Author

laeubi commented Feb 11, 2023

3.9.0 has been released end of Jan 2023

@gtsh please see:

And promptly maven execution fails, not only for modules containing a tycho plugin.

If you have configured "somewhere towards the fs root in .mvn/extensions.xml" then you have enabled tycho. If thats not desired, place an (empty) .mvn folder at the level in your project tree where it should stop, this is a maven feature not specific to Tycho.

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 a pull request may close this issue.

2 participants