`

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.2.2.zip

      6. **RELEASE-NOTES** 文件:记录了该版本Maven的新增特性、修复的问题以及可能的已知问题。 将这个压缩包解压后,可以通过配置环境变量,将Maven添加到系统路径中,使得在命令行中可以直接使用`mvn`命令。对于...

      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下载

      6. `RELEASE-NOTES.txt`:包含了3.5.0版本的主要更新和改进。 安装Maven 3.5.0时,需要将`bin`目录添加到系统的PATH环境变量中,以便在任何地方都能执行`mvn`命令。然后,根据项目需求,可以配置`settings.xml`文件...

      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: ...

      Apache Maven项目构建工具 v3.9.6.zip

      具体更新内容可以通过阅读`maven-maven-3.9.6/RELEASE-NOTES.txt`或官方发布文档了解。这些改进通常会提高构建速度,增强依赖解析能力,以及提升与其他工具的集成性。 6. **源码与毕业设计** 对于学习和研究,...

      apache-maven-3.0.5

      6. `RELEASE-NOTES`: 该版本的发布说明,详述了新特性、改进和已知问题。 总之,Apache Maven 3.0.5是一个功能强大且成熟的项目管理工具,简化了Java项目的构建过程。通过合理的环境变量配置和POM管理,开发者可以...

      mac-apache-maven-3.8.6.zip

      7. **README**和**RELEASE-NOTES**: 提供关于该版本的详细信息和发布说明。 8. **site**: 如果存在,可能包含Maven项目的网站模板和配置。 使用这个压缩包,Mac用户可以快速安装和配置Maven,以便进行Java项目的...

      apache-maven-3.6.3-bin.zip

      5. `RELEASE-NOTES.txt`:包含了该版本的发行说明,列出了新特性、改进和已知问题。 安装Maven 3.6.3时,通常会将解压后的目录添加到系统的PATH环境变量中,以便在任何位置执行`mvn`命令。然后,开发者可以通过编写...

      apache-maven-3.8.3-src.tar.gz

      7. **RELEASE-NOTES** 文件:详细列出了该版本相对于前一版本的改进和新特性。 Maven 3.8.3 版本可能引入了一些新的特性和优化,比如性能提升、bug修复或者对新Java版本的支持。开发者在使用这个源码包时,首先需要...

      apache-maven-3.2.2-bin.tar.gz

      6. `RELEASE-NOTES.txt`:Maven 3.2.2版本的发布说明,列出了新特性、改进和已知问题。 Maven的命令行接口(CLI)非常强大,支持多种操作,例如: - `mvn install`:将项目打包并安装到本地仓库。 - `mvn clean`:...

      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

      apache-maven-3.3.9

      5. `README`或`RELEASE-NOTES`: 提供版本发布说明和更新内容。 了解和掌握Apache Maven对于Java开发者来说至关重要,因为它可以提升开发效率,确保项目的一致性和可维护性。Maven 3.3.9作为稳定版本,为开发者提供...

      Maven information

      Maven的发行说明记录了每个版本的具体变更细节,可以在官方网站的[发行笔记页面](http://maven.apache.org/release-notes.html)查看。这些变更记录对于用户了解新版本的功能改进、bug修复以及其他重要更新非常有用。...

      apache-maven-3.5.0.rar|apache-maven-3.5.0.rar

      5. **README和RELEASE-NOTES文件**:提供了关于该版本的简要说明和发布说明,包括新功能、已知问题和升级指南。 6. **docs目录**:可能包含Maven的用户指南、开发者指南和其他文档,帮助用户理解和使用Maven。 7. ...

      nnzbz#notes#maven常用插件1

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

      Maven 下载、安装、配置与使用教程.docx

      - `RELEASE-NOTES.txt`:版本更新日志文件。 #### 四、配置环境变量 为了能在命令行中全局使用 Maven,需要配置环境变量。 ##### Windows 系统 1. **打开系统属性**:右键点击“此电脑”图标,选择“属性”,再...

    Global site tag (gtag.js) - Google Analytics