Maven with Spark, Error message by the Java execution - maven

I use Eclipse to run my Spark code and use tool Maven in Eclipse to build the dependencies.
Currently I have the situation, when I have to run my code not from Eclipse platform, but from console (bash). I upload and install Maven local on my machine and was playing with the different simple examples. My Maven folder is in Downloads repository. All standard examples are going very well, I have got a right output. All introductions I have found on this site.
Now I want also execute a spark code. After I have placed my Java file with the spark code in the directory, where I have other files, and updated pom.xml, I couldn't build my jar file. I have got the next error:
user#user-HP-ProBook-6570b:~/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app$ mvn package -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Test 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) # CTI ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) # CTI ---
[INFO] Compiling 1 source file to /home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.728s
[INFO] Finished at: Mon Oct 26 15:18:52 CET 2015
[INFO] Final Memory: 14M/167M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project CTI: Compilation failure
[ERROR] /home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11] error: generics are not supported in -source 1.3
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project CTI: Compilation failure
/home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11] error: generics are not supported in -source 1.3
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
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:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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.CompilationFailureException: Compilation failure
/home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11] error: generics are not supported in -source 1.3
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[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/MojoFailureException
How I understand, is everything wrong with my Spark version. I use currently spark 1.4.0 version. I also post my pom.xml file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Prototype</groupId>
<artifactId>CTI</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Test</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency> <!-- Spark dependency -->
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>1.4.0</version>
</dependency>
</dependencies>
</project>
Regarding the documentation in the link at the bottom of error message it is not a error of maven, but something wrong is with plugin.

According to you error log, you need to set your java compiler version in maven to the corresponding java version you are using (1.7 or 1.8). It seems that your maven is using a old version of Java (1.3)
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
This is the line that gave the error up :
spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11] error: generics are not supported in -source 1.3

Related

Maven: compile OK, package OK, compile + package fails

I have a desktop Java project using Dagger2 and building with Maven. I can't run compile and package sequentially. This works:
$ mvn clean
$ mvn compile
And this works, producing an executable jar that runs without error:
$ mvn clean
$ mvn package
But this fails:
$ mvn clean
$ mvn compile
$ mvn package
When package gets to the module that uses Dagger2, it outputs:
[INFO] Changes detected - recompiling the module!
The error from mvn -e package is:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project weapon: Compilation failure -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project weapon: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
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: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.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:915)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
The module has this dependency:
<dependency>
<groupId>com.google.dagger</groupId>
<artifactId>dagger</artifactId>
<version>2.1</version>
<scope>compile</scope>
</dependency>
The module uses compiler plugin version 3.3 like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.google.dagger</groupId>
<artifactId>dagger-compiler</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
<configuration>
<source>1.7</source>
<target>1.7</target>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
</configuration>
</plugin>
This is the only Dagger-related configuration. Why can't I run package after build?
Possibly related: I thought forceJavacCompilerUse was no longer needed, but without it, Dagger doesn't seem to run at all. I get an unknown symbol error on the generated component implementation (DaggerMyComponent).
Edit: This is the full output of mvn -e package, command prompt to command prompt:
kevin#aphrodite:~/Projects/IDEA/Dark Matter$ mvn -e package
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] parent
[INFO] weapon
[INFO] scripts
[INFO] assembly
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building parent 2.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building weapon 2.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) # weapon ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # weapon ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 8 source files to /home/kevin/Projects/IDEA/Dark Matter/weapon/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] parent ............................................ SUCCESS [0.001s]
[INFO] weapon ............................................ FAILURE [1.641s]
[INFO] scripts ........................................... SKIPPED
[INFO] assembly .......................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.735s
[INFO] Finished at: Fri Mar 11 04:32:38 MST 2016
[INFO] Final Memory: 21M/173M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project weapon: Compilation failure -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project weapon: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
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: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.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:915)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :weapon
kevin#aphrodite:~/Projects/IDEA/Dark Matter$
Edit 2: I noticed that when I run package by itself after clean, it says it's compiling 6 sources. That's how many hand-written classes are in the project. When I run compile before package, the latter says it's compiling 8 sources. It looks like when dagger-compiler runs on a clean project, it silently generates and compiles its sources. Then package sees the new sources and tries to compile them. The mystery is why it fails. Running compile twice in a row fails in the same way.
Edit 3: I tried this answer, specifying dagger.internal.codegen.ComponentProcessor as the -processor argument. Now the first time I run compile, I see the two passes where it compiles 6 files and then 8 files:
[INFO] --- maven-compiler-plugin:3.3:compile (process-annotations) # weapon ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to /home/kevin/Projects/IDEA/Dark Matter/weapon/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) # weapon ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # weapon ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 8 source files to /home/kevin/Projects/IDEA/Dark Matter/weapon/target/classes
This is expected, and this compile succeeds. But then if I run package, or compile again, it fails the same as before.
The sources Dagger produces are in /target/generated-sources/annotations. I think I need to tell Maven to do something with that path, but I don't know what. It makes sense that compile detects source changes when it is run twice in a row, though I don't know why that leads to failure. Maybe I need to run the annotation processing step conditionally, but I don't know how to do that or what the condition should be.
I managed to reproduce your problem.
The key seems to be the maven-compiler-plugin:3.3
When I run with maven-compiler-plugin:3.1, the error does not manifest.

hudson: maven-sonar-plugin execution fails to download libraries from server

I have a hudson jobs doing the sonar stats for a maven project.
The execution of the sonar plugin fails with the following trace
[workspace] $ /hudson/hudson1/hudson/tools/maven-3.0.4/bin/mvn -f /hudson/hudson1/hudson/jobs/15_20_NX_Core_Quality/workspace/pom.xml -e -B sonar:sonar -Dsonar.jdbc.password= -Dsonar.forceAnalysis=true -Dsonar.login=admin -Dsonar.password=admin -Dsonar.jdbc.driver=net.sourceforge.jtds.jdbc.Driver -Dsonar.jdbc.url=jdbc:jtds:sqlserver://VX16:1433;databaseName=Sonar2;SelectMethod=Cursor ******** -Dsonar.host.url=http://localhost:8080/sonar ******** ********
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] NX Core
[INFO] core-entity
[INFO] core-logic
[INFO] core-ui
[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: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building NX Core 1.22.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[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: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
[INFO]
[INFO] --- sonar-maven-plugin:2.7.1:sonar (default-cli) # core ---
[INFO] User cache: /home/jetty/.sonar/cache
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] NX Core ........................................... FAILURE [1.414s]
[INFO] core-entity ....................................... SKIPPED
[INFO] core-logic ........................................ SKIPPED
[INFO] core-ui ........................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.490s
[INFO] Finished at: Wed Oct 28 14:10:38 CET 2015
[INFO] Final Memory: 14M/303M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project core: Fail to download libraries from server: Status returned by url : 'http://localhost:8080/sonar/batch_bootstrap/index' is invalid : 404 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project core: Fail to download libraries from server
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
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:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fail to download libraries from server
at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:104)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:135)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.IllegalStateException: Fail to download libraries from server
at org.sonar.runner.impl.Jars.dowloadFiles(Jars.java:94)
at org.sonar.runner.impl.Jars.download(Jars.java:71)
at org.sonar.runner.impl.JarDownloader.download(JarDownloader.java:40)
at org.sonar.runner.impl.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:91)
at org.sonar.runner.impl.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:87)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:87)
at org.sonar.runner.impl.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:83)
at org.sonar.runner.api.EmbeddedRunner.doStart(EmbeddedRunner.java:250)
at org.sonar.runner.api.EmbeddedRunner.start(EmbeddedRunner.java:188)
at org.sonar.runner.api.EmbeddedRunner.start(EmbeddedRunner.java:183)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:77)
... 22 more
Caused by: java.io.IOException: Status returned by url : 'http://localhost:8080/sonar/batch_bootstrap/index' is invalid : 404
at org.sonar.runner.impl.ServerConnection.downloadString(ServerConnection.java:95)
at org.sonar.runner.impl.ServerConnection.tryServerFirst(ServerConnection.java:163)
at org.sonar.runner.impl.ServerConnection.loadString(ServerConnection.java:142)
at org.sonar.runner.impl.Jars.dowloadFiles(Jars.java:79)
... 33 more
[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
Sonar analysis completed: FAILURE
Finished: FAILURE
The execution of the plugin fails since 8 days, neither the pom, nor the project changed since this point of time.
sonar system specs
System date,Wed Oct 28 14:34:36 CET 2015
JVM Vendor,Oracle Corporation
JVM Name,Java HotSpot(TM) 64-Bit Server VM
JVM Version,23.6-b04
Java Version,1.7.0_10-b18
Java Home,/usr/lib/jvm/jdk1.7.0_10/jre
JIT Compiler,-
Application Server Container,Apache Tomcat/7.0.35
User Name,tomcat7
User TimeZone,Europe/Zurich
OS,Linux / amd64 / 3.2.0-92-generic
Processors,4
System Classpath,/tomcat/tomcat7/bin/bootstrap.jar:/tomcat/tomcat7/bin/tomcat-juli.jar
Boot Classpath,/usr/lib/jvm/jdk1.7.0_10/jre/lib/resources.jar:/usr/lib/jvm/jdk1.7.0_10/jre/lib/rt.jar:/usr/lib/jvm/jdk1.7.0_10/jre/lib/sunrsasign.jar:/usr/lib/jvm/jdk1.7.0_10/jre/lib/jsse.jar:/usr/lib/jvm/jdk1.7.0_10/jre/lib/jce.jar:/usr/lib/jvm/jdk1.7.0_10/jre/lib/charsets.jar:/usr/lib/jvm/jdk1.7.0_10/jre/lib/jfr.jar:/usr/lib/jvm/jdk1.7.0_10/jre/classes
Library Path,/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Server ID,-
Version,3.4.1
Started at,Wed Oct 28 14:09:46 CET 2015
Database,Microsoft SQL Server 10.50.2500
Database URL,jdbc:jtds:sqlserver://VX16:1433/Sonar2
Database Login,sa
Database Driver,jTDS Type 4 JDBC Driver for MS SQL Server and Sybase 1.2.4
Database Driver Class,net.sourceforge.jtds.jdbc.Driver
Database Dialect (Hibernate),mssql (org.sonar.core.persistence.dialect.MsSql$MsSqlDialect)
Hibernate Default Schema,-
External User Authentication,-
Automatic User Creation,-
Allow Users to Sign Up,-
Force Authentication,-
Total Memory,445 MB
Free Memory,219 MB
Max Memory,954 MB
Heap,init = 262973312(256809K) used = 225130168(219853K) committed = 445120512(434688K) max = 954466304(932096K)
Non Heap,init = 24313856(23744K) used = 80584792(78696K) committed = 80805888(78912K) max = 136314880(133120K)
System Load Average (last minute),8.0%
Loaded Classes (currently/total/unloaded),13535 / 13535 / 0
Start Time,2015-10-28T14:09:37.964+0100
Threads (total/peak/daemon),23 / 23 / 21
Checkstyle,1.1
Cobertura,1.1
Findbugs,1.1
JaCoCo,1.1
Java,1.1
PMD,1.1
Squid for Java,1.1
Surefire,1.1
SONAR_HOME,/tomcat/sonar
awt.toolkit,sun.awt.X11.XToolkit
catalina.base,/tomcat/tomcat7
catalina.home,/tomcat/tomcat7
catalina.useNaming,true
common.loader,"${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar"
file.encoding,UTF-8
file.encoding.pkg,sun.io
file.separator,/
java.awt.graphicsenv,sun.awt.X11GraphicsEnvironment
java.awt.headless,true
java.awt.printerjob,sun.print.PSPrinterJob
java.class.path,/tomcat/tomcat7/bin/bootstrap.jar:/tomcat/tomcat7/bin/tomcat-juli.jar
java.class.version,51.0
java.endorsed.dirs,/tomcat/tomcat7/endorsed
java.ext.dirs,/usr/lib/jvm/jdk1.7.0_10/jre/lib/ext:/usr/java/packages/lib/ext
java.home,/usr/lib/jvm/jdk1.7.0_10/jre
java.io.tmpdir,/tmp/tomcat7-tmp
java.library.path,/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
java.naming.factory.initial,org.apache.naming.java.javaURLContextFactory
java.naming.factory.url.pkgs,org.apache.naming
java.runtime.name,Java(TM) SE Runtime Environment
java.runtime.version,1.7.0_10-b18
java.specification.name,Java Platform API Specification
java.specification.vendor,Oracle Corporation
java.specification.version,1.7
java.util.logging.config.file,/tomcat/tomcat7/conf/logging.properties
java.util.logging.manager,org.apache.juli.ClassLoaderLogManager
java.vendor,Oracle Corporation
java.vendor.url,http://java.oracle.com/
java.vendor.url.bug,http://bugreport.sun.com/bugreport/
java.version,1.7.0_10
java.vm.info,mixed mode
java.vm.name,Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name,Java Virtual Machine Specification
java.vm.specification.vendor,Oracle Corporation
java.vm.specification.version,1.7
java.vm.vendor,Oracle Corporation
java.vm.version,23.6-b04
jruby.management.enabled,true
line.separator,"
"
org.apache.catalina.startup.ContextConfig.jarsToSkip,""
org.apache.catalina.startup.TldConfig.jarsToSkip,""
os.arch,amd64
os.name,Linux
os.version,3.2.0-92-generic
package.access,sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper."""
package.definition,"sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper."
path.separator,:
server.loader,""
shared.loader,""
sun.arch.data.model,64
sun.boot.class.path,/usr/lib/jvm/jdk1.7.0_10/jre/lib/resources.jar:/usr/lib/jvm/jdk1.7.0_10/jre/lib/rt.jar:/usr/lib/jvm/jdk1.7.0_10/jre/lib/sunrsasign.jar:/usr/lib/jvm/jdk1.7.0_10/jre/lib/jsse.jar:/usr/lib/jvm/jdk1.7.0_10/jre/lib/jce.jar:/usr/lib/jvm/jdk1.7.0_10/jre/lib/charsets.jar:/usr/lib/jvm/jdk1.7.0_10/jre/lib/jfr.jar:/usr/lib/jvm/jdk1.7.0_10/jre/classes
sun.boot.library.path,/usr/lib/jvm/jdk1.7.0_10/jre/lib/amd64
sun.cpu.endian,little
sun.cpu.isalist,""
sun.font.fontmanager,sun.awt.X11FontManager
sun.io.unicode.encoding,UnicodeLittle
sun.java.command,org.apache.catalina.startup.Bootstrap start
sun.java.launcher,SUN_STANDARD
sun.jnu.encoding,UTF-8
sun.management.compiler,HotSpot 64-Bit Tiered Compilers
sun.os.patch.level,unknown
tomcat.util.buf.StringCache.byte.enabled,true
tomcat.util.scan.DefaultJarScanner.jarsToSkip,"bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,jasper.jar,jasper-el.jar,ecj-*.jar,tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,tomcat-jni.jar,tomcat-spdy.jar,tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,tomcat-juli-adapters.jar,catalina-jmx-remote.jar,catalina-ws.jar,tomcat-jdbc.jar,commons-beanutils*.jar,commons-codec*.jar,commons-collections*.jar,commons-dbcp*.jar,commons-digester*.jar,commons-fileupload*.jar,commons-httpclient*.jar,commons-io*.jar,commons-lang*.jar,commons-logging*.jar,commons-math*.jar,commons-pool*.jar,jstl.jar,geronimo-spec-jaxrpc*.jar,wsdl4j*.jar,ant.jar,ant-junit*.jar,aspectj*.jar,jmx.jar,h2*.jar,hibernate*.jar,httpclient*.jar,jmx-tools.jar,jta*.jar,log4j*.jar,mail*.jar,slf4j*.jar,xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,access-bridge.jar,access-bridge-64.jar,dnsns.jar,jaccess.jar,ldapsec.jar,localedata.jar,sunjce_provider.jar,sunmscapi.jar,sunpkcs11.jar,jhall.jar,tools.jar,sunec.jar,zipfs.jar,gnome-java-bridge.jar,pulse-java.jar,apple_provider.jar,AppleScriptEngine.jar,CoreAudio.jar,dns_sd.jar,j3daudio.jar,j3dcore.jar,j3dutils.jar,jai_core.jar,jai_codec.jar,mlibwrapper_jai.jar,MRJToolkit.jar,vecmath.jar,junit.jar,junit-*.jar,ant-launcher.jar"
user.country,US
user.dir,/tomcat/tomcat7
user.home,/home/tomcat7
user.language,en
user.name,tomcat7
user.timezone,Europe/Zurich
Any help is appreciated.
thanks
Too bad 2.7.1 is not back-compatible.
Lock your plugin version to 2.6 in your pom.xml or upgrade your SonarQube
http://docs.sonarqube.org/display/HOME/Frequently+Asked+Questions
You're using a very very old version of SonarQube. I highly recommend you to upgrade. If you still want to remain on your version of SonarQube, you can try to downgrade sonar-maven-plugin to version 2.6.

Maven test error: javac: source release 1.8 requires target release 1.8 [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
If I run mvn -e test, I get the error:
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Skat09 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # Skat09 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO] Copying 191 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # Skat09 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 64 source files to /home/buzz-dee/Workspace/skat09/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] javac: source release 1.8 requires target release 1.8
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.729 s
[INFO] Finished at: 2015-10-02T23:17:02+02:00
[INFO] Final Memory: 10M/298M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project Skat09: Compilation failure
[ERROR] javac: source release 1.8 requires target release 1.8
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project Skat09: Compilation failure
javac: source release 1.8 requires target release 1.8
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
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:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
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:497)
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
javac: source release 1.8 requires target release 1.8
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:911)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
[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/MojoFailureException
This is my Maven pom.xml:
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<rules>
<requireJavaVersion>
<version>1.8</version>
</requireJavaVersion>
</rules>
<source>1.8</source>
<tagret>1.8</tagret>
</configuration>
</plugin>
</plugins>
The output from mvn -version:
Apache Maven 3.3.3 (NON-CANONICAL_2015-07-27T12:38:38_root; 2015-07-27T11:38:38+02:00)
Maven home: /opt/maven
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-jdk/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "4.2.2-1-arch", arch: "amd64", family: "unix"
Java JDK (archlinux-java get) setting:
java-8-jdk
Java compiler version (javac -version):
javac 1.8.0_60
I also tried to add:
<verbose>true</verbose>
<fork>true</fork>
<executable>/usr/lib/jvm/java-8-jdk/bin/javac</executable>
<compilerVersion>1.8</compilerVersion>
to the configuration element of the maven-compiler-plugin in the POM.
What is problem for the above error and how can I solve it?
you made a typo: <tagret>1.8</tagret> should be <target>1.8</target>

Maven by example - NullPointer executing hibernate3:hbm2ddl

I am following the Maven by example guide to learn Maven.
I am busy working through chapter 7, which is a simple multimodule enterprise project containing spring and hibernate. The example files for this chapter can be downloaded here, in the ch-multi-spring directory.
Sections 7.1 to 7.6 talk about the specifics of each module. In section 7, the database is generated and the application is run. It is at this step that I receive the following error:
> mvn hibernate3:hbm2ddl -X
<Some output left out>
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Multi-Spring Chapter Simple Parent Project ........ FAILURE [0.752s]
[INFO] Multi-Spring Chapter Simple Object Model .......... SKIPPED
[INFO] Multi-Spring Chapter Simple Weather API ........... SKIPPED
[INFO] Multi-Spring Chapter Simple Persistence API ....... SKIPPED
[INFO] Multi-Spring Chapter Simple Command Line Tool ..... SKIPPED
[INFO] Multi-Spring Chapter Simple Web Application ....... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.330s
[INFO] Finished at: Thu Apr 24 15:31:18 CEST 2014
[INFO] Final Memory: 9M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:3.0:hbm2ddl (default-cli) on project simple-parent: There was an error creating the AntRun task. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:3.0:hbm2ddl (default-cli) on project simple-parent: There was an error creating the AntRun task.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
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)
Caused by: org.apache.maven.plugin.MojoExecutionException: There was an error creating the AntRun task.
at org.codehaus.mojo.hibernate3.AbstractHibernateMojo.execute(AbstractHibernateMojo.java:84)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.NullPointerException
at org.codehaus.plexus.configuration.DefaultPlexusConfiguration.add(DefaultPlexusConfiguration.java:175)
at org.codehaus.plexus.configuration.DefaultPlexusConfiguration.addChild(DefaultPlexusConfiguration.java:151)
at org.codehaus.mojo.hibernate3.util.PlexusConfigurationUtils.setHibernateConfiguration(PlexusConfigurationUtils.java:289)
at org.codehaus.mojo.hibernate3.util.PlexusConfigurationUtils.parseHibernateTool(PlexusConfigurationUtils.java:67)
at org.codehaus.mojo.hibernate3.AbstractHibernateToolMojo.getConfiguration(AbstractHibernateToolMojo.java:60)
at org.codehaus.mojo.hibernate3.AbstractHibernateMojo.execute(AbstractHibernateMojo.java:76)
... 21 more
[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
Since I'm still learning Maven, and not familiar with Hibernate, I have no idea what the problem could be. I haven't changed anything in the downloaded example files.
I was getting the same error.
I modified the version number of hibernate3-maven-plugin plugin:
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<!-- insted of 2.1 as documented inside the Maven by example guide -->
<version>2.2</version>
....
</groupId>
And this fixed the issue. Moreover, I'm using JDK 1.8. Below the 'mvn -v' output:
Java version: 1.8.0_20, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_20\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
I figured out the answer.
Here is the summary of my findings:
the mvn hibernate3:hbm2ddl command should be run from the simple-webapp or simple-command folder. (The specification for the plugin should be present in the POM for that module.)
increasing the hibernate3-maven-plugin version to 3.0 will reintroduce the problem, I believe I read some posts that the configuration format had been changed, but I didn't look further into it.
the mvn hibernate3:hbm2ddl will report the error shown below if JAVA_HOME is set to JDK1.7 instead of 1.6 (Found solution to this here)
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:2.1:hbm2ddl (default-cli) on project simple-command: Could not get ConfigurationTask.

Maven with Cargo and Installed Glassfish

I have been having trouble getting this my maven project to work. I will show below my pom file and my error log. I am trying to run integration tests of my code on glassfish after it is deployed. Any help will be much appreciated. If there is a better solution to do that, that would also be appreciated.
pom.xml cargo portion:
<!-- cargo plugin -->
<dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-core-uberjar</artifactId>
<version>1.4.3</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<!-- cargo plugin -->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.3</version>
<configuration>
<container>
<containerId>glassfish4x</containerId>
<type>installed</type>
</container>
<configuration>
<type>existing</type>
<home>C:\glassFishV4\glassfish4\glassfish\domains</home>
<properties>
<cargo.hostname>localhost</cargo.hostname>
<cargo.servlet.port>4848</cargo.servlet.port>
<!-- if no username/password don't use these, it will fail -->
<cargo.remote.username>admin</cargo.remote.username>
<cargo.remote.passwordFile>C:\glassfish\glassfish4\glassfish\domains\domain1\config\admin-keyfile</cargo.remote.passwordFile>
<cargo.glassfish.domain.name>domain1</cargo.glassfish.domain.name>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>com.project</groupId>
<artifactId>projectID</artifactId>
<location>${project.build.directory}/${project.build.finalName}.war</location>
<type>war</type>
</deployable>
</deployables>
</configuration>
</plugin>
Error Log:
C:\Users\kev\projectID\com.project.projectID-1.0>mvn -e cargo:start
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building projectID 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.4.3:start (default-cli) # projectID ---
[INFO] [2.ContainerStartMojo] Resolved container artifact org.codehaus.cargo:car
go-core-container-glassfish:jar:1.4.3 for container glassfish4x
[INFO] [talledLocalContainer] GlassFish 4.x starting...
[INFO] [talledLocalContainer] Attempting to start domain1.... Please look at the
server log for more details.....
[INFO] [talledLocalContainer] Authentication failed for user: admin
[INFO] [talledLocalContainer] with password from password file: C:/glassFishV4/g
lassfish4/glassfish/domains/password.properties
[INFO] [talledLocalContainer] (Usually, this means invalid user name and/or pass
word)
[INFO] [talledLocalContainer] Command deploy failed.
[INFO] [talledLocalContainer] GlassFish 4.x is stopping...
[INFO] [talledLocalContainer] Waiting for the domain to stop .
[INFO] [talledLocalContainer] Command stop-domain executed successfully.
[INFO] [talledLocalContainer] GlassFish 4.x is stopped
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.139s
[INFO] Finished at: Fri Aug 16 16:19:33 EDT 2013
[INFO] Final Memory: 12M/304M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.3:star
t (default-cli) on project projectID: Execution default-cli of goal org.codehaus.c
argo:cargo-maven2-plugin:1.4.3:start failed: Failed to start the GlassFish 4.x c
ontainer. At least one GlassFish deployment has failed: org.codehaus.cargo.util.
CargoException: GlassFish admin command failed: asadmin exited 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.codehaus.cargo:cargo-maven2-plugin:1.4.3:start (default-cli) on project projectID
: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.3:s
tart failed: Failed to start the GlassFish 4.x container.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:414)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
357)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-c
li of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.3:start failed: Failed to
start the GlassFish 4.x container.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:115)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:208)
... 19 more
Caused by: org.codehaus.cargo.container.ContainerException: Failed to start the
GlassFish 4.x container.
at org.codehaus.cargo.container.spi.AbstractLocalContainer.start(Abstrac
tLocalContainer.java:230)
at org.codehaus.cargo.maven2.ContainerStartMojo.executeLocalContainerAct
ion(ContainerStartMojo.java:96)
at org.codehaus.cargo.maven2.ContainerStartMojo.doExecute(ContainerStart
Mojo.java:63)
at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo
.java:432)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:106)
... 20 more
Caused by: org.codehaus.cargo.util.CargoException: At least one GlassFish deploy
ment has failed: org.codehaus.cargo.util.CargoException: GlassFish admin command
failed: asadmin exited 1
at org.codehaus.cargo.container.glassfish.internal.AbstractGlassFishInst
alledLocalContainer.doStart(AbstractGlassFishInstalledLocalContainer.java:193)
at org.codehaus.cargo.container.spi.AbstractInstalledLocalContainer.star
tInternal(AbstractInstalledLocalContainer.java:313)
at org.codehaus.cargo.container.spi.AbstractLocalContainer.start(Abstrac
tLocalContainer.java:211)
... 24 more
Caused by: org.codehaus.cargo.util.CargoException: GlassFish admin command faile
d: asadmin exited 1
at org.codehaus.cargo.container.glassfish.internal.GlassFish3xAsAdmin.in
vokeAsAdmin(GlassFish3xAsAdmin.java:88)
at org.codehaus.cargo.container.glassfish.internal.AbstractGlassFishInst
alledLocalContainer.invokeAsAdmin(AbstractGlassFishInstalledLocalContainer.java:
96)
at org.codehaus.cargo.container.glassfish.internal.AbstractGlassFishInst
alledLocalContainer.invokeAsAdmin(AbstractGlassFishInstalledLocalContainer.java:
69)
at org.codehaus.cargo.container.glassfish.GlassFish3xInstalledLocalDeplo
yer.doDeploy(GlassFish3xInstalledLocalDeployer.java:89)
at org.codehaus.cargo.container.glassfish.internal.AbstractGlassFishInst
alledLocalDeployer.redeploy(AbstractGlassFishInstalledLocalDeployer.java:97)
at org.codehaus.cargo.container.glassfish.internal.AbstractGlassFishInst
alledLocalContainer.doStart(AbstractGlassFishInstalledLocalContainer.java:174)
... 26 more
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutio
nException
The weird thing is, is that I can see it start the glassfish server through eclipse and then stop it. I also tried with no password and user name for defaults because that's what they are, and as you see in this configuration I use a username and password file as described on the cargo site. I receive the same error both times.
Just grab your editor, open C:/glassFishV4/g
lassfish4/glassfish/domains/password.properties
Change:
AS_ADMIN_PASSWORD=adminadmin
To:
AS_ADMIN_PASSWORD=

Resources