Maven doesn't see my <repository> in <dependencyManagement>
- by Ondra Žižka
To make Maven "deploy" to a directory, I use this:
<distributionManagement>
<downloadUrl>http://code.google.com/p/junitdiff/downloads/list</downloadUrl>
<repository>
<id>local-hack-repo</id>
<name>LocalDir</name>
<url>file://${project.basedir}/dist-maven</url>
</repository>
<snapshotRepository>
<id>jboss-snapshots-repository</id>
<name>JBoss Snapshots Repository</name>
<!--
<url>https://repository.jboss.org/nexus/content/repositories/snapshots</url>
-->
<url>file://${project.basedir}/dist-maven</url>
</snapshotRepository>
</distributionManagement>
This appears in the efffective pom.
...
<distributionManagement>
<repository>
<id>local-hack-repo</id>
<name>LocalDir</name>
<url>file:///home/ondra/work/TOOLS/JUnitDiff/github/dist-maven</url>
</repository>
<snapshotRepository>
<id>jboss-snapshots-repository</id>
<name>JBoss Snapshots Repository</name>
<url>file:///home/ondra/work/TOOLS/JUnitDiff/github/dist-maven</url>
</snapshotRepository>
<downloadUrl>http://code.google.com/p/junitdiff/downloads/list</downloadUrl>
</distributionManagement>
But still, Maven insists that it's not there:
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project JUnitDiff: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
[INFO] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project JUnitDiff: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
[INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
[INFO] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
[INFO] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
[INFO] at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:601)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[INFO] Caused by: org.apache.maven.plugin.MojoExecutionException: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter
[INFO] at org.apache.maven.plugin.deploy.DeployMojo.getDeploymentRepository(DeployMojo.java:235)
[INFO] at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:118)
[INFO] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
[INFO] ... 19 more
I am using it through the maven-release-plugin.
What's wrong?