鍒涘緩涓鑷寸殑寮鍙戠幆澧?/b>
聽(tīng)聽(tīng)
聽(tīng)聽(tīng)聽(tīng) 鍦ㄥ叡浜殑寮鍙戠幆澧冧腑錛屾洿濂界殑寤鴻鏄繚鎸乵aven鐨勪袱涓笉鍚岀殑閰嶇疆鏂囦歡鍒嗗埆綆$悊錛屽寘鎷叡浜拰鐢ㄦ埛鑷畾涔夎緗傚叡鍚岀殑閰嶇疆鍖呮嫭鍦ㄥ畨瑁呯洰褰曚腑錛岃屽崟鐙殑寮鍙戣緗繚瀛樺湪鐢ㄦ埛鏈湴鐩綍銆?br />聽(tīng)聽(tīng)聽(tīng)
聽(tīng)聽(tīng)聽(tīng) 鍏ㄥ眬鐨勯厤緗枃浠秙ettings.xml
聽(tīng)聽(tīng)
<servers>
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) //鍏徃鍐呴儴搴擄紝鎵鏈夌殑release鐗堟湰,serverid瀵瑰簲浜巖epository id錛岀敤浜庡湪deploy鏃訛紝璁塊棶浣跨敤錛屼富瑕佷繚瀛樼敤鎴峰悕鍜屽瘑鐮?br /><server>
<id>internal</id>
<username>${website.username}</username>
<password>${website.pwd}</password>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
</server>
//鐩墠鐨勫紑鍙戝簱錛岀敤浜巗napshot搴?br /><server>
<id>snapshot</id>
<username>${website.username}</username>
<password>${website.pwd}</password>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
</server>
</servers>
<profiles>
<!--瀹氫箟鏍稿績(jī)搴?maven 闀滃儚,鐢眒aven-proxy瀹炵幇-->
<profile>
<id>central-repo</id>
<repositories>
<repository>
<id>central</id>
<name>Internal Repository</name>
<url>http://192.168.0.2:9999/repository</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Internal Repository</name>
<url>http://192.168.0.2:9999/repository</url>
</pluginRepository>
</pluginRepositories>
</profile>
<!--瀹氫箟鍐呴儴搴擄紝鍖呮嫭鍏徃鐨勬墍鏈塺elease鐗堟湰-->
<profile>
<id>internal-repo</id>
<repositories>
<repository>
<id>internal</id>
<name>Internal Repository</name>
<url>http://192.168.0.2:8080/repo-local</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>internal</id>
<name>Internal Plugin Repository</name>
<url>http://192.168.0.2:8080/repo-local</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
<!--瀹氫箟鍐呴儴寮鍙戝簱 錛屼篃鍙互鍚堝茍snapshot鍜宺elease-->
<profile>
<id>snapshot-repo</id>
<repositories>
<repository>
<id>snapshot</id>
<name>Internal Repository</name>
<url>http://192.168.0.2:8080/repo-snapshot</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>interval:60</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>snapshot</id>
<name>Internal Plugin Repository</name>
<url>http://192.168.0.2:8080/repo-snapshot</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>interval:60</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<!-- 嬋媧葷浉搴斿緱閰嶇疆-->
<activeProfiles>
<activeProfile>central-repo</activeProfile>
<activeProfile>internal-repo</activeProfile>
<activeProfile>snapshot-repo</activeProfile>
</activeProfiles>
<!-- 鎻掍歡榛樿groupId -->
<pluginGroups>
<pluginGroup>com.mycompany.plugins</pluginGroup>
</pluginGroups>
鍖呮嫭浜?jiǎn)浠ヤ笅鐨勫呑冺n鍥犵礌錛?br />
- 鏈嶅姟鍣ㄨ緗吀鍨嬫槸鍏卞悓鐨勶紝鍙湁鐢ㄦ埛鍚嶉渶瑕佸湪鐢ㄦ埛鐜涓緗備嬌鐢ㄤ竴鑷寸殑瀹氫箟鏉ラ厤緗叡鍚岀殑璁劇疆
- profile瀹氫箟浜?jiǎn)鍏卞悓鐨勫洜绱犲Q屽唴閮ㄥ紑鍙戝簱錛屽寘鎷寚瀹氱殑緇勭粐鎴栬呴儴闂ㄥ彂甯冪殑浜у搧銆傝繖浜涘簱鐙珛浜庢牳蹇?jī)寮鍙戝簱銆?/li>
- 嬋媧葷殑profiles鍒楄〃錛岀敤浜庢縺媧葷浉搴旂殑profile
- plugin 緇勫彧鏈夊綋浣犵殑緇勭粐涓湁鑷繁瀹氫箟鐨勬彃浠訛紝鐢ㄤ簬鍛戒護(hù)琛岃繍琛屽湪pom涓畾涔夈?/li>
瀵逛簬鍗曠嫭鐨勭敤鎴鋒潵璇達(dá)紝璁劇疆濡備笅錛?br />
<settings>
<profiles>
<profile>
<id>property-overrides</id>
<properties>
<website.username>myuser</website.username>
<website.pwd>test</website.username>
</properties>
</profile>
</profiles>
</settings>
鍒涘緩鍏變韓寮鍙戝簱
聽(tīng)聽(tīng)聽(tīng) 澶у鏁扮粍緇囧皢浼?xì)鍒涘圾檱忿q殑鍐呴儴寮鍙戝簱錛岀敤浜庨厤緗紝鑰屼腑蹇?jī)寮鍙戝簱鐢ㄤ簬榪炴帴maven
聽(tīng)聽(tīng)聽(tīng) 璁劇疆鍐呴儴寮鍙戝簱鏄畝鍗曠殑錛屼嬌鐢╤ttp鍗忚錛屽彲浠ヤ嬌鐢ㄥ瓨鍦ㄧ殑http 鏈嶅姟鍣ㄣ傛垨鑰呭垱寤烘柊鐨勬湇鍔★紝浣跨敤apache錛屾垨鑰卝etty
聽(tīng)聽(tīng)聽(tīng) 鍋囪鏈嶅姟鍣ㄥ湴鍧192.168.0.2 ,绔彛8080
聽(tīng)聽(tīng) 聽(tīng)http://192.168.0.2:8080/repo-local
聽(tīng)聽(tīng)聽(tīng) 璁劇疆鍙﹀涓涓紑鍙戝簱錛岀敤浜庤緗」鐩殑snapshot搴揾ttp://192.168.0.2:8080/repo-snapshot
聽(tīng)聽(tīng)聽(tīng) 涓績(jī)闀滃儚搴擄紝浣跨敤maven-proxy鍒涘緩錛屽綋鐒朵篃鍙互鍒涘緩鑷繁鐨勯暅鍍忋傜敤浜庝笅杞芥湰鍦板簱涓病鏈夌殑artifact
maven-proxy 璁劇疆
聽(tīng)聽(tīng)聽(tīng) 浠庣綉涓婄洿鎺ヤ笅杞絤aven-proxy-standalone-0.2-app.jar鍜?proxy.properties
聽(tīng)聽(tīng)聽(tīng) 鍦ㄥ懡浠よ涓紝鐩存帴榪愯java -jar maven-proxy-standalone-0.2-app.jar聽(tīng) proxy.properties
涓昏鐨勯厤緗細(xì)
璁劇疆repo.list 涓鍔犵浉搴旂殑搴撳氨鍙互錛屽涓嬪畾涔夛細(xì)
repo.list=repo1.maven.org,...
#maven 鐨勪腑蹇?jī)搴?br />repo.repo1.maven.org.url=http://repo1.maven.org/maven2
repo.repo1.maven.org.description=maven.org
repo.repo1.maven.org.proxy=one
repo.repo1.maven.org.hardfail=false
repo.repo1.maven.org.cache.period=360000
repo.repo1.maven.org.cache.failures=true
浠ュ悗鎵鏈夌殑榪滅▼搴擄紝閮介氳繃姝ゆ柟寮忓鍔犮傞『渚胯涓涓嬶紝涓嶈蹇樹(shù)簡(jiǎn)娉ㄩ噴鍘熸潵鐨別xample錛岄偅鏄病鏈夊姙娉曡闂殑銆?br />
鍏朵粬閰嶇疆濡?br />绔彛鍙?port=9999
淇濆瓨鐨勪綅緗?repo.local.store=target/repo
serverName=http://localhost:9999
鍒涘緩鏍囧噯鐨勭粍緇噋om
瀹氫箟鍏卞悓鐨勫唴瀹癸紝鍖呮嫭鍏徃鐨勭粨鏋勶紝濡傜粍緇囷紝閮ㄩ棬浠ュ強(qiáng)鍥㈤槦銆?br />瀵熺湅涓涓媘aven 鐨勮嚜韜紝鍙互浣滀負(fù)寰堝ソ鐨勫弬鑰冦?br />濡俿cm
聽(tīng)
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
<version>1</version>
</parent>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm</artifactId>
<url>http://maven.apache.org/maven-scm/</url>
...
<modules>
<module>maven-scm-api</module>
<module>maven-scm-providers</module>
...
</modules>
</project>聽(tīng)聽(tīng) 聽(tīng)
鍦╩aven鐖墮」鐩腑鍙互鐪嬪埌濡備笅瀹氫箟錛?
聽(tīng)
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>1</version>
</parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
<version>5</version>
<url>http://maven.apache.org/</url>
...
<mailingLists>
<mailingList>
<name>Maven Announcements List</name>
<post>announce@maven.apache.org</post>
...
</mailingList>
</mailingLists>
<developers>
<developer>
...
</developer>
</developers>
</project>聽(tīng)聽(tīng) 聽(tīng)
maven 鐖秔om鍖呮嫭浜?jiǎn)鍏变韩鐨勫厓绱犲Q屽澹版槑閭歡鍒楄〃錛屽紑鍙戣呫傚茍涓斿ぇ澶氭暟欏圭洰緇ф壙apache緇勭粐錛?br />聽(tīng)
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>1</version>
<organization>
<name>Apache Software Foundation</name>
<url>http://www.apache.org/</url>
</organization>
<url>http://www.apache.org/</url>
...
<repositories>
<repository>
<id>apache.snapshots</id>
<name>Apache Snapshot Repository</name>
<url>http://svn.apache.org/maven-snapshot-repository</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
...
<distributionManagement>
<repository>
...
</repository>
<snapshotRepository>
...
</snapshotRepository>
</distributionManagement>
</project>聽(tīng)聽(tīng) 聽(tīng)
瀵逛簬欏圭洰鑷韓鏉ヨ錛岀埗pom寰堝皯鏇存柊銆傛墍浠ワ紝鏈鍚庣殑鏂瑰紡淇濆瓨鐖秔om鏂囦歡鍦ㄥ崟鐙殑鐗堟湰鎺у埗鍖哄煙錛屽畠浠兘澶焎heck out錛屾洿鏀瑰拰閰嶇疆.
浣跨敤Continuum鎸佷箙鏁村悎
聽(tīng)聽(tīng)聽(tīng) 鎸佺畫(huà)鏁村悎鑷姩build浣犵殑欏圭洰錛岄氳繃涓瀹氱殑鏃墮棿錛屽寘鎷墍鏈夌殑鍐茬獊鍦ㄦ棭鏈熷療瑙夛紝鑰屼笉鏄彂甯冪殑鏃跺欍傚彟澶栨寔緇暣鍚堜篃鏄竴縐嶅緢濂界殑寮鍙戞柟寮忥紝浣垮洟闃熸垚鍛樿兘浜х敓緇嗗井鐨勶紝浜や簰鐨勫彉鍔紝鑳芥洿鏈夋晥鐨勬敮鎸佸鉤琛屽紑鍙戣繘紼嬨?br />聽(tīng)聽(tīng)聽(tīng) 鍙互浣跨敤maven鐨刢ontinuum浣滀負(fù)鎸佷箙鏁村悎鐨勬湇鍔°?br />聽(tīng)聽(tīng)聽(tīng) 瀹夎continuum錛屾瘮杈冪畝錛屼嬌鐢ㄤ互涓嬬殑鍛戒護(hù)錛?br />聽(tīng)聽(tīng)聽(tīng) C:\mvnbook\continuum-1.0.3> bin\win32\run
聽(tīng)聽(tīng)聽(tīng) 鍙互閫氳繃http://localhost:8082/continuum鏉ラ獙璇?br />聽(tīng)聽(tīng)聽(tīng) 涓轟簡(jiǎn)鏀寔continuum 鍙戦乪-mail鎻愰啋錛屼綘闇瑕佺浉搴旂殑smtp鏈嶅姟鐢ㄤ簬鍙戦佷俊鎭傞粯璁や嬌鐢╨ocalhost:25錛屽鏋滀綘娌℃湁璁劇疆錛岀紪杈戜笂闈㈢殑鏂囦歡鏀瑰彉smtp-host璁劇疆銆?br />聽(tīng)聽(tīng)聽(tīng) 涓嬩竴姝ワ紝璁劇疆svn鐩綍錛?br />聽(tīng)聽(tīng)聽(tīng) svn co file://localhost/C:/mvnbook/svn/proficio/trunk proficio
聽(tīng)聽(tīng)聽(tīng) 緙栬緫pom.xml鐢ㄤ簬姝g‘鐩稿簲寰梕-mail鍦板潃銆?
聽(tīng)
...
<ciManagement>
<system>continuum</system>
<url>http://localhost:8080/continuum
<notifiers>
<notifier>
<type>mail</type>
<configuration>
<address>youremail@yourdomain.com</address>
</configuration>
</notifier>
</notifiers>
</ciManagement>
...
<scm>
<connection>
scm:svn:file://localhost/c:/mvnbook/svn/proficio/trunk
</connection>
<developerConnection>
scm:svn:file://localhost/c:/mvnbook/svn/proficio/trunk
</developerConnection>
</scm>
...
<distributionManagement>
<site>
<id>website</id>
<url>
file://localhost/c:/mvnbook/repository/sites/proficio
/reference/${project.version}
</url>
</site>
</distributionManagement>聽(tīng)聽(tīng) 聽(tīng)
鎻愪氦鐩稿簲鐨刾om,鐒跺悗鎵цmvn install
濡傛灉浣犺繑鍥瀐ttp://localhost:8082/continuum錛屼綘浼?xì)鐪嬪埌鐩稿簲鐨剻骞鐩垪琛ㄣ?br />
涓鏃︿綘鐧誨綍鍚庯紝浣犲彲浠ラ夋嫨mavan 2.0欏圭洰鐢ㄤ簬澧炲姞鐩稿簲鐨勯」鐩備綘鍙互澧炲姞浣犵殑url鎴栬呮彁浜や綘鐨勬湰鍦板唴瀹廣?br />
浣犲彲浠ヤ嬌鐢ㄦ湰鍦皃om url錛屽涓媐ile://localhost/c:mvnbook/proficio/pom.xml
鍦ㄦ彁浜や簡(jiǎn)姝rl鍚庯紝continuum灝嗕細(xì)榪斿洖鐩稿簲鐨勬垚鍔熶俊鎭?br />浠ヤ笅鐨勫師鍒欑敤浜庢洿濂界殑甯姪鎸佺畫(huà)鏁村悎錛?br />鏃╂彁浜わ紝緇忓父鎻愪氦錛氬綋鐢ㄦ埛緇忓父鎻愪氦鏃訛紝鎸佺畫(huà)鏁村悎鏄渶鏈夋晥鐨勩傝繖騫朵笉鎰忓懗鐫錛屾彁浜や笉姝g‘鐨勪唬鐮併?br />緇忓父榪愯build錛氱敤浜庢渶蹇嫻嬪け璐?br />灝藉揩淇澶辮觸錛氬綋澶辮觸鍙戠敓鏃訛紝搴旇椹笂淇澶辮觸
寤鴻涓涓湁鏁堢殑鐗堟湰
榪愯clean build
榪愯澶嶆潅鐨勭患鍚堟祴璇?br />build鎵鏈夌殑欏圭洰緇撴瀯鍒嗘敮
鎸佺畫(huà)榪愯欏圭洰鐨勬嫹璐?br />

]]>