I have created a project using the m2 eclipse tool and selected the web application archetype now if I try to package this empty application I get a build failure saying
[ERROR] Plugin org.apache.maven.plugins:maven-war-plugin:2.1 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-war-plugin:jar:2.1 in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update in
terval of central has elapsed or updates are forced -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-war-plugin:2.1 or one of its dependencies could not be resolv
ed: Failure to find org.apache.maven.plugins:maven-war-plugin:jar:2.1 in http://repo1.maven.org/maven2 was cached in the local repository, resolution
will not be reattempted until the update interval of central has elapsed or updates are forced
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:96)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:136)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:251)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:197)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExections(DefaultLifecycleExecutionPlanCalculator.java
:134)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.
java:116)
at org.apache.maven.lifecycle.internal.BuilderCommon.resolveBuildPlan(BuilderCommon.java:92)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
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:314)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:151)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:445)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:168)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:132)
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: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.sonatype.aether.resolution.ArtifactResolutionException: Failure to find org.apache.maven.plugins:maven-war-plugin:jar:2.1 in http://rep
o1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates
are forced
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:488)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:190)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:250)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:92)
... 23 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to find org.apache.maven.plugins:maven-war-plugin:jar:2.1 in http://repo1.m
aven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are
forced
at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:191)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:384)
... 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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Now I have tried updating the repository ect but I am having no luck.
Upon suggestion I have tried to update the plugin registry but there is no such file pugin-registry.xml on my file system.
Also it builds fine within eclipse but fails from command , so I'm guessing they are both using different versions. How to fix this?
Try using the -cpu flag. Output from mvn -help:
usage: mvn [options] [<goal(s)>] [<phase(s)>]
Options:
-cpu,--check-plugin-updates Force upToDate check for any
relevant registered plugins
You are missing a plugin required for the Maven build to function. Check and tweak the values in the Plugin Registry such that an update is forced. You can also use command line parameters to force the download of the plugin.
I followed below steps and it worked for me. Check if it is useful for you.
project-->properties-->Maven-->User settings
change user settings to point out to correct settings.xml
and to your repository folder should exist in your system.
This is resolved when I moved back to maven v 3.0.4.
Related
After improving my POM a bit (with findbugs, pmd, checkstyle) I got an exception when running:
mvn project-info-reports:dependency-management
[WARNING] Unable to create Maven project for javax.inject:com.springsource.javax.inject:pom:1.0.0 from repository.
org.apache.maven.project.ProjectBuildingException: Error resolving project artifact: Failure to find javax.inject:com.springsource.javax.inject:pom:1.0.0 in http://192.168.50.3:8080/nexus/content/groups/bendit-snapshots was cached in the local repository, resolution will not be reattempted until the update interval of bendit-snapshots has elapsed or updates are forced for project javax.inject:com.springsource.javax.inject:pom:1.0.0
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:355)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:236)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:251)
at org.apache.maven.report.projectinfo.dependencies.RepositoryUtils.getMavenProjectFromRepository(RepositoryUtils.java:298)
at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.getDependencyRow(DependencyManagementRenderer.java:260)
at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.renderDependenciesForScope(DependencyManagementRenderer.java:208)
at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.renderDependenciesForAllScopes(DependencyManagementRenderer.java:160)
at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.renderSectionProjectDependencies(DependencyManagementRenderer.java:150)
at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.renderBody(DependencyManagementRenderer.java:136)
at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:83)
at org.apache.maven.report.projectinfo.DependencyManagementReport.executeReport(DependencyManagementReport.java:124)
at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:255)
at org.apache.maven.report.projectinfo.AbstractProjectInfoReport.execute(AbstractProjectInfoReport.java:234)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
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.eclipse.aether.resolution.ArtifactResolutionException: Failure to find javax.inject:com.springsource.javax.inject:pom:1.0.0 in http://192.168.50.3:8080/nexus/content/groups/bendit-snapshots was cached in the local repository, resolution will not be reattempted until the update interval of bendit-snapshots has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:294)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:344)
... 34 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find javax.inject:com.springsource.javax.inject:pom:1.0.0 in http://192.168.50.3:8080/nexus/content/groups/bendit-snapshots was cached in the local repository, resolution will not be reattempted until the update interval of bendit-snapshots has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:231)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:183)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:585)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:503)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
... 38 more
Because that is no dependency from my project, I tried to find ou whats the problem - updating to the latest Maven 3.3.9 and Java 1.8.0_121 doesn't help.
maven-project-info-reports-plugin version 2.9 is also the latest available one at this time.
So I asked mvnrepository.com for the artifact, which says that it is hosted on artifacts.alfresco.com. But there the repository has no pom or jar!
Last but not least I now downloaded the artifact from ebr.springsource.com.
I guess that there must be something wrong with repository dependencies in a Maven plugin (dependency). Because I was not able to find out more, I hope some else can help in fixing this?
My project has the structure
pom.xml (parent)
tcp/pom.xml
spark/pom.xml
The module xmls' both include this blurb
<parent>
<groupId>org.myorg</groupId>
<artifactId>parent</artifactId>
<version>1.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
I have also tried leaving relativePath blank, or to ../ or .. or even not including it at all . In all cases the result is:
[ERROR] The build could not read 2 projects -> [Help 1]
[ERROR]
[ERROR] The project org.myorg:tcpclient:1.0.0 (/git/MYorg/tcp/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.myorg:tcpclient:1.0.0:
Failure to find org.myorg:parent:pom:1.0 in https://repository.apache.org/content/repositories/snapshots was cached in
the local repository, resolution will not be reattempted until
the update interval of Maven snapshots repository has elapsed or updates
are forced and 'parent.relativePath' points at wrong local POM # line 24,
column 9 -> [Help 2]
So I could use some help getting off the ground with these multi modules builds.
Update Following is last part of output of
mvn clean install -U -X > out 2>&1
INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/local/Cellar/maven/3.3.9/libexec/conf/settings.xml
[DEBUG] Reading user settings from /Users/steve/.m2/settings.xml
[DEBUG] Reading global toolchains from /usr/local/Cellar/maven/3.3.9/libexec/conf/toolchains.xml
[DEBUG] Reading user toolchains from /Users/steve/.m2/toolchains.xml
[DEBUG] Using local repository at /Users/steve/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /Users/steve/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repository.apache.org/content/repositories/snapshots
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repository.apache.org/content/repositories/snapshots
Downloading: https://repository.apache.org/content/repositories/snapshots/org/openchai/parent/1.0/parent-1.0.pom
[DEBUG] Writing tracking file /Users/steve/.m2/repository/org/openchai/parent/1.0/parent-1.0.pom.lastUpdated
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo.maven.apache.org/maven2
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.maven.apache.org/maven2
Downloading: https://repo.maven.apache.org/maven2/org/openchai/parent/1.0/parent-1.0.pom
[DEBUG] Writing tracking file /Users/steve/.m2/repository/org/openchai/parent/1.0/parent-1.0.pom.lastUpdated
[DEBUG] Skipped remote request for org.openchai:parent:pom:1.0, already updated during this session.
[DEBUG] Extension realms for project org.openchai:parent:pom:1.0.0: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-jar-plugin # line 223, column 21
[FATAL] Non-resolvable parent POM for org.openchai:tcpclient:1.0.0: Could not find artifact org.openchai:parent:pom:1.0 in Maven snapshots repository (https://repository.apache.org/content/repositories/snapshots) and 'parent.relativePath' points at wrong local POM # line 24, column 9
[FATAL] Non-resolvable parent POM for org.openchai:spark_p2prdd:1.0.0: Failure to find org.openchai:parent:pom:1.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM # line 24, column 10
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-install-plugin is missing. # line 90, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. # line 168, column 15
#
[ERROR] The build could not read 2 projects -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-jar-plugin # line 223, column 21
[FATAL] Non-resolvable parent POM for org.openchai:tcpclient:1.0.0: Could not find artifact org.openchai:parent:pom:1.0 in Maven snapshots repository (https://repository.apache.org/content/repositories/snapshots) and 'parent.relativePath' points at wrong local POM # line 24, column 9
[FATAL] Non-resolvable parent POM for org.openchai:spark_p2prdd:1.0.0: Failure to find org.openchai:parent:pom:1.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM # line 24, column 10
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-install-plugin is missing. # line 90, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. # line 168, column 15
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:422)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGraphBuilder.java:419)
at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor(DefaultGraphBuilder.java:410)
at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.java:83)
at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:491)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:219)
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)
[ERROR]
[ERROR] The project org.openchai:tcpclient:1.0.0 (/git/OCspark/tcp/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.openchai:tcpclient:1.0.0: Could not find artifact org.openchai:parent:pom:1.0 in Maven snapshots repository (https://repository.apache.org/content/repositories/snapshots) and 'parent.relativePath' points at wrong local POM # line 24, column 9 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Could not find artifact org.openchai:parent:pom:1.0 in Maven snapshots repository (https://repository.apache.org/content/repositories/snapshots)
at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:197)
at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:246)
at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1000)
at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:800)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:329)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:469)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:438)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:555)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:438)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:401)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGraphBuilder.java:419)
at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor(DefaultGraphBuilder.java:410)
at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.java:83)
at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:491)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:219)
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.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact org.openchai:parent:pom:1.0 in Maven snapshots repository (https://repository.apache.org/content/repositories/snapshots)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:294)
at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:193)
... 27 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.openchai:parent:pom:1.0 in Maven snapshots repository (https://repository.apache.org/content/repositories/snapshots)
at org.eclipse.aether.
Amid so many details to track I made the following mistake:
The parent version was listed as 1.0 . The actual version in the parent pom.xml is 1.0.0.
There was no conceptual misunderstanding on my part: just attention to detail.
I just saw the version difference in the poms. 1.0.0 and 1.0. Check?
Ohh you updated the same :)
The primary answer to this should be at When maven says "resolution will not be reattempted until the update interval of MyRepo has elapsed", where is that interval specified?
I am guessing you might have tried an incorrect relativePath while building the project at some stage and that tried generating the artifact and failed but now that pom.xml is cached with an incorrect relativePath and would keep on throwing an error.
Would also suggest you go through this answer at How do you clear Apache Maven's cache? to use an effective way of clearing the cache if you simply don't want to delete the repository
More about <relativePath>, and it's use -
The relative path of the parent <code>pom.xml</code> file
within the checkout.
The default value is ../pom.xml.
Maven looks for the parent pom first in the reactor of currently building projects, then in this location on the filesystem, then the local repository, and lastly in the remote repo.
<code>relativePath</code> allows you to select a different location, for example when your structure is flat, or deeper without an intermediate parent pom.
However, the group ID, artifact ID and version are still required,
and must match the file in the location given or it will revert to the repository for the POM.
This feature is only for enhancing the development in a local checkout of that project.
In your case, the structure as depicted from the question doesn't need to explicitly define the relativePath and can use its default value skipping its declaration.
My jenkins builds just started to fail with this message:
[INFO] --- sonar-maven-plugin:2.7:sonar (default-cli) # cividas-core-web ---
[INFO] artifact com.ontimize:ontimize-core: checking for updates from central
[INFO] artifact com.ontimize:ontimize-core: checking for updates from imatia-local
[INFO] artifact com.ontimize:ontimize-core: checking for updates from snapshots
[INFO] User cache: /var/lib/jenkins/.sonar/cache
[INFO] SonarQube version: null
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.773s
[INFO] Finished at: Thu Oct 22 19:49:04 CEST 2015
[INFO] Final Memory: 13M/193M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7:sonar (default-cli) on project cividas-core-web: null: MojoExecutionException: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7:sonar (default-cli) on project cividas-core-web: null
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
at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:107)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:141)
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.apache.maven.artifact.versioning.ComparableVersion.parseVersion(ComparableVersion.java:354)
at org.apache.maven.artifact.versioning.ComparableVersion.<init>(ComparableVersion.java:345)
at org.apache.maven.artifact.versioning.DefaultArtifactVersion.parseVersion(DefaultArtifactVersion.java:110)
at org.apache.maven.artifact.versioning.DefaultArtifactVersion.<init>(DefaultArtifactVersion.java:46)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstrapper.isVersionPriorTo5Dot2(RunnerBootstrapper.java:192)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:84)
... 22 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
What is this all about?
Solved by downgrading the automatically picked latest (2.7) version to an older one (2.4) by adding this code to the plugins section of my pom.xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.4</version>
</plugin>
For those interested in "why?", I've done some more digging and what seems to be happening is this:
RunnerBootstrapper attempts to check whether a version is 5.2+:
First, serverVersion is retrieved from a launcher created in EmbeddedRunner,
using IsolatedLauncher creating a proxy of implementation class BatchIsolatedLauncher
which attempts to read a resource file sq-version.txt containing the version.
This sq-version.txt file is located in org.codehaus.sonar:sonar-plugin-api, but this dependency is not included (even transitively) in the sonar-maven-plugin. All it references sonar-wise is org.sonarsource.sonar-runner:sonar-runner-api.
They seem to have changed the location and name of the version txt file but not updated all code. You might get away with manually adding an sq-version.txt with content 5.2 (no newline) to the plugin classpath (possibly by updating the plugin jar), or add a dependency on sonar-plugin-api, but these are hacks.
The sonar-maven-plugin 2.6 uses sonar-runner 2.4, which is very different from 2.5 that sonar-maven-plugin 2.7 uses (the groupId for sonar-runner has changed domains from org.codehaus.sonar.runner to org.sonarsource.sonar-runner), so it's best to stick to the v2.6 plugin until they have smoothed out the transition and released a few more versions.
The way SonarQube server version is passed to maven-sonar-plugin has changed in v2.7, along with other things, since it uses now sonar-runner 2.5.
There is indeed a bug when using it with SonarQube instances < 4.3, for which I opened the ticket: https://jira.sonarsource.com/browse/MSONAR-131
Note that SQs < 4.5 (current LTS) are no longer actively supported and there is no guarantee that sonar-maven-plugin won't be incompatible with them in other ways due to the new interface exposed by sonar-runner 2.5.
For these cases, it is probably best to lock the maven plugin version to 2.6, as already suggested.
We had the same problem at work today, we automatically use the latest version for maven and sonar plugins. It wasn't easy to find the problem at first.
The answer elcodedocle has given is correct, but i would like to add for those that use maven with sonar in an automated fashion that this is a solution aswell:
org.codehaus.mojo:sonar-maven-plugin:2.6:sonar
This way it runs on the older version 2.6 and i can confirm that it works.
There is probably a bug in 2.7 and i hope it gets fixed soon. This was our error:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven plugin:2.7:sonar (default-cli) on project (projectName): Unable to determine structure of project. Probably you use Maven Advanced Reactor Options with a broken tree of modules. "(projectName)" is orphan -> [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/MojoExecutionException
EDIT:
Take a look at this post for some more information: Jenkins Sonar plugin suddenly stops working
Here is explained that the new version, 2.7, of the plugin is no longer compatible with java 6 projects. You can also find an explanation about how to fix it in Jenkins if you are not familiar with it. (my explanation was a bit short)
This is a hint:
[INFO] SonarQube version: null
Later in the code, Maven tries to parse this version number and fails. The source code is here: https://github.com/mojohaus/sonar-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/sonar/bootstrap/RunnerBootstrapper.java
From the source of the SonarQube runner, this is backed by a properties instance. So maybe the code couldn't access the server or the server isn't sending this data back. Hard to tell.
What I can see is that the code changed in 2.5. That's probably why 2.4 still works. See here how to nail down the versions: Jenkins Sonar plugin suddenly stops working
Discover the appropriate plugin version for you running sonar installation.
E.g.
mvn org.codehaus.mojo:sonar-maven-plugin:2.6:sonar
This plugin version will not work against the latest sonar release but will work fine against a 4.1.2.
I'm using SVN, Maven 3.0.3 on the latest version of Jenkins and the Maven Release plugin. I'm trying to use the Maven release plugin (through Jenkins) do a dry run and so am executing the options …
Executing Maven: -B -f /scratch/jenkins/workspace/myproject/myproject/pom.xml -DdevelopmentVersion=53.0.0-SNAPSHOT -DreleaseVersion=52.0.0 -Dusername=***** -Dpassword=********* -DskipTests -P prod -Dresume=false -DdryRun=true release:prepare
But the dry run is dying with the error below …
[JENKINS] Archiving /scratch/jenkins/workspace/myproject/myproject/pom.xml to /home/evotext/hudson_home/jobs/myproject/modules/org.mainco.subco$myproject/builds/2013-11-18_16-09-14/archive/org.mainco.subco/myproject/52.0.0/myproject-52.0.0.pom
Waiting for Jenkins to finish collecting data
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on project myproject: You don't have a SNAPSHOT project in the reactor projects list.
cause : You don't have a SNAPSHOT project in the reactor projects list.
Stack trace :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on project myproject: You don't have a SNAPSHOT project in the reactor projects list.
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.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:117)
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.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:178)
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 hudson.maven.Maven3Builder.call(Maven3Builder.java:129)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:67)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.maven.plugin.MojoFailureException: You don't have a SNAPSHOT project in the reactor projects list.
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:219)
at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:181)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 30 more
Caused by: org.apache.maven.shared.release.ReleaseFailureException: You don't have a SNAPSHOT project in the reactor projects list.
at org.apache.maven.shared.release.phase.CheckPomPhase.execute(CheckPomPhase.java:111)
at org.apache.maven.shared.release.phase.CheckPomPhase.simulate(CheckPomPhase.java:123)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:199)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:140)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:103)
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:211)
... 33 more
My SVN checkout method is set to "Always checkout a fresh copy" and I have a snapshot version in question in my snapshot repository, but not in my release repository. Is there a way I can get the "reactor projects list" to look at my snapshot repo?
Edit: I'm including the snippet of my pom where the project gets its version -- it inherits it from a parent
<parent>
<artifactId>subco</artifactId>
<groupId>org.mainco.subco</groupId>
<version>52.0.0</version>
</parent>
You're trying to release an artifact that's not a snapshot. That means your artifact's version number is something like 3.0.3. That version number implies its already been released. You can't release a release. There would be no changes in between and therefore no point.
You're only supposed to release SNAPSHOT versions. That means your version number would be like 3.0.3-SNAPSHOT.
Jenkins workspace is not cleanup or you have FINAL version inside pom.xml. Jenkins has check-out strategy for cleaning up workspace.
More: Maven release plugin - SNAPSHOT project needed
Check-out Strategy options:
Emulate clean checkout by first deleting unversioned files/ignored files, as well as files/directories ignored by svn:ignore, then execute svn update.
Always check out fresh copy
Use svn update as much possible, with svn revert before update
Bump Up your Project POM file for from the previously built code base to a new version.
1.0.1-SNAPSHOT<version>1.0.1-SNAPSHOT</version>
Changing the check-out strategy to "Emulate clean checkout by first deleting unversioned files/ignored files, then svn update" did the trick for me.
I have a flex application that builds fine with JDK6. Maven debug logs show the following message for a missing POM file:
[WARNING] Missing POM for com.adobe.flex.framework:halo:swc:theme:4.5.1.21328: Error resolving project artifact: Failure to find com.adobe.flex.framework:halo:pom:4.5.1.21328 in http://:9999/nexus/content/groups/repositories was cached in the local repository, resolution will not be reattempted until the update interval of has elapsed or updates are forced for project com.adobe.flex.framework:halo:pom:4.5.1.21328
[DEBUG] com.adobe.flex.framework:halo:swc:theme:4.5.1.21328:compile (selected for compile)
With JDK7, however, the missing POM file seems to be a problem. I get the following 'connection timedout' errors:
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact com.adobe.flex.framework:halo:pom:4.5.1.21328 from/to flexmojos (http://repository.sonatype.org/content/groups/flexgroup/): Error transferring file: Connection timed out: connect
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:949)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:940)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:695)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:689)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.get(WagonRepositoryConnector.java:445)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:460)
... 33 more
Caused by: org.apache.maven.wagon.TransferFailedException: Error transferring file: Connection timed out: connect
at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:143)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:608)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.net.ConnectException: Connection timed out: connect
Am I missing some configuration that's required for using Maven with JDK7? I searched, but couldn't find anything. I'd appreciate any help with this. I'm using Maven 3.0.3. and JDK1.7.0_01.
This error cannot be due to JDK version. From the outputs it looks like different repositories are in involved in each case...
jdk 6
http://:9999/nexus/content/groups/repositories
jdk 7
http://repository.sonatype.org/content/groups/flexgroup
You may want to delete the concerned folder (../com/adobe/flex/framework/halo/4.5.1.21328) from your local repository and try rebuilding.