I'm new to Java & in a project trying to run
mvn clean install
command to build the project but facing some issue. Saw some previous solutions but didn't work for me. I've checked for Java version & maven version. They look same to me. Any idea what could be the issue?
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Failure executing javac, but could not parse the error:
/bin/sh: /bin/javac: No such file or directory
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.136 s
[INFO] Finished at: 2021-12-03T00:43:04+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project My_Project: Compilation failure
[ERROR] Failure executing javac, but could not parse the error:
[ERROR] /bin/sh: /bin/javac: No such file or directory
[ERROR]
[ERROR]
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project My_Project: Compilation failure
Failure executing javac, but could not parse the error:
/bin/sh: /bin/javac: No such file or directory
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
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:305)
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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
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:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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: org.apache.maven.plugin.CompilationFailureException: Compilation failure
Failure executing javac, but could not parse the error:
/bin/sh: /bin/javac: No such file or directory
at org.apache.maven.plugin.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:656)
at org.apache.maven.plugin.CompilerMojo.execute (CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
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:305)
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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
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:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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)
Following are the results for java -version & mvn -version
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.6+10, mixed mode)
Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T20:36:16+05:30)
Maven home: /Users/saswal/.asdf/installs/maven/3.6.2
Java version: 11.0.6, vendor: AdoptOpenJDK, runtime: /Users/saswal/.asdf/installs/java/adoptopenjdk-11.0.6+10.1
Default locale: en_IN, platform encoding: US-ASCII
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"
pom.xml looks like this
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<service-framework-java.version>1.82</service-framework-java.version>
<elasticsearch-version>7.4.2</elasticsearch-version>
<elasticsearch-common.version>8.1.1</elasticsearch-common.version>
<elasticsearch-event-common.version>3.1.9</elasticsearch-event-common.version>
<proposal-search-consumer-shared.version>2.2.36-java8-1</proposal-search-consumer-shared.version>
<logic-domain-entities.version>4.1.14.1</logic-domain-entities.version>
<common-dropwizard.version>13.0.6</common-dropwizard.version>
</properties>
<dependencies>
Thanks in advance.
please check and follow the steps in Eclipse/STS
:- Window --> Preference --> Installed JREs -->Change path of JRE to JDK(add).
then mvn clean install
change java.version>1.82 to respective version as well
Related
When I run mvn clean install on my maven project, It is giving me the below error
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) # commons ---
[DEBUG] Dependency collection stats {ConflictMarker.analyzeTime=6375, ConflictMarker.markTime=11066, ConflictMarker.nodeCount=1, ConflictIdSorter.graphTime=2217, ConflictIdSorter.topsortTime=5579, ConflictIdSorter.conflictIdCount=1, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=36123, ConflictResolver.conflictItemCount=1, DefaultDependencyCollector.collectTime=1274402, DefaultDependencyCollector.transformTime=94657}
[DEBUG] org.apache.maven.plugins:maven-jar-plugin:jar:3.2.0
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.1:runtime
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-jar-plugin:3.2.0
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-jar-plugin:3.2.0
[DEBUG] Imported: < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-jar-plugin:3.2.0
[DEBUG] Included: org.apache.maven.plugins:maven-jar-plugin:jar:3.2.0
[DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:1.1
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-jar-plugin:3.2.0, parent: jdk.internal.loader.ClassLoaders$AppClassLoader#4b85612c]
[WARNING] Error injecting: org.apache.maven.plugins.jar.JarMojo
java.lang.NoClassDefFoundError: Lorg/apache/maven/archiver/MavenArchiveConfiguration;
at java.lang.Class.getDeclaredFields0 (Native Method)
at java.lang.Class.privateGetDeclaredFields (Class.java:3061)
at java.lang.Class.getDeclaredFields (Class.java:2248)
at com.google.inject.spi.InjectionPoint.getDeclaredFields (InjectionPoint.java:760)
at com.google.inject.spi.InjectionPoint.getInjectionPoints (InjectionPoint.java:670)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields (InjectionPoint.java:378)
at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies (ConstructorBindingImpl.java:182)
at com.google.inject.internal.InjectorImpl.getInternalDependencies (InjectorImpl.java:661)
at com.google.inject.internal.InjectorImpl.cleanup (InjectorImpl.java:617)
at com.google.inject.internal.InjectorImpl.initializeJitBinding (InjectorImpl.java:603)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding (InjectorImpl.java:932)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive (InjectorImpl.java:852)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding (InjectorImpl.java:291)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow (InjectorImpl.java:222)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow (InjectorImpl.java:1040)
at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1071)
at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1034)
at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1086)
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 com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:127)
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.InjectorImpl$1.get (InjectorImpl.java:1050)
at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:520)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:124)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
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:305)
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:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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.ClassNotFoundException: org.apache.maven.archiver.MavenArchiveConfiguration
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
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 java.lang.Class.getDeclaredFields0 (Native Method)
at java.lang.Class.privateGetDeclaredFields (Class.java:3061)
at java.lang.Class.getDeclaredFields (Class.java:2248)
at com.google.inject.spi.InjectionPoint.getDeclaredFields (InjectionPoint.java:760)
at com.google.inject.spi.InjectionPoint.getInjectionPoints (InjectionPoint.java:670)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields (InjectionPoint.java:378)
at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies (ConstructorBindingImpl.java:182)
at com.google.inject.internal.InjectorImpl.getInternalDependencies (InjectorImpl.java:661)
at com.google.inject.internal.InjectorImpl.cleanup (InjectorImpl.java:617)
at com.google.inject.internal.InjectorImpl.initializeJitBinding (InjectorImpl.java:603)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding (InjectorImpl.java:932)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive (InjectorImpl.java:852)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding (InjectorImpl.java:291)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow (InjectorImpl.java:222)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow (InjectorImpl.java:1040)
at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1071)
at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1034)
at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1086)
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 com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:127)
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.InjectorImpl$1.get (InjectorImpl.java:1050)
at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:520)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:124)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
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:305)
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:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.532 s
[INFO] Finished at: 2022-08-11T16:02:56+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar (default-jar) on project commons: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar failed: A required class was missing while executing org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar: Lorg/apache/maven/archiver/MavenArchiveConfiguration;
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-jar-plugin:3.2.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/abdul/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/3.2.0/maven-jar-plugin-3.2.0.jar
[ERROR] urls[1] = file:/Users/abdul/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : org.apache.maven.archiver.MavenArchiveConfiguration
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar (default-jar) on project commons: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar failed: A required class was missing while executing org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar: Lorg/apache/maven/archiver/MavenArchiveConfiguration;
-----------------------------------------------------
realm = plugin>org.apache.maven.plugins:maven-jar-plugin:3.2.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/Users/abdul/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/3.2.0/maven-jar-plugin-3.2.0.jar
urls[1] = file:/Users/abdul/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]
-----------------------------------------------------
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
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:305)
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:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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: org.apache.maven.plugin.PluginExecutionException: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar failed: A required class was missing while executing org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar: Lorg/apache/maven/archiver/MavenArchiveConfiguration;
-----------------------------------------------------
realm = plugin>org.apache.maven.plugins:maven-jar-plugin:3.2.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/Users/abdul/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/3.2.0/maven-jar-plugin-3.2.0.jar
urls[1] = file:/Users/abdul/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar (default-jar) on project commons: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar failed: A required class was missing while executing org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar: Lorg/apache/maven/archiver/MavenArchiveConfiguration;
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-jar-plugin:3.2.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/abdul/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/3.2.0/maven-jar-plugin-3.2.0.jar
[ERROR] urls[1] = file:/Users/abdul/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
My pom.xml Have
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
// dependencies section here
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
mvn -v output
Apache Maven 3.8.4
Maven home: /Users/abdul/apache-maven-3.8.4
Java version: 11.0.13, vendor: Oracle Corporation, runtime: /Users/abdul/jdk-11.0.13.jdk/Contents/Home
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "11.5", arch: "x86_64", family: "mac"
java -version output
java version "11.0.13" 2021-10-19 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.13+10-LTS-370)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.13+10-LTS-370, mixed mode)
You can run the maven build command with argument -X to enable debug logging.
Normally the class MavenArchiveConfiguration is loaded from maven-archiver, which is a dependency of the maven-jar-plugin. These dependencies are managed in the plugins' pom file, and loaded by the maven build process from that pom.
When i locally modify the pom file for this plugin (remove all dependencies) then i can reproduce this error message. This leads me to believe there is something wrong with your downloaded copy.
As a solution you can remove the contents of .m2\repository\org\apache\maven\plugins\ and .m2\repository\org\apache\maven\maven-archiver and try your build again, then all correct plugin files and dependencies should be downloaded again from maven central.
Then you should find the jar+pom files for the plugin + dependency in your local .m2 folder: .m2\repository\org\apache\maven\plugins\maven-jar-plugin\3.2.0 and .m2\repository\org\apache\maven\maven-archiver\3.5.0. You can also look in those folders for the _remote.repositories file to check for any download issues.
You can also check if you have any custom pluginRepositories configured that may be providing you with corrupt jar/pom files. You can see your entire pom file by running mvn help:effective-pom.
Normally that should include the following from the super pom:
<pluginRepositories>
<pluginRepository>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</pluginRepository>
</pluginRepositories>
More extreme measures could be to download a newer version of maven, or clear your entire local .m2 (create a backup if you have important files in there).
Those would be the places to look to resolve this issue.
When I run my code with NetBans on Windows it works fine but on ubnutu 20.04.2 LTE it shows me that:
cd /home/sulayman/NetBeansProjects/Clases; JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 /snap/netbeans/41/netbeans/java/maven/bin/mvn "-Dexec.args=-classpath %classpath clases.Clases" -Dexec.executable=/usr/lib/jvm/java-11-openjdk-amd64/bin/java org.codehaus.mojo:exec-maven-plugin:3.0.0:exec
Running NetBeans Compile On Save execution. Phase execution is skipped and output directories of dependency projects (with Compile on Save turned on) will be used instead of their jar artifacts.
Scanning for projects...
------------------------< com.mycompany:Clases >------------------------
Building Clases 1.0-SNAPSHOT
--------------------------------[ jar ]---------------------------------
--- exec-maven-plugin:3.0.0:exec (default-cli) # Clases ---
Error: Se ha producido un error de enlace al cargar la clase principal clases.Clases
java.lang.UnsupportedClassVersionError: clases/Clases has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:982)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:929)
at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:457)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
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:305)
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:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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)
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 1.707 s
Finished at: 2021-02-28T14:01:07+01:00
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project Clases: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
This
java.lang.UnsupportedClassVersionError: clases/Clases has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 55.0
is the reason.
You are trying to run classes that have been compiled for Java 15, but you are trying to use/compile them with Java 11
You either need to recompile those classes with Java 11, or use Java 15 on your Ubuntu computer
I'm trying to execute the Dataflow template named PubSubToBigQuery.java at a VM instance (OS: "linux", version: "4.9.0-11-amd64", Distributor: Debian GNU/Linux 9.11 (stretch)) to take input messages from a Pub/Sub subscription and write them in a BigQuery table (without modifying the template for the moment). In order to do this I cloned the GitHub DataflowTemplates repo into my Cloud Shell in the $HOME/opt/ directory. Following the README document I've installed Java 8 and Maven 3:
Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00) Maven home: /opt/maven
Java version: 1.8.0_232, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.9.0-11-amd64", arch: "amd64", family: "unix"
After building the entire project, this is what I'm trying to execute from the comand line to compile the code:
sudo mvn -X compile exec:java -Dexec.mainClass=com.google.cloud.teleport.templates.PubSubToBigQuery -
Dexec.cleanupDaemonThreads=false -Dexec.args=" --project=real-demand --
stagingLocation=gs://rd_pubsub/staging --streaming=true"
And this is the error I'm getting:
[WARNING]
java.lang.ClassNotFoundException: com.google.cloud.teleport.templates.PubSubToBigQuery.java
at java.net.URLClassLoader.findClass (URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass (ClassLoader.java:424)
at java.lang.ClassLoader.loadClass (ClassLoader.java:357)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:270)
at java.lang.Thread.run (Thread.java:748)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:21 min
[INFO] Finished at: 2019-11-26T10:47:57Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project google-cloud-teleport-java: An exception occured while executing the Java class. com.google.cloud.teleport.templates.PubSubToBigQuery.java -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project google-cloud-teleport-java: An exception occured while executing the Java class. com.google.cloud.teleport.templates.PubSubToBigQuery.java
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
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:305)
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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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: org.apache.maven.plugin.MojoExecutionException: An exception occured while executing the Java class. com.google.cloud.teleport.templates.PubSubToBigQuery.java
at org.codehaus.mojo.exec.ExecJavaMojo.execute (ExecJavaMojo.java:339)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
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:305)
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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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.ClassNotFoundException: com.google.cloud.teleport.templates.PubSubToBigQuery.java
at java.net.URLClassLoader.findClass (URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass (ClassLoader.java:424)
at java.lang.ClassLoader.loadClass (ClassLoader.java:357)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:270)
at java.lang.Thread.run (Thread.java:748)
[ERROR]
[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/MojoExecutionException
Following this post or this discussion discussion I've also added this piece of XML in pom.xml:
<properties>
<testNgMainClass>defaultMainClass</testNgMainClass>
<args>defaultArgs</args>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<configuration>
<classpathScope>test</classpathScope>
<mainClass>${testNgMainClass}</mainClass>
<arguments>${args}</arguments>
</configuration>
<executions>
<execution>
<id>run-selenium</id>
<phase>integration-test</phase>
<goals><goal>java</goal></goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
But it's still not working.
I can see that you are not specifying all the parameters needed to execute the template and as you mentioned, you are not modifying the file.
inputTopic=projects/${PROJECT_ID}/topics/input-topic-name
outputTableSpec=${PROJECT_ID}:dataset-id.output-table
outputDeadletterTable=${PROJECT_ID}:dataset-id.deadletter-table
The command should look like this:
mvn compile exec:java -Dexec.mainClass=com.google.cloud.teleport.templates.PubSubToBigQuery -Dexec.cleanupDaemonThreads=false \
-Dexec.args=" --project=PROJECT_ID \
--stagingLocation=gs://bucket-name/dataflow \
--streaming=true \
--inputTopic=projects/PROJECT_ID/topics/input-topic-name \
--outputTableSpec=PROJECT_ID:dataset-id.deadletter-table \
--outputDeadletterTable=PROJECT_ID:dataset-id.deadletter-table"
On the other hand, I recommend to deploy the template into GCP and execute using the gcloud command, follow the instructions given within the PubSubToBigQuery.java file
To clone, compile and run a Dataflow Template is necessary enable all the necessary APIs in your GCP project:
Dataflow
Compute Engine
Stackdriver Logging
Cloud Storage
Cloud Storage JSON
BigQuery
PubSub
In order to do that you can click in this helper link:
https://console.cloud.google.com/flows/enableapi?apiid=dataflow,compute_component,logging,storage_component,storage_api,bigquery,pubsub
I tried to generate Jacoco reports for Sonarqube. Generating the file jacoco.exec works but using it for Sonarqube OR in Eclipse's EclEmma results in an EOFException (so both implementations are crappy or the generated file is the problem). There are some questions about this problem but no solution (besides not using test coverage).
I created a Spring Boot application and tried to generate a Jacoco test coverage report with Maven. There is no problem in using mvn test and a jacoco.exec gets generated in the target folder. But when I try to upload the results to Sonarqube with mvn sonar:sonar I always get this error:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project project-name: Unable to read XXX\project-name\target\jacoco.exec: EOFException -> [Help 1]
pom.xml
<build>
...
<plugins>
...
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Stacktrace:
$ mvn sonar:sonar -Dsonar.projectKey=... -Dsonar.host.url=... -Dsonar.login=... -eX
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: windows
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 6.1
[INFO] os.detected.version.major: 6
[INFO] os.detected.version.minor: 1
[INFO] os.detected.classifier: windows-x86_64
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failure to find org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 in NEXUS-URL/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of corporate has elapsed or updates are forced
[INFO]
[INFO] --------------< project-name >--------------
[INFO] Building project-name 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failure to find org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 in NEXUS-URL/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of corporate has elapsed or updates are forced
[INFO]
[INFO] --- sonar-maven-plugin:3.7.0.1746:sonar (default-cli) # project-name ---
[INFO] User cache: C:\Entwicklung\.sonar\cache
[INFO] SonarQube version: 8.0.0
[INFO] Default locale: "de_DE", source code encoding: "UTF-8"
[WARNING] SonarScanner will require Java 11+ to run starting in SonarQube 8.x
[INFO] Load global settings
[INFO] Load global settings (done) | time=85ms
[INFO] Server id: BF41A1F2-AW34YlpIvdDiua-FIR0_
[INFO] User cache: C:\Entwicklung\.sonar\cache
[INFO] Load/download plugins
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=53ms
[INFO] Load/download plugins (done) | time=96ms
[INFO] Process project properties
[INFO] Process project properties (done) | time=13ms
[INFO] Execute project builders
[INFO] Execute project builders (done) | time=4ms
[INFO] Project key: project-name
[INFO] Base dir: XXX\project-name
[INFO] Working dir: XXX\project-name\target\sonar
[INFO] Load project settings for component key: 'project-name'
[INFO] Load project settings for component key: 'project-name' (done) | time=19ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=275ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=2214ms
[INFO] Indexing files...
[INFO] Project configuration:
[INFO] 25 files indexed
[INFO] 0 files ignored because of scm ignore settings
[INFO] Quality profile for java: Sonar way
[INFO] Quality profile for xml: Sonar way
[INFO] ------------- Run sensors on module project-name
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=60ms
[INFO] Sensor JavaSquidSensor [java]
[INFO] Configured Java source version (sonar.java.source): 8
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=31ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=23ms
[INFO] Java Main Files AST scan
[INFO] 23 source files to be analyzed
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=21ms
[INFO] Java Main Files AST scan (done) | time=4614ms
[INFO] Java Test Files AST scan
[INFO] 1 source files to be analyzed
[INFO] 23/23 source files have been analyzed
[INFO] 1/1 source files have been analyzed
[INFO] Java Test Files AST scan (done) | time=1484ms
[INFO] Sensor JavaSquidSensor [java] (done) | time=7085ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=4ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [XXX\project-name\target\surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=75ms
[INFO] Sensor JaCoCoSensor [java]
[WARNING] Property 'sonar.jacoco.reportPaths' is deprecated (JaCoCo binary format). 'sonar.coverage.jacoco.xmlReportPaths' should be used instead (JaCoCo XML format). Please check that the JaCoCo plugin is installed on your SonarQube Instance.
[INFO] Analysing XXX\project-name\target\jacoco.exec
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Skipping project-name
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.163 s
[INFO] Finished at: 2019-10-24T11:04:54+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project project-name: Unable to read XXX\project-name\target\jacoco.exec: EOFException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project project-name: Unable to read XXX\project-name\target\jacoco.exec
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
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:305)
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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to read XXX\project-name\target\jacoco.exec
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:67)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
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:305)
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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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)
Caused by: org.sonar.java.AnalysisException: Unable to read XXX\project-name\target\jacoco.exec
at org.sonar.plugins.jacoco.JacocoReportReader.readJacocoReport (JacocoReportReader.java:72)
at org.sonar.plugins.jacoco.UnitTestAnalyzer.readExecutionData (UnitTestAnalyzer.java:129)
at org.sonar.plugins.jacoco.UnitTestAnalyzer.analyse (UnitTestAnalyzer.java:102)
at org.sonar.plugins.jacoco.JaCoCoSensor.execute (JaCoCoSensor.java:94)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse (AbstractSensorWrapper.java:48)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1 (ModuleSensorsExecutor.java:59)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy (ModuleSensorsExecutor.java:77)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:59)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart (ModuleScanContainer.java:82)
at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
at org.sonar.scanner.scan.ProjectScanContainer.scan (ProjectScanContainer.java:387)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:383)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:346)
at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:141)
at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
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.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy24.execute (Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:138)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
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:305)
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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte (DataInputStream.java:267)
at org.jacoco.core.internal.data.CompactDataInput.readBooleanArray (CompactDataInput.java:63)
at org.jacoco.core.data.ExecutionDataReader.readExecutionData (ExecutionDataReader.java:149)
at org.jacoco.core.data.ExecutionDataReader.readBlock (ExecutionDataReader.java:115)
at org.jacoco.core.data.ExecutionDataReader.read (ExecutionDataReader.java:92)
at org.sonar.plugins.jacoco.JacocoReportReader.readJacocoReport (JacocoReportReader.java:70)
at org.sonar.plugins.jacoco.UnitTestAnalyzer.readExecutionData (UnitTestAnalyzer.java:129)
at org.sonar.plugins.jacoco.UnitTestAnalyzer.analyse (UnitTestAnalyzer.java:102)
at org.sonar.plugins.jacoco.JaCoCoSensor.execute (JaCoCoSensor.java:94)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse (AbstractSensorWrapper.java:48)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1 (ModuleSensorsExecutor.java:59)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy (ModuleSensorsExecutor.java:77)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:59)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart (ModuleScanContainer.java:82)
at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
at org.sonar.scanner.scan.ProjectScanContainer.scan (ProjectScanContainer.java:387)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:383)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:346)
at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:141)
at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
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.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy24.execute (Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:138)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
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:305)
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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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)
[ERROR]
[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/MojoExecutionException
I'm using Jacoco 0.8.5, Sonarqube 8 and Spring Boot 2.1.5.RELEASE on Windows 7.
Update:
One of my colleagues was able without any adjustments to do the Maven build. We had the same Java version and same Maven version. I still don't know the problem and I'm more confused than ever. The only main difference was his OS because he was using Windows 10.
According to the following GitHub answer https://github.com/jacoco/jacoco/issues/980#issuecomment-563091107
the exec binary file was truncated due to the JVM shutdown not gracefully executed, meaning JaCoCO exec binary file is corrupted.
To resolve this exception make sure you shutdown the JVM gracefully i.e. by invoking the JVM shutdown hook.
If you're concerned about your tests terminating properly, move all your tests except the simplest (such as one against a class that simply manipulates a list or produces random numbers) into a temporary directory outside of your test source code structure. Verify that you're still getting the error.
If they're now succeeding, re-introduce the risky ones back into your test directory tree piece-meal until it fails again. Solution by isolation.
Alternatively, and this took too much time to discover, it could be that JaCoCo is failing to generate the dump file (jacoco.exec) in a timely manner.
Project tools: Maven 3.8.6, JDK 11, yes, I'm using JPMS, Surefire-plugin 2.22.2, JaCoCo-plugin 0.8.8, JUnit 5.9.1.
I have only 750 lines of production code in my project, only 10 external dependencies -- it's a very small project and it was timing out. I thought my configuration was wrong all this time, but Maven was killing the JaCoCo process (forked from Surefire) that creates the dump file before it finished. EOFException? Absolutely! I changed my pom to the following:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
...
<forkedProcessExitTimeoutInSeconds>240</forkedProcessExitTimeoutInSeconds>
</configuration>
<plugin>
</plugins>
</build>
Adding 4 minutes to allow the generator to create the dump file fixed it for me. There's got to be a better way. Sadly, as my project grows, I'll have to keep increasing this number. But at least I have coverage reports now.
Maven configuration failed this line just ruined my Friday night and still i am unable to solve it.
Well,I am a big fan of visual studio code so i just decided to switch on vscode to eclipse for java development. but this is not the problem,Problem raise when i just try to add an external java library.I am unable to use it and i just get an error something like Class-not-Found or so on.
Well,this is my project structure in vscode
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project in.blackpaper.topdf: Compilation failure
This is error message which i get while install mvn plugin.
mvn clean install
[DEBUG] incrementalBuildHelper#beforeRebuildExecution
[INFO] Compiling 1 source file to E:\Documents\Java\in.blackpaper.topdf\target\classes
[DEBUG] incrementalBuildHelper#afterRebuildExecution
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.086 s
[INFO] Finished at: 2018-04-17T11:23:29+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project in.blackpaper.topdf: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR]
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project in.blackpaper.topdf: Compilation failure
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
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:305)
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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
at java.lang.reflect.Method.invoke (Unknown Source)
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)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1161)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
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:305)
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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
at java.lang.reflect.Method.invoke (Unknown Source)
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)
[ERROR]
[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/MojoFailureException
Well,i also try to solve my problem with vscode developers but still i can't solve it.
This is the issue i raised in vscode-github
vscode-java/issue#509
Well,my problem is different from all the previously asked questions about maven-plugins and I tried all available solution but unable to get the point.
Thanks in advance.
The Java installation you're using is not a Java Development Kit (you can understand the difference by looking at this question).
To solve your problem, download and install the JDK (such as from here, or from here, depending on the version you prefer), if you haven't installed it already. After installing and/or extracting (if you're on linix, better done in an init script):
export JAVA_HOME=<path_to_the_extracted_jdk_directory>
On Windows, create an environment variable named JAVA_HOME, with a value set to the full path to the installation directory.
To verify that Maven picks up the correct Java installation, you can try
mvn -version
The output includes a line for the Java installation Maven is seeing, such as:
...Maven home: [path to maven]
Java version: 1.8.0_152, vendor: Oracle Corporation
Java home: /home/user/jdk/jdk1.8.0_152/jre
...
Please check the terminal, the process holds the lock. So the application files are still used by somewhere. So first we need to stop the process, then start your task it will work.