zoukankan      html  css  js  c++  java
  • 环境配置distributionManagement

    在测试环境将api to maven时,总是会报下面的错

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project ts-distribution-biz: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
    

    英文不好,加上对maven了解不是很透彻,花了一上午的时间才解决,distributionManagement标签里没有repository元素导致,这之前我都不知道distributionManagement这个东西。。。下面来介绍下
    我在本地开发好之后,需要将项目推到远程,一个公用的远程仓库,这样别人就可以调用你的api。
    但maven怎么知道要推到哪个远程仓库呢,distributionManagement就是负责将jar包推到指定的远程仓库。

    <distributionManagement>    
        <repository>    
          <id>nexus-releases</id>    
          <name>Nexus Release Repository</name>    
          <url>http://127.0.0.1:8080/nexus/content/repositories/releases/</url>    或者<url>${repo.internal.snapshots.url}</url>
        </repository>    
        <snapshotRepository>    
          <id>nexus-snapshots</id>    
          <name>Nexus Snapshot Repository</name>    
          <url>http://127.0.0.1:8080/nexus/content/repositories/snapshots/</url>    或者<url>${repo.internal.releases.url}</url>
        </snapshotRepository>    
      </distributionManagement>  
    

    maven会区分release版本和snapshot版本,远程仓库也会对稳定版和snapshot版进行区分。
    其实url在settings.xml文件中配置了,所以直接使用占位符就可以了。
    http://blog.csdn.net/ichsonx/article/details/49679161

  • 相关阅读:
    Struts2:<s:action>的使用
    Struts2:Struts2在jsp中使用标签时值的获取
    jsp:useBean的使用
    关于Filter的一点误解
    Strust2: 工作流程
    java程序连接MySQL数据库
    python 开发工具简介
    NCEP CFSR数据下载
    美国NOAA/AVHRR遥感数据
    气象网站
  • 原文地址:https://www.cnblogs.com/kivi170806/p/8193879.html
Copyright © 2011-2022 走看看