Error commande mvn from console Intellij and java 11 - maven

I have a problem with command mvn
I work with Intellij and java 11
I clone a project and when i tape a command on terminal, he doesn't work.
For exemple :
mvn test -> on console : error
with maven tab : its ok
My stacktrace :
brichet#brichet-G11CD:~/IdeaProjects/cours_TDD/oc-testing-java-cours$ mvn test
[INFO] Scanning for projects...
[WARNING] Error injecting: org.apache.maven.wagon.providers.http.HttpWagon$__sisu21
java.lang.ExceptionInInitializerError
at sun.security.ssl.ProtocolVersion.<init> (ProtocolVersion.java:158)
at sun.security.ssl.ProtocolVersion.<clinit> (ProtocolVersion.java:41)
at sun.security.ssl.SSLContextImpl$AbstractTLSContext.<clinit> (SSLContextImpl.java:560)
....
Caused by: java.lang.IllegalArgumentException: Error in security property. Constraint unknown:
jdk.disabled.namedCurves
at sun.security.util.DisabledAlgorithmConstraints$Constraints.<init>
(DisabledAlgorithmConstraints.java:329)
at sun.security.util.DisabledAlgorithmConstraints.<init>
(DisabledAlgorithmConstraints.java:100)
at sun.security.ssl.SSLAlgorithmConstraints.<clinit> (SSLAlgorithmConstraints.java:45)
at sun.security.ssl.ProtocolVersion.<init> (ProtocolVersion.java:158)
at sun.security.ssl.ProtocolVersion.<clinit> (ProtocolVersion.java:41)
at sun.security.ssl.SSLContextImpl$AbstractTLSContext.<clinit> (SSLContextImpl.java:560)
at java.lang.Class.forName0 (Native Method)
at java.lang.Class.forName (Class.java:315)
at java.security.Provider$Service.getImplClass (Provider.java:1848)
at java.security.Provider$Service.newInstance (Provider.java:1824)
at sun.security.jca.GetInstance.getInstance (GetInstance.java:236)
at sun.security.jca.GetInstance.getInstance (GetInstance.java:164)
at javax.net.ssl.SSLContext.getInstance (SSLContext.java:168)
at javax.net.ssl.SSLContext.getDefault (SSLContext.java:99)
at javax.net.ssl.SSLSocketFactory.getDefault (SSLSocketFactory.java:123)
at javax.net.ssl.HttpsURLConnection.getDefaultSSLSocketFactory
(HttpsURLConnection.java:335)
at
.......
---------------------------------------------------
Caused by: java.lang.IllegalArgumentException: Error in security property. Constraint unknown:
jdk.disabled.namedCurvesat
java.base/sun.security.util.DisabledAlgorithmConstraints$Constraints.<init>(DisabledAlgorithmCo
nstraints.java:329)
at
java.base/sun.security.util.DisabledAlgorithmConstraints.<init>(DisabledAlgorithmConstraints.java
:100)
at
java.base/sun.security.ssl.SSLAlgorithmConstraints.<clinit>(SSLAlgorithmConstraints.java:45)
... 84 more
Thank you for help !

May be check maven JDK version and intellij project JDK version (on the Projet Structure / Project Settings / Projet SDK menu) , it may have a difference

Related

MVN build: java.lang.RuntimeException: Exception in org.eclipse.osgi.framework.internal.core.SystemBundleActivator.start() of bundle org.eclipse.osgi

I am facing issue in "mvn clean build" due to error below
[WARNING] No explicit target runtime environment configuration. Build is platform dependent.
[WARNING] Error initializing: org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver#5e2a3040
java.lang.RuntimeException: java.lang.RuntimeException: Exception in org.eclipse.osgi.framework.internal.core.SystemBundleActivator.start() of bundle org.eclipse.osgi.
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.checkStarted(DefaultEquinoxEmbedder.java:301)
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.getService(DefaultEquinoxEmbedder.java:275)
I have set the Mavan, M2 and Java Paths correctly on the environment variables.
Please suggest what the cause the error.
Regards
R

Xtext maven build with project wizard of example project

