Jenkins 2 SonarQube Database Connection Error - jdbc

I am migrating our projects from our old Jenkins instance to Jenkins 2. I also installed the SonarQube Plugin (plugin version on Jenkins 1.6 is 2.4.4 and on Jenkins 2 the plugin version is 2.5).
I copied the SonarQube config and the Sonar jobs config one-to-one from the old instance to the new one.
My problem:
The new Jenkins has problems with the jdbc connections to the sonar database. Especially if I start concurrent Sonar jobs I get the following error log:
Started by user MyUser
Building in workspace /var/lib/jenkins/workspace/myproduct-domain-SONAR
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url ssh://git#stash.mycompany.net:7999/tcb/com.mycompany.myproduct.git # timeout=10
Fetching upstream changes from ssh://git#stash.mycompany.net:7999/tcb/com.mycompany.myproduct.git
> git --version # timeout=10
using GIT_SSH to set credentials
> git fetch --tags --progress ssh://git#stash.mycompany.net:7999/tcb/com.mycompany.myproduct.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/develop^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/develop^{commit} # timeout=10
Checking out Revision a98a268436cb0e2d5c0b3c0f4b68bc08caf41732 (refs/remotes/origin/develop)
> git config core.sparsecheckout # timeout=10
> git checkout -f a98a268436cb0e2d5c0b3c0f4b68bc08caf41732
> git rev-list a98a268436cb0e2d5c0b3c0f4b68bc08caf41732 # timeout=10
Parsing POMs
Established TCP socket on 41874
[com.mycompany.myproduct.domain] $ java -Xms128m -Xmx512m -XX:MaxPermSize=128m -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven33-agent-1.8.1.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3_3_9/boot/plexus-classworlds-2.5.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3_3_9/conf/logging jenkins.maven3.agent.Maven33Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3_3_9 /var/cache/jenkins/war/WEB-INF/lib/remoting-2.62.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven33-interceptor-1.8.1.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.8.1.jar 41874
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /var/lib/jenkins/workspace/myproduct-domain-SONAR/com.mycompany.myproduct.domain/pom.xml clean source:jar
[INFO] Scanning for projects...
[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 http://artifactory.mycompany.net/artifactory/remote-repos was cached in the local repository, resolution will not be reattempted until the update interval of remote-repos has elapsed or updates are forced
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building My Product - domain module 0.1.0.32-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: Failure to find org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 in http://artifactory.mycompany.net/artifactory/remote-repos was cached in the local repository, resolution will not be reattempted until the update interval of remote-repos has elapsed or updates are forced
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # com.mycompany.myproduct.domain ---
[INFO] Deleting /var/lib/jenkins/workspace/myproduct-domain-SONAR/com.mycompany.myproduct.domain/target
[INFO]
[INFO] >>> maven-source-plugin:3.0.1:jar (default-cli) > generate-sources # com.mycompany.myproduct.domain >>>
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.2.201409121644:prepare-agent (prepare-agent) # com.mycompany.myproduct.domain ---
[INFO] argLine set to -javaagent:/var/lib/jenkins/.m2/repository/org/jacoco/org.jacoco.agent/0.7.2.201409121644/org.jacoco.agent-0.7.2.201409121644-runtime.jar=destfile=/var/lib/jenkins/workspace/myproduct-domain-SONAR/com.mycompany.myproduct.domain/target/jacoco.exec,excludes=com/mycompany/myproduct/domain/**/*Exception.class
[WARNING] Failed to getClass for org.apache.maven.plugins.source.SourceJarMojo
[INFO]
[INFO] <<< maven-source-plugin:3.0.1:jar (default-cli) < generate-sources # com.mycompany.myproduct.domain <<<
[INFO]
[INFO] --- maven-source-plugin:3.0.1:jar (default-cli) # com.mycompany.myproduct.domain ---
[INFO] Building jar: /var/lib/jenkins/workspace/myproduct-domain-SONAR/com.mycompany.myproduct.domain/target/com.mycompany.myproduct.domain-0.1.0.32-SNAPSHOT-sources.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.329 s
[INFO] Finished at: 2016-11-16T14:28:33+00:00
[INFO] Final Memory: 20M/239M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /var/lib/jenkins/workspace/myproduct-domain-SONAR/com.mycompany.myproduct.domain/pom.xml to com.mycompany.myproduct/com.mycompany.myproduct.domain/0.1.0.32-SNAPSHOT/com.mycompany.myproduct.domain-0.1.0.32-SNAPSHOT.pom
[JENKINS] Archiving /var/lib/jenkins/workspace/myproduct-domain-SONAR/com.mycompany.myproduct.domain/target/com.mycompany.myproduct.domain-0.1.0.32-SNAPSHOT-sources.jar to com.mycompany.myproduct/com.mycompany.myproduct.domain/0.1.0.32-SNAPSHOT/com.mycompany.myproduct.domain-0.1.0.32-SNAPSHOT-sources.jar
channel stopped
[myproduct-domain-SONAR] $ /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3_3_9/bin/mvn -f /var/lib/jenkins/workspace/myproduct-domain-SONAR/com.mycompany.myproduct.domain/pom.xml -e -B sonar:sonar -Dsonar.jdbc.url=jdbc:oracle:thin:#tc-ng-db-dev.mycompany.net:1521:ngd ******** ******** -Dsonar.host.url=http://tc-services-itdev.mycompany.net:9000 ******** ********
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[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 http://artifactory.mycompany.net/artifactory/remote-repos was cached in the local repository, resolution will not be reattempted until the update interval of remote-repos has elapsed or updates are forced
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building My Product - domain module 0.1.0.32-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: Failure to find org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 in http://artifactory.mycompany.net/artifactory/remote-repos was cached in the local repository, resolution will not be reattempted until the update interval of remote-repos has elapsed or updates are forced
[INFO]
[INFO] --- sonar-maven-plugin:3.2:sonar (default-cli) # com.mycompany.myproduct.domain ---
[INFO] User cache: /var/lib/jenkins/.sonar/cache
[INFO] SonarQube version: 4.5.6
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
14:28:37.598 INFO - Load global referentials...
14:28:37.712 INFO - Load global referentials done: 116 ms
14:28:37.726 INFO - User cache: /var/lib/jenkins/.sonar/cache
14:28:37.733 INFO - Install plugins
14:28:37.806 INFO - Install JDBC driver
14:28:37.813 INFO - Create JDBC datasource for jdbc:oracle:thin:#tc-ng-db-dev.mycompany.net:1521:ngd
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:26 min
[INFO] Finished at: 2016-11-16T14:30:01+00:00
[INFO] Final Memory: 23M/244M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project com.mycompany.myproduct.domain: Fail to connect to database: Cannot create PoolableConnectionFactory (IO Error: Connection reset) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project com.mycompany.myproduct.domain: Fail to connect to database
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:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fail to connect to database
at org.sonarsource.scanner.maven.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:36)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:81)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:122)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: java.lang.IllegalStateException: Fail to connect to database
at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java:77)
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.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1015)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.batch.bootstrapper.Batch.start(Batch.java:81)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.executeOldVersion(BatchIsolatedLauncher.java:70)
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.$Proxy23.executeOldVersion(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:238)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:78)
... 23 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (IO Error: Connection reset)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.commons.dbcp.BasicDataSource.getLogWriter(BasicDataSource.java:1098)
at org.apache.commons.dbcp.BasicDataSourceFactory.createDataSource(BasicDataSourceFactory.java:350)
at org.sonar.core.persistence.DefaultDatabase.initDatasource(DefaultDatabase.java:103)
at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java:72)
... 49 more
Caused by: java.sql.SQLRecoverableException: IO Error: Connection reset
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:498)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
... 54 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
at oracle.net.ns.DataPacket.send(DataPacket.java:210)
at oracle.net.ns.NetOutputStream.flush(NetOutputStream.java:230)
at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:321)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:268)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:190)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:107)
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:124)
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:80)
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1137)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:350)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)
at oracle.jdbc.driver.T4CTTIoauthenticate.doOSESSKEY(T4CTTIoauthenticate.java:407)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:416)
... 62 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
SonarQube analysis completed: FAILURE
Build step 'SonarQube analysis with Maven' changed build result to FAILURE
Build step 'SonarQube analysis with Maven' marked build as failure
Finished: FAILURE
Could this be occurrend by the different SonarQube plugin versions or by some other parameters? The old jenkins instance can run parallel Sonar jobs without any problem but the new instance seems to have database issues.

Related

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 installation Fails

I am new to Maven. I am trying to run the below command after successfully configuring JAVA_HOME, M2_HOME and M2 paths.
mvn -X mvn:install
and after downloading couple of things I get error at.
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 KB at 10.3 KB/sec)
[DEBUG] Writing tracking file C:\Users\jafar_000\.m2\repository\org\codehaus\mojo\resolver- status.properties
[DEBUG] Could not find metadata org.apache.maven.plugins/maven-metadata.xml in local (C:\Users\jafar_000\.m2\repository)
[DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in local (C:\Users\jafar_000\.m2\repository)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 52.126 s
[INFO] Finished at: 2015-01-02T21:54:07+05:30
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'mvn' in the current project and in the plugin groups [org.apache.maven.plugins, org.cod
the repositories [local (C:\Users\jafar_000\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'mvn' in the current project and
apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\jafar_000\.m2\repository), centra
e.org/maven2)]
at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:93)
at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginForPrefix(MojoDescriptorCreator.java:260)
at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:220)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycle
103)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(Defau ltLifecycle
83)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:85)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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/NoPluginFoundForPrefixException
I am working on windows and Maven version 3.2.5
You need to run mvn install as install is a lifecycle, not a plugin.
See http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html for more info.

Maven creating a jar package

When I run this command:
mvn -e package
I got this error:
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/local/apache-maven-3.1.1/conf/settings.xml
[DEBUG] Reading user settings from /root/.m2/settings.xml [DEBUG] Using local repository at /root/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /root/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project org.apache.maven:standalone-pom:pom:1: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.090s
[INFO] Finished at: Thu Apr 24 11:47:01 CEST 2014 [INFO] Final Memory: 12M/362M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in
this directory (/root/src/storm-starter). Please verify you invoked Maven from the
correct directory. -> [Help 1] org.apache.maven.lifecycle.MissingProjectException: The
goal you specified requires a project to execute but there is no POM in this directory
(/root/src/storm-starter). Please verify you invoked Maven from the correct directory.
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:89)
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)
[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/MissingProjectException
Maven requires a file named pom.xml in the directory at which you have your project and are executing maven in.
That is the default; if you have another file as your pom.xml like you described in your comment, m2-pom.xml you'll have to inform maven about it with the -f flag.
mvn -f m2-pom.xml clean package

"Error reading archetype catalog" for maven 3.0.5

I have a problem with maven 3.0.5 in windows 7:
when I make
mvn archetype:generate -DgroupId=p1 -DartifactId=pn -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
in a command line,
which is a basic command in maven.
I have this error:
[INFO] ------------------------------------------------------------------------
[INFO] Building carbon Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) # carbon >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) # carbon <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) # carbon ---
[INFO] Generating project in Batch mode
[WARNING] Error reading archetype catalog http://repo1.maven.org/maven2
org.apache.maven.wagon.TransferFailedException: repo1.maven.org
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInput
Data(AbstractHttpClientWagon.java:892)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:11
6)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.apache.maven.archetype.source.RemoteCatalogArchetypeDataSource.do
wnloadCatalog(RemoteCatalogArchetypeDataSource.java:119)
at org.apache.maven.archetype.source.RemoteCatalogArchetypeDataSource.ge
tArchetypeCatalog(RemoteCatalogArchetypeDataSource.java:87)
at org.apache.maven.archetype.DefaultArchetypeManager.getRemoteCatalog(D
efaultArchetypeManager.java:216)
at org.apache.maven.archetype.DefaultArchetypeManager.getRemoteCatalog(D
efaultArchetypeManager.java:205)
at org.apache.maven.archetype.ui.generation.DefaultArchetypeSelector.get
ArchetypesByCatalog(DefaultArchetypeSelector.java:200)
at org.apache.maven.archetype.ui.generation.DefaultArchetypeSelector.sel
ectArchetype(DefaultArchetypeSelector.java:71)
at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execu
te(CreateProjectFromArchetypeMojo.java:197)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
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: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(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:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: java.net.UnknownHostException: repo1.maven.org
at java.net.InetAddress.getAllByName0(InetAddress.java:1243)
at java.net.InetAddress.getAllByName(InetAddress.java:1155)
at java.net.InetAddress.getAllByName(InetAddress.java:1091)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.SystemDefa
ultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultCli
entConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:278)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultCli
entConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.ManagedCli
entConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultR
equestDirector.tryConnect(DefaultRequestDirector.java:645)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultR
equestDirector.execute(DefaultRequestDirector.java:480)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.Abstract
HttpClient.execute(AbstractHttpClient.java:906)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.Abstract
HttpClient.execute(AbstractHttpClient.java:805)
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.execute(A
bstractHttpClientWagon.java:746)
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInput
Data(AbstractHttpClientWagon.java:886)
... 31 more
[WARNING] No archetype found in remote catalog. Defaulting to internal catalog
[INFO] -------------------------------------------------------------------------
---
[INFO] Using following parameters for creating project from Old (1.x) Archetype:
maven-archetype-webapp:1.0
[INFO] -------------------------------------------------------------------------
---
[INFO] Parameter: groupId, Value: p1
[INFO] Parameter: packageName, Value: p1
[INFO] Parameter: package, Value: p1
[INFO] Parameter: artifactId, Value: pn
[INFO] Parameter: basedir, Value: C:\Java\workspaces\carbon
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.929s
[INFO] Finished at: Wed Oct 02 13:07:05 WAT 2013
[INFO] Final Memory: 10M/24M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
.2:generate (default-cli) on project carbon: Unable to add module to the current
project as it is not of packaging type 'pom' -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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/MojoFailureExc
eption
Looks like the hostname "repo1.maven.org" cannot be located from the computer you're running the command on.
Check if you can ping the host "repo1.maven.org" and visit http://repo1.maven.org from your browser.

Maven archetype plugin - Checksum validation warnings

I am using Maven 3.5 on Windows 7.
The Environment variables 'M2_HOME' and 'JAVA_HOME' are set correctly, and 'JAVA_HOME\bin' and 'M2_HOME\bin' are included in my system's PATH.
I deleted all the files under .m2 directory and executed from the command line:
$mvn archetype:generate -DinteractiveMode=true
Maven downloaded some files successfully until the following was displayed:
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/archetype/maven-archetype/2.2/maven-archetype-2.2.pom
[WARNING] Checksum validation failed, expected d5572e8bea6f4876a086779ea878d71731d0ab36 but is 0d9d945a1b1c11a251adc893695c119eb9653cd2 for http://repo.maven.apache.org/maven2/org/apache/maven/archetype/maven-archetype/2.2/maven-archetype-2.2.pom
[WARNING] Checksum validation failed, expected d5572e8bea6f4876a086779ea878d71731d0ab36 but is 0d9d945a1b1c11a251adc893695c119eb9653cd2 for http://repo.maven.apache.org/maven2/org/apache/maven/archetype/maven-archetype/2.2/maven-archetype-2.2.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/archetype/maven-archetype/2.2/maven-archetype-2.2.pom (15 KB at 36.9 KB/sec)
[WARNING] The POM for org.apache.maven.plugins:maven-archetype-plugin:jar:2.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/2.2/maven-archetype-plugin-2.2.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/2.2/maven-archetype-plugin-2.2.jar (86 KB at 207.7 KB/sec)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) # standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) # standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) # standalone-pom ---
[WARNING] The POM for org.apache.maven.plugins:maven-archetype-plugin:jar:2.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar (165 KB at 381.1 KB/sec)
ε°⌡ 12, 2013 12:43:48 AM org.sonatype.guice.bean.reflect.Logs$JULSink warn
WARNING: Error injecting: org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo
java.lang.NoClassDefFoundError: org/apache/maven/shared/invoker/MavenInvocationException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2413)
at java.lang.Class.getDeclaredConstructors(Class.java:1855)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:98)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:629)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:831)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:758)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:255)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:204)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:954)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:987)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:950)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:108)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1011)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
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: java.lang.ClassNotFoundException: org.apache.maven.shared.invoker.MavenInvocationException
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
... 54 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.952s
[INFO] Finished at: Tue Mar 12 00:43:48 IST 2013
[INFO] Final Memory: 7M/109M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: Execution default-cli of goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate failed: A required class w
as missing while executing org.apache.maven.plugins:maven-archetype-plugin:2.2:generate: org/apache/maven/shared/invoker/MavenInvocationException
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-archetype-plugin:2.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/Oz/.m2/repository/org/apache/maven/plugins/maven-archetype-plugin/2.2/maven-archetype-plugin-2.2.jar
[ERROR] urls[1] = file:/C:/Users/Oz/.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] -----------------------------------------------------: org.apache.maven.shared.invoker.MavenInvocationException
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
C:\Users\Oz>
When I manually downloaded the problematic file from:
http://repo.maven.apache.org/maven2/org/apache/maven/archetype/maven-archetype/2.2/maven-archetype-2.2.pom
I noticed that the file is not formatted well (I guess the XML should be valid and it isn't).
Is it a known bug or am I doing something wrong here?

Resources