`

Maven Notes

阅读更多

There is a few different confusing Tag and URL in Maven pom.xm

 

  • <scm> url points to SVN URL which hold the subversion code you check in/out.
  • <repository> points to library url when pom.xml has dependency, it will pull out from there (<snapshots>true</snapshots> means it support snapshot lookup and checkout)
  • <distributionManagement> points to the location where the release code will be put (the release will check out code from URL in <scm> and create release file and save in the url.

<distributionManage>

 

	<distributionManagement>
		<downloadUrl>https://xxxx/</downloadUrl>
		<repository>
			<uniqueVersion>false</uniqueVersion>
			<id>es-maven</id>
			<name>xxx systems Maven Repository</name>
			<url>sftp://xxx/export/web/maven2/</url>
			<layout>default</layout>
		</repository>
		<site>
			<id>es-maven-site</id>
			<url>sftp://xxxx/export/web/site/${artifactId}</url>
		</site>
	</distributionManagement>

 

- it contains url where when you run "mvn deploy" the new generated snapshot file will be uploaded there

 

<repository>

 

   <repository>
			<id>xx-maven</id>
			<name>xxx Systems Maven Repository</name>
			<url>https://xxx/maven2</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
			<releases>
				<enabled>true</enabled>
			</releases>
		</repository>

 The red "true" "false" means when you do "mvn deploy" it will be able to create snapshot or not

 

  • if "true" every deploy, it will create new snapshot on deploy server location (defined in distributionmanage tag)
  • if "false" every deploy, it will overwrite previous snapshot on deploy server location  (defined in distributionmanage tag)

 

1. Maven release:prepare

 

  1. Verify that there are no uncommitted changes in the workspace.
  2. Prompt the user for the desired tag, release and development version names.
  3. Modify and commit release information into the pom.xml file.
  4. Tag the entire project source tree with the new tag name.
Because prepare will tag the project, we need the following
  • project.scm.developerConnection

    The current location of the development trunk. A valid SCM URL format appropriate to the SCM provider. The "SCM:Provider:" prefix is used to determine the provider being used.

  • tagbase
  • The new location to record a tagged release. A valid SCM URL format appropriate to the SCM provider without the "SCM:Provider:" prefix.

    2. Maven release

     

    1. Extract file revisions versioned under the new tag name.
    2. Execute the maven build lifecycle on the extracted instance of the project.
    3. Deploy the versioned artifacts to appropriate local and remote repositories.

     

    Reference:  http://maven.apache.org/guides/mini/guide-releasing.html

     

    Compared with local reporsitory and deploy/release remote server, the structure of maven snapshot release, and release are same. because everything is done locally before sending to server??? That is my understanding

     

    Why configure remote repository in settings.xml

    (reference: http://juvenshun.iteye.com/blog/359256)

    Suppose you work on 3 project at the same time, they all point to same remote repository, so you need configure them in 3 POM for the 3 different projects, right? repeated code, hard to maintain???

     

    So the solution is adding to your own .m2/settings.xml file

     

        <settings>  
          ...  
          <profiles>  
            <profile>  
              <id>dev</id>  
              <!-- repositories and pluginRepositories here-->  
            </profile>  
          </profiles>  
          <activeProfiles>  
            <activeProfile>dev</activeProfile>  
          </activeProfiles>  
          ...  
        </settings>  
     

    Deploy to remote repository

    (reference: http://juvenshun.iteye.com/blog/359256)

     <distributionManagement>    
    <repository>    
    ...
    <snapshotRepository>    
    ....

     This is the keyword I have been searching for a while:

    "Maven会根据你项目的版本来判断将构件分发到哪个仓库" according to juvenshun from Iteye.

     

    分享到:
    评论

    相关推荐

      apache-maven-3.3.9.rar

      The full list of changes can be found at http://maven.apache.org/release-notes.html. System Requirements ------------------- JDK: 1.7 or above (this is to execute Maven - it still allows you to...

      apache-maven-3.5.0-bin

      Release Notes: https://maven.apache.org/docs/history.html Mailing Lists: https://maven.apache.org/mail-lists.html Source Code: https://git-wip-us.apache.org/repos/asf/maven.git Issue Tracking: ...

      Introducing Maven(Apress,2014)

      Also, you'll learn the basics of using site plugins and generating Javadocs, test coverage/FindBugs reports, version/release notes and more. Furthermore, you'll take advantage of Maven's archetypes ...

      cuifuan#luca-notes#Linux安装Maven1

      1. Maven 压缩包下载与解压 2. 配置环境变量 3. 安装完成

      yaohusama#Notes#使用IntelliJ IDEA 配置Maven(入门)1

      2.配置本地仓库路径 3.配置maven环境变量 4.在IntelliJ IDEA中配置maven

      nnzbz#notes#maven常用插件1

      1.1. 参考配置 1.3. 版本范围规则 1.4. 扩展插件 2.1. 项目满足条件 2.2. 命令行运行 2.2.1. 更新全部子项目的版本号 2.2.2.

      mia369#Notes#maven配置与操作1

      一、本地配置 二、基于IDEA的配置 三、基于IDEA的操作

      github-release-notes-maven-plugin

      Github 发行说明 这是一个将发行说明发布到 ... 该项目在顶层有一个文件 RELEASE-NOTES.md。 在发布周期开始时,它是空的。 在开发过程中,贡献者构建了一份文档,该文档是对发布的连贯描述。 发布管理器运行releas

      基于IDEA+Maven+SSM框架+mysql的高并发商品秒杀项目源码+数据库+项目说明.zip

      1、基于IDEA+Maven+SSM框架+mysql的高并发商品秒杀项目源码+数据库+项目说明.zip 2、该资源包括项目的全部源码,下载可以直接使用! 3、本项目适合作为计算机、数学、电子信息等专业的课程设计、期末大作业和毕设...

      loggit-maven-plugin:使用git生成项目的变更日志和发行说明

      loggit-maven-plugin 为什么要使用另一个changelog插件? 其他changelog插件都没有我需要的功能的正确组合: 降价格式 更明智地选择提交范围(包括标签) 项目活动 产品特点 使用将git日志转换为任何格式。 指定...

      atlassian-maven-plugin:在 Atlassian 工具中执行不同任务的 Maven 插件

      atlassian-maven-插件 一个 Maven 插件,用于在 Atlassian 工具中执行不同的任务。 这些目标可用: addAttachment:向汇流页面添加附件。 addBlog:向汇流空间添加新的博客条目。 addPage:在 confluence 中向父页面...

      JavaNotes:Java重新学习笔记。包括Linux,maven,git,互联网架构,大数据体系等

      JavaNotes:Java重新学习笔记。包括Linux,maven,git,互联网架构,大数据体系等

      spring_liu_MyNotes_sample

      In this Example, It show you how to build a generic enterprise Web application with Maven 3. Compared with SOBA, this is a lighter-weight, Spring MVC based, mini sample, simulating a Notes Manager ...

      qyecst#notes#nexus相关1

      Sonatype Nexus: Maven仓库管理软件,常用于搭建私服。其他还有Apache Archiva、Artifactory相关链接docker-com

      Java_Notes.chm

      JavaSE -- JavaEE 全套资源: 1.JavaSE基础 2.JavaSE进阶 3.Git 4.Html 5.Linux ... 8.JavaWeb核心 9.Maven ... 13.Spring 14.SpringMVC ........

      krislinzhao#StudyNotes#12.4.整合fastdfs操作文件数据1

      引入maven依赖坐标在application.yml里面加上如下配置:httpserver: :8888/ #这个不是

      humanbeingxx#notes#一个类冲突问题1

      引入一个未加完全验证的理解maven的间接依赖有一套完整的规则,能确定最终依赖的是哪个版本的jar。但是没有看到关于怎么确定依赖的类的规则,或者说jar的加载顺

      Learning-Notes:学习笔记

      maven netty Redis Spring Spring4新特性 Spring使用注意事项 Spring验证Validation SpringBoot 开发知识 相关技术名词 开发技术框架工具整理 架构知识 开发过程注意事项整理 常用开发技巧 数据库 数据库基础知识 分...

      nexus-3.5.part2

      Note: More information can be found in the documentation, release notes, upgrade notes and the Support Knowledge Base. Manage these formats: Bower Docker Git LFS Maven npm NuGet PyPI Ruby Gems Yum ...

      stack-notes-aws

      叠笔记aws 该堆栈将部署一个Notes演示应用程序。 它是使用Angular Webapp设计的,该应用程序使用Java开发并通过maven构建的REST API。 持久层建立在Cassandra集群上。

    Global site tag (gtag.js) - Google Analytics