Hello I tried to build the example xtext project via maven by using the project wizard, adding feature and update site and choosing maven build. To overcome another error I changed Tycho version to 2.3.0 . I now get the following build error I just cant get rid of:
[INFO] --- exec-maven-plugin:1.6.0:java (mwe2Launcher) # org.xtext.example.mydsl ---
0 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - com.google.inject.internal.util.$ComputationException: java.lang.ExceptionInInitializerError
com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: java.lang.ExceptionInInitializerError
at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:553)
at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:419)
at com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
at com.google.inject.internal.FailableCache.get(FailableCache.java:50)
at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:49)
at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:125)
at com.google.inject.internal.InjectorImpl.initializeBinding(InjectorImpl.java:507)
at com.google.inject.internal.AbstractBindingProcessor$Processor$1.run(AbstractBindingProcessor.java:159)
at com.google.inject.internal.ProcessedBindingData.initializeBindings(ProcessedBindingData.java:44)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:122)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:72)
at com.google.inject.Guice.createInjector(Guice.java:62)
at org.eclipse.emf.mwe2.language.Mwe2StandaloneSetupGenerated.createInjector(Mwe2StandaloneSetupGenerated.java:47)
at org.eclipse.emf.mwe2.language.Mwe2StandaloneSetupGenerated.createInjectorAndDoEMFRegistration(Mwe2StandaloneSetupGenerated.java:41)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:76)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:37)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
at java.base/java.lang.Thread.run(Thread.java:831)
I changed the version of the coresponding exec-maven-plugin but didnt help. Any idea? And maybe an generic idea how to debug that kind of errors? Thank you!

Scala SBT - Java ClassNotFoundException when running simple command

I am using OpenJDK 11 with SBT 1.5.4
I have also set my System Environment Variable path to C:\sbt\bin - i.e. I am on Windows
I also have JAVA_HOME defined.
When I run sbt command from command line, I am getting the following error:
copying runtime jar...
[info] [launcher] getting org.scala-sbt sbt 1.4.1 (this may take some time)...
[info] [launcher] getting Scala 2.13.3 (for sbt)...
java.lang.NoClassDefFoundError: scala/Serializable
at sbt.internal.ClassLoaderWarmup$.warmup(XMainConfiguration.scala:31)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at sbt.internal.XMainConfiguration.run(XMainConfiguration.scala:82)
at sbt.xMain.run(Main.scala:46)
at xsbt.boot.Launch$.$anonfun$run$1(Launch.scala:149)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:176)
at xsbt.boot.Launch$.run(Launch.scala:149)
at xsbt.boot.Launch$.$anonfun$apply$1(Launch.scala:44)
at xsbt.boot.Launch$.launch(Launch.scala:159)
at xsbt.boot.Launch$.apply(Launch.scala:44)
at xsbt.boot.Launch$.apply(Launch.scala:21)
at xsbt.boot.Boot$.runImpl(Boot.scala:78)
at xsbt.boot.Boot$.run(Boot.scala:73)
at xsbt.boot.Boot$.main(Boot.scala:21)
at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.ClassNotFoundException: scala.Serializable
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 18 more
[error] [launcher] error during sbt launcher: java.lang.NoClassDefFoundError: scala/Serializable
I don't know what I am doing wrong because as per documentation, this should just work. I also tried deleting HOME/.sbt directory to repeat the process, but no luck. Any idea from anyone?
It says [info] [launcher] getting Scala 2.13.3 (for sbt).... But sbt should always use Scala 2.12. Do you have a line like scalaVersion := "2.13.3" somewhere in the project directory?

Service is not registered class='interface org.eclipse.tycho.core.shared.ProxyServiceFacade'

Our Jenkins has a Maven/Tycho build using Java8 that worked perfectly in February, but stopped working now in April. (Since it was not run during this interval, I'm not sure when it stopped working exactly.)
The exception that gets thrown right after downloading the p2 repositories (or maybe right in the middle) is:
[WARNING] Error initializing: org.eclipse.tycho.p2.resolver.P2DependencyResolver#18bef28
java.lang.RuntimeException: java.lang.IllegalStateException: Service is not registered class='interface org.eclipse.tycho.core.shared.ProxyServiceFacade'
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.checkStarted (DefaultEquinoxEmbedder.java:312)
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.getService (DefaultEquinoxEmbedder.java:286)
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.getService (DefaultEquinoxEmbedder.java:281)
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.initialize (P2DependencyResolver.java:429)
Caused by: java.lang.IllegalStateException: Service is not registered class='interface org.eclipse.tycho.core.shared.ProxyServiceFacade'
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.getService (DefaultEquinoxEmbedder.java:302)
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.getService (DefaultEquinoxEmbedder.java:281)
at org.eclipse.tycho.osgi.configuration.OSGiProxyConfigurator.afterFrameworkStarted (OSGiProxyConfigurator.java:41)
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.doStart (DefaultEquinoxEmbedder.java:185)
...and...
[WARNING] Error injecting: org.eclipse.tycho.p2.resolver.P2DependencyResolver
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error notifying InjectionListener org.eclipse.sisu.plexus.PlexusBeanBinder#1b6fe69 of org.eclipse.tycho.p2.resolver.P2DependencyResolver.
Reason: java.lang.RuntimeException: java.lang.IllegalStateException: Service is not registered class='interface org.eclipse.tycho.core.shared.ProxyServiceFacade'
while locating org.eclipse.tycho.p2.resolver.P2DependencyResolver
1 error
at com.google.inject.internal.InternalProvisionException.toProvisionException (InternalProvisionException.java:226)
at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1053)
at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1086)
at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
...and of course...
[ERROR] Internal error: java.lang.RuntimeException: Could not instantiate required component: com.google.inject.ProvisionException: Unable to provision, see the following errors:
[ERROR]
[ERROR] 1) Error notifying InjectionListener org.eclipse.sisu.plexus.PlexusBeanBinder#1b6fe69 of org.eclipse.tycho.p2.resolver.P2DependencyResolver.
[ERROR] Reason: java.lang.RuntimeException: java.lang.IllegalStateException: Service is not registered class='interface org.eclipse.tycho.core.shared.ProxyServiceFacade'
[ERROR] while locating org.eclipse.tycho.p2.resolver.P2DependencyResolver
[ERROR] at ClassRealm[extension>org.eclipse.tycho:tycho-maven-plugin:1.3.0, parent: sun.misc.Launcher$AppClassLoader#647e05] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule)
[ERROR] while locating org.eclipse.tycho.core.DependencyResolver annotated with #com.google.inject.name.Named(value=p2)
[ERROR]
[ERROR] 1 error
[ERROR] role: org.eclipse.tycho.core.DependencyResolver
[ERROR] roleHint: p2
[ERROR] -> [Help 1]
My first thought was that Maven takes new releases of it's plug-ins, but there are no versions missing in the pom.xml and Maven does not warn about it either.
I tried updating from Tycho 0.22 to 0.26 to 1.3, but neither version worked.
I tried running the build with Maven 3.0 and 3.6, but neither worked.
I tried Java 8 with 32bit and 64bit, and Java 11.
Now I have no idea where to even start to search for the source of the problem. Can anyone shed some light on this?
(If you need some more information, just ask. The files are pretty long, so I'd rather not copy all of them into this question before narrowing down where the problem might be.)
It helped for me to clean local maven repository.
Normally its located in <User-home>/.m2
HTH
I think I have similar setup as yours: An Eclipse RCP project which should be build on Jenkins in a Docker container by Maven/Tycho.
The following issue gave me a hint in the right direction: https://bugs.eclipse.org/bugs/show_bug.cgi?id=552877
When I ran Maven with -X I got the following debug-output:
[DEBUG] Using local repository at ?/.m2/repository
This led me to the following question: Why does maven use "?" as my home directory
But additionally to the -s argument I also needed to set the user.home parameter explicitly. (But that is probably only needed because I have not set the local repository location in the settings.xml)
This finally results in this Maven call: mvn -B clean verify --fail-at-end -s /some/folder/settings.xml -Duser.home=/another/folder

Hudson + Jboss AS 7.1 + Maven 3 Project Build Error

I've wanted to prepare an environment that I'm able to build my project and run my tests on a integration server. So I've installed an Jboss application server 7.1 and deployed hudson.war to it. Then I've created a project to trigger "mvn clean install" and when I built it I've got following exception.
[INFO] Using bundled Maven 3 installation
[INFO] Checking Maven 3 installation environment
[workspace] $ /disk7/hudson_home/maven/slavebundle/bundled-maven/bin/mvn --help
[INFO] Checking Maven 3 installation version
[INFO] Detected Maven 3 installation version: 3.0.3
[workspace] $ /disk7/hudson_home/maven/slavebundle/bundled-maven/bin/mvn clean install -V -B -Dmaven.ext.class.path=/disk7/hudson_home/maven/slavebundle/resources:/disk7/hudson_home/maven/slavebundle/lib/maven3-eventspy-3.0.jar:/disk7/jboss-as-7.1.0.Final/standalone/tmp/vfs/deploymentdf2a6dfa59ee3407/hudson-remoting-2.2.0.jar-407215e5de02980f/contents -Dhudson.eventspy.port=37183 -f pom.xml
[DEBUG] Waiting for connection on port: 37183
Apache Maven 3.0.3 (r1075438; 2011-02-28 19:31:09+0200)
Maven home: /disk7/hudson_home/maven/slavebundle/bundled-maven
Java version: 1.7.0_04, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk1.7.0_04/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-24-generic", arch: "amd64", family: "unix"
[ERROR] o.h.m.e.DelegatingEventSpy - Init failed
java.lang.NoClassDefFoundError: hudson/remoting/Channel
at org.hudsonci.maven.eventspy.common.RemotingClient.open(RemotingClient.java:103) ~[maven3-eventspy-runtime.jar:na]
at org.hudsonci.maven.eventspy_30.RemotingEventSpy.openChannel(RemotingEventSpy.java:86) ~[maven3-eventspy-3.0.jar:na]
at org.hudsonci.maven.eventspy_30.RemotingEventSpy.init(RemotingEventSpy.java:114) ~[maven3-eventspy-3.0.jar:na]
at org.hudsonci.maven.eventspy_30.DelegatingEventSpy.init(DelegatingEventSpy.java:128) ~[maven3-eventspy-3.0.jar:na]
at org.apache.maven.eventspy.internal.EventSpyDispatcher.init(EventSpyDispatcher.java:84) [maven-core-3.0.3.jar:3.0.3]
at org.apache.maven.cli.MavenCli.container(MavenCli.java:403) [maven-embedder-3.0.3.jar:3.0.3]
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:191) [maven-embedder-3.0.3.jar:3.0.3]
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) [maven-embedder-3.0.3.jar:3.0.3]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_04]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_04]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_04]
at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_04]
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) [plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) [plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) [plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) [plexus-classworlds-2.4.jar:na]
Caused by: java.lang.ClassNotFoundException: hudson.remoting.Channel
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) ~[plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244) ~[plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230) ~[plexus-classworlds-2.4.jar:na]
... 16 common frames omitted
[ERROR] ABORTED
[ERROR] Failed to initialize
[ERROR] Caused by: hudson/remoting/Channel
[ERROR] Caused by: hudson.remoting.Channel
[ERROR] Failure: java.net.SocketException: Connection reset
FATAL: Connection reset
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:189)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
at hudson.remoting.Channel.<init>(Channel.java:385)
at hudson.remoting.Channel.<init>(Channel.java:347)
at hudson.remoting.Channel.<init>(Channel.java:320)
at hudson.remoting.Channel.<init>(Channel.java:315)
at hudson.slaves.Channels$1.<init>(Channels.java:71)
at hudson.slaves.Channels.forProcess(Channels.java:71)
at org.hudsonci.maven.plugin.builder.internal.PerformBuild.doExecute(PerformBuild.java:174)
at org.hudsonci.utils.tasks.PerformOperation.execute(PerformOperation.java:58)
at org.hudsonci.maven.plugin.builder.MavenBuilder.perform(MavenBuilder.java:169)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:630)
at hudson.model.Build$RunnerImpl.build(Build.java:175)
at hudson.model.Build$RunnerImpl.doRun(Build.java:137)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:429)
at hudson.model.Run.run(Run.java:1366)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:145)
I want to point out the command which is tried to execute by hudson :
/disk7/hudson_home/maven/slavebundle/bundled-maven/bin/mvn clean install -V -B -Dmaven.ext.class.path=/disk7/hudson_home/maven/slavebundle/resources:/disk7/hudson_home/maven/slavebundle/lib/maven3-eventspy-3.0.jar:/disk7/jboss-as-7.1.0.Final/standalone/tmp/vfs/deploymentdf2a6dfa59ee3407/hudson-remoting-2.2.0.jar-407215e5de02980f/contents -Dhudson.eventspy.port=37183 -f pom.xml
It tries to find "hudson-remoting-2.2.0.jar" to put it to build path but it searches it at the wrong place because when I look where the hudson-remoting jar I found it at /disk7/jboss-as-7.1.0.Final/standalone/tmp/vfs/deploymentdf2a6dfa59ee3407/hudson-remoting-2.2.0.jar-407215e5de02980f/hudson-remoting-2.2.0.jar for this build(not in contents).
So how can I configure the hudson to force it looking at the right place for jars? Is there anyone has an idea?
Thanks in advance.
I upgrade for jboss 7 and face same problem (in jboss 6 hudson works fine). Workaround... not appropriate, but works fine. Extract hudson-remoting-2.2.0.jar in directory slavebundle/resources. I'm waiting for new version of jboss or hudson.

Resources