乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      使用maven2 進(jìn)行團(tuán)隊(duì)配置

       figol 2007-01-08
          對(duì)于團(tuán)隊(duì)來(lái)說(shuō),建立統(tǒng)一的開(kāi)發(fā)環(huán)境是必須的,而maven能很好幫助建立統(tǒng)一的環(huán)境。下面就介紹如何更有效的進(jìn)行統(tǒng)一的配置。
      準(zhǔn)備工作:
         下載必須的軟件:
      maven2: http://maven./download.html 最主要的
      maven-proxy:用來(lái)代理repository,使用代理來(lái)訪問(wèn)多個(gè)遠(yuǎn)程庫(kù)
                  http://maven-proxy./
      continuum:一個(gè)不錯(cuò)的持續(xù)整合工具,用于自動(dòng)build。支持ant,maven
      http://maven./continuum/
      svn:版本控制工具

      創(chuàng)建一致的開(kāi)發(fā)環(huán)境
         在共享的開(kāi)發(fā)環(huán)境中,更好的建議是保持maven的兩個(gè)不同的配置文件分別管理,包括共享和用戶自定義設(shè)置。共同的配置包括在安裝目錄中,而單獨(dú)的開(kāi)發(fā)設(shè)置保存在用戶本地目錄。
          全局的配置文件settings.xml
      xml 代碼
      1.    <servers>  
      2.        //公司內(nèi)部庫(kù),所有的release版本,serverid對(duì)應(yīng)于repository id,用于在deploy時(shí),訪問(wèn)使用,主要保存用戶名和密碼  
      3. <server>  
      4. <id>internal</id>  
      5. <username>${website.username}</username>  
      6. <password>${website.pwd}</password>  
      7. <filePermissions>664</filePermissions>  
      8. <directoryPermissions>775</directoryPermissions>  
      9. </server>  
      10. //目前的開(kāi)發(fā)庫(kù),用于snapshot庫(kù)  
      11. <server>  
      12. <id>snapshot</id>  
      13. <username>${website.username}</username>  
      14. <password>${website.pwd}</password>  
      15. <filePermissions>664</filePermissions>  
      16. <directoryPermissions>775</directoryPermissions>  
      17. </server>  
      18. </servers>  
      19.   
      20. <profiles>  
      21. <!--定義核心庫(kù) maven 鏡像,由maven-proxy實(shí)現(xiàn)-->  
      22. <profile>  
      23. <id>central-repo</id>  
      24. <repositories>  
      25. <repository>  
      26. <id>central</id>  
      27. <name>Internal Repository</name>  
      28. <url>http://192.168.0.2:9999/repository</url>  
      29. </repository>  
      30. </repositories>  
      31. <pluginRepositories>  
      32. <pluginRepository>  
      33. <id>central</id>  
      34. <name>Internal Repository</name>  
      35. <url>http://192.168.0.2:9999/repository</url>  
      36. </pluginRepository>  
      37. </pluginRepositories>  
      38. </profile>  
      39.   
      40. <!--定義內(nèi)部庫(kù),包括公司的所有release版本-->  
      41. <profile>  
      42. <id>internal-repo</id>  
      43. <repositories>  
      44. <repository>  
      45. <id>internal</id>  
      46. <name>Internal Repository</name>  
      47. <url>http://192.168.0.2:8080/repo-local</url>  
      48. <releases>  
      49. <enabled>true</enabled>  
      50. <updatePolicy>never</updatePolicy>  
      51. <checksumPolicy>warn</checksumPolicy>  
      52. </releases>  
      53. </repository>  
      54. </repositories>  
      55. <pluginRepositories>  
      56. <pluginRepository>  
      57. <id>internal</id>  
      58. <name>Internal Plugin Repository</name>  
      59. <url>http://192.168.0.2:8080/repo-local</url>  
      60. <releases>  
      61. <enabled>true</enabled>  
      62. <updatePolicy>never</updatePolicy>  
      63. <checksumPolicy>warn</checksumPolicy>  
      64. </releases>  
      65. </pluginRepository>  
      66. </pluginRepositories>  
      67. </profile>  
      68. <!--定義內(nèi)部開(kāi)發(fā)庫(kù) ,也可以合并snapshot和release-->  
      69. <profile>  
      70. <id>snapshot-repo</id>  
      71. <repositories>  
      72. <repository>  
      73. <id>snapshot</id>  
      74. <name>Internal Repository</name>  
      75. <url>http://192.168.0.2:8080/repo-snapshot</url>  
      76. <snapshots>  
      77. <enabled>true</enabled>  
      78. <updatePolicy>interval:60</updatePolicy>  
      79. <checksumPolicy>warn</checksumPolicy>  
      80. </snapshots>  
      81. </repository>  
      82. </repositories>  
      83. <pluginRepositories>  
      84. <pluginRepository>  
      85. <id>snapshot</id>  
      86. <name>Internal Plugin Repository</name>  
      87. <url>http://192.168.0.2:8080/repo-snapshot</url>  
      88. <snapshots>  
      89. <enabled>true</enabled>  
      90. <updatePolicy>interval:60</updatePolicy>  
      91. <checksumPolicy>warn</checksumPolicy>  
      92. </snapshots>  
      93. </pluginRepository>  
      94. </pluginRepositories>  
      95. </profile>  
      96. </profiles>  
      97. <!-- 激活相應(yīng)得配置-->  
      98. <activeProfiles>  
      99. <activeProfile>central-repo</activeProfile>  
      100. <activeProfile>internal-repo</activeProfile>  
      101. <activeProfile>snapshot-repo</activeProfile>  
      102. </activeProfiles>  
      103. <!-- 插件默認(rèn)groupId -->  
      104. <pluginGroups>  
      105. <pluginGroup>com.mycompany.plugins</pluginGroup>  
      106. </pluginGroups>  

      包括了以下的共享因素:
      服務(wù)器設(shè)置典型是共同的,只有用戶名需要在用戶環(huán)境中設(shè)置。使用一致的定義來(lái)配置共同的設(shè)置
      profile定義了共同的因素,內(nèi)部開(kāi)發(fā)庫(kù),包括指定的組織或者部門(mén)發(fā)布的產(chǎn)品。這些庫(kù)獨(dú)立于核心開(kāi)發(fā)庫(kù)。
      激活的profiles列表,用于激活相應(yīng)的profile
      plugin 組只有當(dāng)你的組織中有自己定義的插件,用于命令行運(yùn)行在pom中定義。

      對(duì)于單獨(dú)的用戶來(lái)說(shuō),設(shè)置如下:
      xml 代碼
      1. <settings>  
      2. <profiles>  
      3. <profile>  
      4. <id>property-overrides</id>  
      5. <properties>  
      6. <website.username>myuser</website.username>  
      7. <website.pwd>test</website.username>  
      8. </properties>  
      9. </profile>  
      10. </profiles>  
      11. </settings>  

      創(chuàng)建共享開(kāi)發(fā)庫(kù)
          大多數(shù)組織將會(huì)創(chuàng)建自己的內(nèi)部開(kāi)發(fā)庫(kù),用于配置,而中心開(kāi)發(fā)庫(kù)用于連接maven
          設(shè)置內(nèi)部開(kāi)發(fā)庫(kù)是簡(jiǎn)單的,使用http協(xié)議,可以使用存在的http 服務(wù)器?;蛘邉?chuàng)建新的服務(wù),使用apache,或者jetty
          假設(shè)服務(wù)器地址192.168.0.2 ,端口8080
          http://192.168.0.2:8080/repo-local
          設(shè)置另外一個(gè)開(kāi)發(fā)庫(kù),用于設(shè)置項(xiàng)目的snapshot庫(kù)http://192.168.0.2:8080/repo-snapshot
          中心鏡像庫(kù),使用maven-proxy創(chuàng)建,當(dāng)然也可以創(chuàng)建自己的鏡像。用于下載本地庫(kù)中沒(méi)有的artifact
      maven-proxy 設(shè)置
          從網(wǎng)上直接下載maven-proxy-standalone-0.2-app.jar和 proxy.properties
          在命令行中,直接運(yùn)行java -jar maven-proxy-standalone-0.2-app.jar  proxy.properties
      主要的配置:
      設(shè)置repo.list 中增加相應(yīng)的庫(kù)就可以,如下定義:
      repo.list=repo1.,...
      #maven 的中心庫(kù)
      repo.repo1..url=http://repo1./maven2
      repo.repo1..description=
      repo.repo1..proxy=one
      repo.repo1..hardfail=false
      repo.repo1..cache.period=360000
      repo.repo1..cache.failures=true
      以后所有的遠(yuǎn)程庫(kù),都通過(guò)此方式增加。順便說(shuō)一下,不要忘了注釋原來(lái)的example,那是沒(méi)有辦法訪問(wèn)的。

      其他配置如
      端口號(hào) port=9999
      保存的位置 repo.local.store=target/repo
      serverName=http://localhost:9999

      創(chuàng)建標(biāo)準(zhǔn)的組織pom
      定義共同的內(nèi)容,包括公司的結(jié)構(gòu),如組織,部門(mén)以及團(tuán)隊(duì)。
      察看一下maven 的自身,可以作為很好的參考。
      如scm
       
      xml 代碼
      1. <project>  
      2. <modelVersion>4.0.0</modelVersion>  
      3. <parent>  
      4. <groupId>org.apache.maven</groupId>  
      5. <artifactId>maven-parent</artifactId>  
      6. <version>1</version>  
      7. </parent>  
      8. <groupId>org.apache.maven.scm</groupId>  
      9. <artifactId>maven-scm</artifactId>  
      10. <url>http://maven./maven-scm/</url>  
      11. ...  
      12. <modules>  
      13. <module>maven-scm-api</module>  
      14. <module>maven-scm-providers</module>  
      15. ...  
      16. </modules>  
      17. </project>      
       

      在maven父項(xiàng)目中可以看到如下定義:
       
      xml 代碼
      1. <project>  
      2. <modelVersion>4.0.0</modelVersion>  
      3. <parent>  
      4. <groupId>org.apache</groupId>  
      5. <artifactId>apache</artifactId>  
      6. <version>1</version>  
      7. </parent>  
      8. <groupId>org.apache.maven</groupId>  
      9. <artifactId>maven-parent</artifactId>  
      10. <version>5</version>  
      11. <url>http://maven./</url>  
      12. ...  
      13. <mailingLists>  
      14. <mailingList>  
      15. <name>Maven Announcements List</name>  
      16. <post>announce@maven.</post>  
      17. ...  
      18. </mailingList>  
      19. </mailingLists>  
      20. <developers>  
      21. <developer>  
      22. ...  
      23. </developer>  
      24. </developers>  
      25. </project>       

      maven 父pom包括了共享的元素,如聲明郵件列表,開(kāi)發(fā)者。并且大多數(shù)項(xiàng)目繼承apache組織:
       
      xml 代碼
      1. <project>  
      2. <modelVersion>4.0.0</modelVersion>  
      3. <groupId>org.apache</groupId>  
      4. <artifactId>apache</artifactId>  
      5. <version>1</version>  
      6. <organization>  
      7. <name>Apache Software Foundation</name>  
      8. <url>http://www./</url>  
      9. </organization>  
      10. <url>http://www./</url>  
      11. ...  
      12. <repositories>  
      13. <repository>  
      14. <id>apache.snapshots</id>  
      15. <name>Apache Snapshot Repository</name>  
      16. <url>http://svn./maven-snapshot-repository</url>  
      17. <releases>  
      18. <enabled>false</enabled>  
      19. </releases>  
      20. </repository>  
      21. </repositories>  
      22. ...  
      23. <distributionManagement>  
      24. <repository>  
      25. ...  
      26. </repository>  
      27. <snapshotRepository>  
      28. ...  
      29. </snapshotRepository>  
      30. </distributionManagement>  
      31. </project>       

      對(duì)于項(xiàng)目自身來(lái)說(shuō),父pom很少更新。所以,最后的方式保存父pom文件在單獨(dú)的版本控制區(qū)域,它們能夠check out,更改和配置
      使用Continuum持久整合
          持續(xù)整合自動(dòng)build你的項(xiàng)目,通過(guò)一定的時(shí)間,包括所有的沖突在早期察覺(jué),而不是發(fā)布的時(shí)候。另外持續(xù)整合也是一種很好的開(kāi)發(fā)方式,使團(tuán)隊(duì)成員能產(chǎn)生細(xì)微的,交互的變動(dòng),能更有效的支持平行開(kāi)發(fā)進(jìn)程。
          可以使用maven的continuum作為持久整合的服務(wù)。
          安裝continuum,比較簡(jiǎn),使用以下的命令:
          C:\mvnbook\continuum-1.0.3> bin\win32\run
          可以通過(guò)http://localhost:8082/continuum來(lái)驗(yàn)證
          為了支持continuum 發(fā)送e-mail提醒,你需要相應(yīng)的smtp服務(wù)用于發(fā)送信息。默認(rèn)使用localhost:25,如果你沒(méi)有設(shè)置,編輯上面的文件改變smtp-host設(shè)置。
          下一步,設(shè)置svn目錄:
          svn co file://localhost/C:/mvnbook/svn/proficio/trunk proficio
          編輯pom.xml用于正確相應(yīng)得e-mail地址。
       
      xml 代碼
      1. ...  
      2. <ciManagement>  
      3. <system>continuum</system>  
      4. <url>http://localhost:8080/continuum  
      5. <notifiers>  
      6. <notifier>  
      7. <type>mail</type>  
      8. <configuration>  
      9. <address>youremail@yourdomain.com</address>  
      10. </configuration>  
      11. </notifier>  
      12. </notifiers>  
      13. </ciManagement>  
      14. ...  
      15. <scm>  
      16. <connection>  
      17. scm:svn:file://localhost/c:/mvnbook/svn/proficio/trunk  
      18. </connection>  
      19. <developerConnection>  
      20. scm:svn:file://localhost/c:/mvnbook/svn/proficio/trunk  
      21. </developerConnection>  
      22. </scm>  
      23. ...  
      24. <distributionManagement>  
      25. <site>  
      26. <id>website</id>  
      27. <url>  
      28. file://localhost/c:/mvnbook/repository/sites/proficio  
      29. /reference/${project.version}  
      30. </url>  
      31. </site>  
      32. </distributionManagement>      
       

      提交相應(yīng)的pom,然后執(zhí)行mvn install
      如果你返回http://localhost:8082/continuum,你會(huì)看到相應(yīng)的項(xiàng)目列表。
      一旦你登錄后,你可以選擇mavan 2.0項(xiàng)目用于增加相應(yīng)的項(xiàng)目。你可以增加你的url或者提交你的本地內(nèi)容。
      你可以使用本地pom url,如下file://localhost/c:mvnbook/proficio/pom.xml
      在提交了此url后,continuum將會(huì)返回相應(yīng)的成功信息。
      以下的原則用于更好的幫助持續(xù)整合:
      早提交,經(jīng)常提交:當(dāng)用戶經(jīng)常提交時(shí),持續(xù)整合是最有效的。這并不意味著,提交不正確的代碼。
      經(jīng)常運(yùn)行build:用于最快檢測(cè)失敗
      盡快修正失?。寒?dāng)失敗發(fā)生時(shí),應(yīng)該馬上修正失敗
      建議一個(gè)有效的版本
      運(yùn)行clean build
      運(yùn)行復(fù)雜的綜合測(cè)試
      build所有的項(xiàng)目結(jié)構(gòu)分支
      持續(xù)運(yùn)行項(xiàng)目的拷貝

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類似文章 更多