日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

maven的scm插件介绍及使用示例

發(fā)布時(shí)間:2024/8/1 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 maven的scm插件介绍及使用示例 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

格式說明

scm:svn:svn://[username[:password]@]server_name[:port]/path_to_repository
scm:svn:svn+ssh://[username@]server_name[:port]/path_to_repository
scm:svn:file://[hostname]/path_to_repository
scm:svn:http://[username[:password]@]server_name[:port]/path_to_repository
scm:svn:https://[username[:password]@]server_name[:port]/path_to_repository

Examples

scm:svn:file:///svn/root/module
scm:svn:file://localhost/path_to_repository
scm:svn:file://my_server/path_to_repository
scm:svn:http://svn.apache.org/svn/root/module
scm:svn:https://username@svn.apache.org/svn/root/module
scm:svn:https://username:password@svn.apache.org/svn/root/module

Maven中為我們集成了軟件配置管理的(SCM:Software Configuration Management)功能,他可以支持我們常用SVN、CVS等,到現(xiàn)在我使用的1.8.1版本,共支持18個(gè)命令:
scm:branch - branch the project(創(chuàng)建項(xiàng)目的分支)
scm:validate - validate the scm information in the pom(校驗(yàn)SCM的配置信息)
scm:add - command to add file(增加一個(gè)文件)
scm:unedit - command to stop editing the working copy(停止編輯當(dāng)前COPY)
scm:export - command to get a fresh exported copy(拉一個(gè)全新的分支)
scm:bootstrap - command to checkout and build a project(checkout并編譯工程)
scm:changelog - command to show the source code revisions(顯示源碼版本)
scm:list - command for get the list of project files(列出工程的文件)
scm:checkin - command for commiting changes(提交變更)
scm:checkout - command for getting the source code(獲取源碼)
scm:status - command for showing the scm status of the working copy(獲取本地項(xiàng)目的狀態(tài))
scm:update - command for updating the working copy with the latest changes(從服務(wù)器獲取最新的版本)
scm:diff - command for showing the difference of the working copy with the remote one(比較本地與遠(yuǎn)程服務(wù)器的差異)
scm:update-subprojects - command for updating all projects in a multi project build(更新子項(xiàng)目)
scm:edit - command for starting edit on the working copy(編輯)
scm:tag - command for tagging a certain revision(打標(biāo)簽)
常用命令介紹
而我們常用只有以下這兩個(gè)命令:
Usage
The SCM Plugin maps a lot of commands to a variety of scm implementations. But there are only 2 frequently used commands:
checkin - 提交變更
update - 從服務(wù)器上獲取最新的版本
配置及使用
其它的SCM都有自己獨(dú)特的命令來操作提交變更、或從服務(wù)器上獲取最新的源嗎,如SVN及CVS的操作就很不相同,使用Maven擔(dān)任的SCM機(jī)制,就可以使得SCM的操作變得統(tǒng)一,以下是一個(gè)SVN配置示例,將以下的示例配置到pom.xml文件中


jar
1.0-SNAPSHOT
SCM Sample Project
http://somecompany.com

scm:svn:http://somerepository.com/svn_repo/trunk
scm:svn:https://somerepository.com/svn_repo/trunk
http://somerepository.com/view.cvs



照這樣配置好的,現(xiàn)在我們要做提交或者更新,就按如下按行命令
提交:
mvn -Dmessage=”” scm:checkin
獲取最新版本:
mvn scm:update
SCM支持的連接類型
SCM支持兩種連接類型:connection 及 developerConnection。
以下是一個(gè)連接類型為connection的配置示例:



[…]


org.apache.maven.plugins
maven-scm-plugin
1.8.1

connection







以下是一個(gè)連接類型為developerConnection的配置示例:






org.apache.maven.plugins
maven-scm-plugin
1.8.1

developerConnection






總結(jié)

以上是生活随笔為你收集整理的maven的scm插件介绍及使用示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。