简体   繁体   English

Maven:发布插件在<distributionManagement>中看不到我的<repository>

[英]Maven: release plugin doesn't see my <repository> in <distributionManagement>

To make Maven "deploy" to a directory, I use this: 为了使Maven“部署”到目录,我使用这个:

<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 effective pom. 这出现在有效的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: 但是,Maven坚持认为它不存在:

[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] 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. 我通过maven-release-plugin使用它。

Update: This ^^^ seems to be the key part - mvn deploy works fine. 更新:这^^^似乎是关键部分 - mvn deploy工作正常。

Related: http://www.java-tutorial.ch/maven/maven-release 相关: http//www.java-tutorial.ch/maven/maven-release

What's wrong? 怎么了?

Maven 3.0.4. Maven 3.0.4。 Pom to be added. Pom待补充。

由于maven-release-plugin不仅可以使用本地文件,还可以使用版本控制中的文件,因此它实际使用的文件看起来像缺少<distributionManagement>标记。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM