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

NoSuchMethodError - Incorrect plugin prerequisites #21

Closed
tysonite opened this issue May 17, 2016 · 7 comments
Closed

NoSuchMethodError - Incorrect plugin prerequisites #21

tysonite opened this issue May 17, 2016 · 7 comments
Assignees
Labels
Milestone

Comments

@tysonite
Copy link

If I add an extension in pom.xml, I get following warning:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: linux
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 3.19
[INFO] os.detected.version.major: 3
[INFO] os.detected.version.minor: 19
[INFO] os.detected.release: ubuntu
[INFO] os.detected.release.version: 14.04
[INFO] os.detected.release.like.ubuntu: true
[INFO] os.detected.release.like.debian: true
[INFO] os.detected.classifier: linux-x86_64
[WARNING] Failed to inject repository session properties.
java.lang.NoSuchMethodError: org.apache.maven.execution.MavenSession.getRepositorySession()Lorg/eclipse/aether/RepositorySystemSession;
    at kr.motd.maven.os.RepositorySessionInjector.injectRepositorySession(RepositorySessionInjector.java:22)
    at kr.motd.maven.os.DetectExtension.injectSession(DetectExtension.java:151)
    at kr.motd.maven.os.DetectExtension.afterProjectsRead(DetectExtension.java:110)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:274)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

Not sure if it is something that needs to be fixed, I can reference variables like ${os.detected.classifier} in my pom.xml, however, state it here. Maven / Java version is

$ mvn --version
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_101, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.19.0-59-generic", arch: "amd64", family: "unix"
@ganesh-karthick
Copy link

Upgrading to newer maven 3.3.9 , ends up fixing this issue.

@trustin
Copy link
Owner

trustin commented Jun 22, 2016

This plugin requires at least Maven 3.1 IIRC.

@trustin trustin closed this as completed Jun 22, 2016
@tysonite
Copy link
Author

@trustin I propose to make a note about that in the README file.

@OrangeDog
Copy link

OrangeDog commented Jul 29, 2016

The os-maven-plugin pom currently says <prerequisites><maven>3.0</maven></prerequisites>, which is wrong.

The last version that worked with 3.0 was 1.2.0.Final (i.e. 1.2.1 was the breaking change).

@trustin
Copy link
Owner

trustin commented Aug 1, 2016

Doh, will update. Thanks for the heads up!

@trustin trustin self-assigned this Aug 1, 2016
@trustin trustin reopened this Aug 1, 2016
@trustin trustin changed the title java.lang.NoSuchMethodError exception java.lang.NoSuchMethodError exception - Incorrect plugin prerequisites Aug 1, 2016
@trustin trustin changed the title java.lang.NoSuchMethodError exception - Incorrect plugin prerequisites \NoSuchMethodError - Incorrect plugin prerequisites Aug 1, 2016
@trustin trustin changed the title \NoSuchMethodError - Incorrect plugin prerequisites NoSuchMethodError - Incorrect plugin prerequisites Aug 1, 2016
@trustin trustin added this to the 1.5.1.Final milestone Aug 1, 2016
@trustin trustin added the bug label Aug 1, 2016
@qujian
Copy link

qujian commented Mar 4, 2017

@ganesh-karthick

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.maven.execution.MavenSession.getRepositorySession()Lorg/sonatype/aether/RepositorySystemSession;
	at org.eclipse.tycho.core.maven.utils.PluginRealmHelper.execute(PluginRealmHelper.java:92)
	at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.getDependencyMetadata(P2TargetPlatformResolver.java:144)
	at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.setupProjects(P2TargetPlatformResolver.java:126)
	at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.setupProject(DefaultTychoDependencyResolver.java:87)
	at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:77)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:266)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	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:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
$ mvn --version 
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_112, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.3", arch: "x86_64", family: "mac"

@ganesh-karthick
Copy link

@qujian if you're running from intellj , make sure intellj uses right maven version, by default it might end up using maven which is packaged within it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants