I am getting the below error when building with Apache Hbase.
I am running the below mail
mvn -e clean install -DskipTests -Dhbase.api=0.98
``` [ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: null:akuma:jar:1.9
Reason: Cannot find parent: org.kohsuke:pom for project: null:akuma:jar:1.9 for project null:akuma:jar:1.9
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to get dependency information: Unable to read the metadata file for artifact 'org.kohsuke:akuma:jar': Cannot find parent: org.kohsuke:pom for project: null:akuma:jar:1.9 for project null:akuma:jar:1.9
org.kohsuke:akuma:jar:1.9
from the specified remote repositories:
default (http://repo1.maven.org/maven2),
central (http://repo1.maven.org/maven2),
cdh.repo.snapshots (https://repository.cloudera.com/artifactory/cloudera-repos/),
ngdata.oss-releases (http://mvnrepo.ngdata.com/content/repositories/oss-releases)
Path to dependency:
1) com.ngdata:hbase-indexer-server:jar:1.6-SNAPSHOT
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:711)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.artifact.resolver.ArtifactResolutionException: Unable to get dependency information: Unable to read the metadata file for artifact 'org.kohsuke:akuma:jar': Cannot find parent: org.kohsuke:pom for project: null:akuma:jar:1.9 for project null:akuma:jar:1.9
org.kohsuke:akuma:jar:1.9
```
Thanks in advance
In the hbase indexer, for the hbase-indexer-server module, in pom, you will have
<dependency>
<groupId>org.kohsuke</groupId>
<artifactId>akuma</artifactId>
</dependency>
Looks like, while fetching the dependencies, that jar is not being fetched and not present in repository. Try to get correct version with dependencies built. Normally this is the jar needed for the indexer-server module ".m2\repository\org\kohsuke\akuma\1.9\akuma-1.9.jar"
Related
I've created an archetype from an existing project, and I modified it adding parameters (for the dependencies versions, as an example).
archetype architecture :
archetype
src
main
resources
archetype-resource
__rootArtifactId___bus
__rootArtifactId___bus-ear
__rootArtifactId___common
__rootArtifactId___packaging
__rootArtifactId___parent
pom.xml
META-INF
maven
archetype-metadata.xml
test
archetype.properties
pom.xml
But it won't build and I don't understand why (extract) :
[WARNING] Don't override file C:\workspaces\ws_socle\archetype\target\test-classes\projects\basic\project\app_x_x_poc\app_x_x_poc_bus.se
ttings\org.eclipse.wst.common.project.facet.core.xml
[WARNING] Don't override file C:\workspaces\ws_socle\archetype\target\test-classes\projects\basic\project\app_x_x_poc\app_x_x_poc_bus\src
\main\java\META-INF\persistence.xml
[WARNING] Don't override file C:\workspaces\ws_socle\archetype\target\test-classes\projects\basic\project\app_x_x_poc\app_x_x_poc_bus\src
\main\webapp\WEB-INF\ejb-jar.xml
[WARNING] Don't override file C:\workspaces\ws_socle\archetype\target\test-classes\projects\basic\project\app_x_x_poc\app_x_x_poc_bus\src
\main\webapp\WEB-INF\ibm-ejb-jar-bnd.xml
[WARNING] Don't override file C:\workspaces\ws_socle\archetype\target\test-classes\projects\basic\project\app_x_x_poc\app_x_x_poc_bus\src
\main\webapp\WEB-INF\ibm-web-bnd.xml
[WARNING] Don't override file C:\workspaces\ws_socle\archetype\target\test-classes\projects\basic\project\app_x_x_poc\app_x_x_poc_bus\src
\main\webapp\WEB-INF\ibm-web-ext.xml
[WARNING] Don't override file C:\workspaces\ws_socle\archetype\target\test-classes\projects\basic\project\app_x_x_poc\app_x_x_poc_bus\src
\main\webapp\WEB-INF\web.xml
[WARNING] Don't override file C:\workspaces\ws_socle\archetype\target\test-classes\projects\basic\project\app_x_x_poc\app_x_x_poc_common\
.settings\org.eclipse.wst.common.project.facet.core.xml
[WARNING] Don't override file C:\workspaces\ws_socle\archetype\target\test-classes\projects\basic\project\app_x_x_poc\app_x_x_poc_bus-ear
.settings\org.eclipse.wst.common.project.facet.core.xml
[WARNING] Don't override file C:\workspaces\ws_socle\archetype\target\test-classes\projects\basic\project\app_x_x_poc\app_x_x_poc_bus-ear
\META-INF\application.xml
[INFO] Parent element not overwritten in C:\workspaces\ws_socle\archetype\target\test-classes\projects\basic\project\app_x_x_poc\app_x_x_poc
jsf_parent\pom.xml
[INFO]
[ERROR] BUILD ERROR
[INFO]
[INFO]
Archetype IT 'basic' failed: Don't override file C:\workspaces\ws_socle\archetype\target\test-classes\projects\basic\project\app_x_x_poc\app
_x_x_poc_parent..\app_x_x_poc_bus\pom.xml
[INFO]
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException:
Archetype IT 'basic' failed: Don't override file C:\workspaces\ws_socle\archetype\target\test-classes\projects\basic\project\app_x_x_poc\app
_x_x_poc_parent..\app_x_x_poc_bus\pom.xml
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException:
Archetype IT 'basic' failed: Don't override file C:\workspaces\ws_socle\archetype\target\test-classes\projects\basic\project\app_x_x_poc\app
_x_x_poc_parent..\app_x_x_poc_bus\pom.xml
at org.apache.maven.archetype.mojos.IntegrationTestMojo.execute(IntegrationTestMojo.java:268)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
It says it can't override stuff like the parent pom, but I think it shouldn't try to do it.
How can I solve it ? Or how can I prevent this behaviour ?
As #Cheloute said in their comment, I believe it is an issue with your archetype-meta.xml file.
This error is generally as a result of having declared the same file/module to be copied more than once.
You may have one or more overlapping
filesets, configured to copy same files into same location, or maybe the same
resources/files are listed twice in archetype.xml file.
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.
I'm trying to use maven archetype to create a Magnolia project by running:
D:\workingFolder\workspace\MagnoliaTutorial5.3\tryProjects> mvn archetype:generate -DarchetypeCatalog=http://nexus.magnolia-cms.com/content/groups/public/
and choose
5: http://nexus.magnolia-cms.com/content/groups/public/ -> info.magnolia.maven.archetypes:magnolia-project-archetype (An arch
etype to create a Magnolia project (a parent pom and a webapp))
and configure the properties as follow:
Confirm properties configuration:
groupId: com.try.projects
artifactId: tryProjects
version: 1.0-SNAPSHOT
package: com.try.projects
magnolia-version: 5.3
project-name: tryProjects
project creation is successful but when I run
mvn clean install
I run into following problem:
[INFO] Error building POM (may not be this project's POM).
Project ID: info.magnolia.ui:magnolia-ui-project
Reason: POM 'info.magnolia.ui:magnolia-ui-project' not found in repository: Unable to download the artifact from any reposito
ry
info.magnolia.ui:magnolia-ui-project:pom:5.3
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project info.magnolia.ui:magnolia-ui-project
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: POM 'info.magnolia.ui:magnolia-ui-project' not found in repository: Unable
to download the artifact from any repository
info.magnolia.ui:magnolia-ui-project:pom:5.3
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project info.magnolia.ui:magnolia-ui-project
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:404)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:272)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'info.magnolia.ui:magnolia-ui-project' not found in reposit
ory: Unable to download the artifact from any repository
info.magnolia.ui:magnolia-ui-project:pom:5.3
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project info.magnolia.ui:magnolia-ui-project
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:605)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:251)
at org.apache.maven.project.DefaultMavenProjectBuilder.mergeManagedDependencies(DefaultMavenProjectBuilder.java:1456)
at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:999)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:880)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:255)
at org.apache.maven.project.DefaultMavenProjectBuilder.mergeManagedDependencies(DefaultMavenProjectBuilder.java:1456)
at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:999)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:880)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:50
8)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:604)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:487)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:391)
... 12 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository
info.magnolia.ui:magnolia-ui-project:pom:5.3
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:228)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)
... 25 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:404)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)
... 27 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sun Jul 20 22:47:32 SGT 2014
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------
I tried to use earlier version 5.1.1 this problem is not occurred. looks like something wrong for the repository but I can't figure out the solution for this.
Any ideal how I can fix this problem?
Magnolia's modules are located in their own maven repository, so you need to add this one to your settings.xml.
The following command can be executed from a terminal in your .m2 repository (usually <user-dir>/.m2) and will download a settings.xml file preconfigured for Magnolia CE:
mvn org.sonatype.plugins:nexus-maven-plugin:1.9.2.4:settings-download -Dnexus.url=http://nexus.magnolia-cms.com -Dsettings.templateId=magnolia-community-public
You will only need to do this step once. After that, maven knows Magnolia's maven repo.
Documentation: http://documentation.magnolia-cms.com/display/DOCS/Maven+init
https://wiki.magnolia-cms.com/display/DEV/Maven+setup
for CE users, you need to use the following command in .m2 folder:
mvn org.sonatype.plugins:nexus-m2settings-maven-plugin:1.6.5:download -DnexusUrl=https://nexus.magnolia-cms.com -Dusername=anonymous -Dpassword=anonymous -DtemplateId=magnolia-community-public
I am new to maven, I want to add commons-codec jar to maven local repository , Actually I want to use this jar in the project but I get compile error which shows the jar could not find at compile-time the project pom file contains
<dependency>
<groupId>commons</groupId>
<artifactId>commons-codec</artifactId>
<version>1.8</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/commons-codec-1.8.jar</systemPath>
</dependency>
and the jar file is in the lib folder in the project root , after some googling I found the I should install the jar by mvn So I execute this
C:\Program Files (x86)\apache-maven-2.2.1-bin\apache-maven-2.2.1\bin>mvn install:commons-codec-1.8.jar -Dfile="c:\mapsforge\mapsforge-map\lib\commons-codec-1.8.jar" -DartifactId=commons-codec -Dversion=1.8 -Dpackaging=jar -e
and then I get this error
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'install'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Required goal not found: install:commons-codec-1.8.jar in org.apache.maven.plugins:maven-install-plugin:2.2
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Required goal not found: install:commons-codec-1.8.jar in org.apache.maven.plugins:maven-install-plu
gin:2.2 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1867)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:462)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:175)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
what's wrong here ... ?
The given goal is wrong.
mvn install:commons-codec-1.8.jar -Dfile="c:\mapsforge\mapsforge-map\lib\commons-codec-1.8.jar" -DartifactId=commons-codec -Dversion=1.8 -Dpackaging=jar -e
it must be:
mvn install:install-file -Dfile="c:\mapsforge\mapsforge-map\lib\commons-codec-1.8.jar" -DartifactId=commons-codec -Dversion=1.8 -Dpackaging=jar -e
Apart from that i would suggest to use Maven 3.X instead of Maven 2.2.1.
I have been trying to integrate Sonar with our Jenkins continous Integration system. I have installed the Sonar-plugin for Jenkins and configured it(specified the DB, DB Username and password etc). I have also specified the sonar-maven-plugin version as 1.0-beta-2.
Along with this plugin configuration, I have added a build post-action to run Sonar on my maven projects. But everytime Jenkins tries to execute sonar:sonar goal it fails with the below error.
Please help me guys in resolving this problem.
Thanks
[INFO] Building prof
[INFO] task-segment: [org.codehaus.mojo:sonar-maven-plugin:1.0-beta-2:sonar] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [sonar:sonar {execution: default-cli}]
[INFO] Sonar host: http://inmqbs:9000
[INFO] Sonar version: 3.3.2
[INFO] Execute: org.codehaus.sonar:sonar-maven-plugin:3.3.2:sonar
Downloading: http://troop:8081/nexus/content/groups/platform//org/codehaus/sonar/sonar-maven- plugin/3.3.2/sonar-maven-plugin-3.3.2.pom
[INFO] Unable to find resource 'org.codehaus.sonar:sonar-maven-plugin:pom:3.3.2' in repository troop-maven-releases (http://troop:8081/nexus/content/groups/platform/)
Downloading: http://troop:8081/nexus/content/groups/platform//org/codehaus/sonar/sonar-maven-plugin/3.3.2/sonar-maven-plugin-3.3.2.pom
[INFO] Unable to find resource 'org.codehaus.sonar:sonar-maven-plugin:pom:3.3.2' in repository central (http://repo1.maven.org/maven2)
Downloading: http://troop:8081/nexus/content/groups/platform//org/codehaus/sonar/sonar-maven-plugin/3.3.2/sonar-maven-plugin-3.3.2.pom
[INFO] Unable to find resource 'org.codehaus.sonar:sonar-maven-plugin:pom:3.3.2' in repository troop-maven-releases (http://troop:8081/nexus/content/groups/platform/)
Downloading: http://troop:8081/nexus/content/groups/platform//org/codehaus/sonar/sonar-maven-plugin/3.3.2/sonar-maven-plugin-3.3.2.pom
[INFO] Unable to find resource 'org.codehaus.sonar:sonar-maven-plugin:pom:3.3.2' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar
Embedded error: Unable to build project for plugin 'org.codehaus.sonar:sonar-maven-plugin': POM 'org.codehaus.sonar:sonar-maven-plugin' not found in repository: Unable to download the artifact from any repository
org.codehaus.sonar:sonar-maven-plugin:pom:3.3.2
from the specified remote repositories:
internal-repository (http://troop:8081/nexus/content/groups/platform/)
for project org.codehaus.sonar:sonar-maven-plugin
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:103)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:694)
... 17 more
The problem clearly comes from your Nexus repository or from some specific configuration that you've made in your POM / settings.xml file / Jenkins settings. You should contact the guys who handle this "http://troop:8081" Nexus instance to know how to deal with your issue.
BTW, there's no need to force the version of the sonar-maven-plugin plugin: this will cause you only troubles.
what database are you using?, if it defaults to derby database then only connections from the localhost are allowed and thus sonar and jenkins should run in the same machine. If this is the problem i can give further guidance but in a nutshell either change the database, or change the derby connection properties or provide a ssh tunnel between sonar and jenkins machines.
Use in the your configuration sonar-maven-plugin 2.0-beta-1
instead sonar-maven-plugin:1.0-beta-2