首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Maven:发布插件没有在<distributionManagement>中看到我的<distributionManagement>

Maven:发布插件没有在<distributionManagement>中看到我的<distributionManagement>
EN

Stack Overflow用户
提问于 2012-11-24 23:01:38
回答 1查看 3.5K关注 0票数 6

要使Maven“部署”到目录,我使用以下命令:

代码语言:javascript
运行
复制
<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>

这会出现在有效的pom中。

代码语言:javascript
运行
复制
...
<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>

但是,Maven坚持认为它并不存在:

代码语言:javascript
运行
复制
[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

我正在通过maven发布插件来使用它。

更新:这个^似乎是关键部分-- mvn deploy工作正常。

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

怎么了?

Maven 3.0.4要添加Pom。

EN

Stack Overflow用户

发布于 2013-12-26 13:33:35

由于maven发布插件不仅适用于本地文件,而且也适用于版本控制中的文件,因此看起来它实际使用的文件缺少<distributionManagement>标记。

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13546539

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档