2014-05-02 146 views
2

我有一些現有的Maven項目。Maven構建和發佈多個相互依賴的項目

它們是:

  1. AAA(插件)
  2. BBB(JAR)
  3. CCC(JAR)
  4. DDD(戰爭)
  5. EEE(戰爭)

項目ddd是爲客戶和eee是另一個

它們位於磁盤上的workspace/文件夾下的扁平結構中,並且在svn repo中有相同的結構。

這是該項目的依賴層次:

ddd (war)   
    aaa (plugin) 
    bbb (jar) 
    ccc (jar) 
     bbb (jar) 

eee (war) 
    ccc (jar) 
     bbb (jar) 

當只有war s爲SNAPSHOT那兒的建築並沒有什麼問題釋放

否則,即

ddd  1.1-SNAPSHOT (war)   
    aaa  2.0   (plugin) 
    bbb  2.1-SNAPSHOT (jar) 
    ccc  1.3-SNAPSHOT (jar) 
    bbb 2.1-SNAPSHOT (jar) 

我必須做的,用於建築物:

  1. bbb> mvn install
  2. ccc> mvn install
  3. ddd> mvn compile

和用於釋放:

  1. bbb> mvn release:prepare release:perform
  2. ccc> mvn versions:use-releases
  3. ccc> svn ci -m "updated SNAPSHOT dependencies"
  4. ccc> mvn release:prepare release:perform
  5. ddd> mvn versions:use-releases
  6. ddd> svn ci -m "updated SNAPSHOT dependencies"
  7. ddd> mvn release:prepare release:perform

我試圖與一個聚合,但

  • 上建築物,它編譯非快照依賴(AAA 2.0 - >編譯AAA 2 。1 - 拍攝)
  • 上釋放,它抱怨SCM,但我不希望聚合是在SVN

這就是我需要:

  • 單個命令建立
    • 訂單快照依賴條件
    • 安裝(或部署)每個快照依賴性
    • 構建(編譯或包或安裝...)根artifa CT
  • 單個命令發佈
    • 訂單快照依賴
    • 釋放每個快照依賴
    • 發佈根神器

這是我希望:

  • 批構建/發佈腳本SVN
  • 放聚合
  • 項目之間共享版
  • 母公司成爲一個匯聚太

這可能嗎?

其他最佳實踐? (也許詹金斯將幫助?)

我應該切換到Gradle?


更新

我看到你們大多數人都混淆聚合,所以我從這個問題,刪除它。然而,

[...]您經常會看到父母和聚合器的項目。 [...]然而,雖然聚甲醛項目,聚合項目和父項目都不是相同的,不應該混淆。 POM項目可以繼承 - 但不一定有 - 它聚合的任何模塊。相反,POM項目可以合併不從其繼承的項目。

A final note on Inheritance v. Aggregation

+2

你在'聚合器'下了解什麼?您應該考慮真正與多模塊構建工作,並根據您的真實結構更改SVN中的結構。版本共享是什麼意思? – khmarbaise

+1

@khmarbaise多模塊應該使用時,模塊將*總是*一起發佈,而不是作爲一個簡單的命令建立一個簡單的。根據我的經驗,*永遠*很少是這種情況 –

+0

@NickHolt我沒有說過用它作爲捷徑。它看起來越來越像一個多模塊構建,而操作正試圖繞過它。 – khmarbaise

回答

1

剛得到它在一個黑客的方式...但我不是滿意。

如果有人會提供一個更好的方法來對maven執行自定義的遞歸發佈過程,我會很樂意改變我的接受程度!

父POM:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.mycompany</groupId> 
    <artifactId>test-release-parent</artifactId> 
    <version>1-SNAPSHOT</version> 
    <packaging>pom</packaging> 

    <name>test-release-parent</name> 
    <description>This is the parent pom to test release procedure</description> 
    <inceptionYear>2014</inceptionYear> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
     <svn.repository>http://svn.mycompany.com/repo1</svn.repository> 
     <web.projects>http://www2.mycompany.com/projects</web.projects> 
    </properties> 

    <scm> 
     <developerConnection>scm:svn:${svn.repository}/${project.artifactId}</developerConnection> 
     <url>${svn.repository}/${project.artifactId}</url> 
    </scm> 

    <distributionManagement> 
     <repository> 
      <id>ftp.mycompany.com</id> 
      <name>mycompany Maven Repository</name> 
      <url>ftp://ftp.mycompany.com/maven-repo</url> 
     </repository> 
    </distributionManagement> 

    <repositories> 
     <repository> 
      <id>www2.mycompany.com</id> 
      <name>mycompany Maven Repository</name> 
      <url>http://www2.mycompany.com/maven-repo</url> 
     </repository> 
    </repositories> 

    <pluginRepositories> 
     <pluginRepository> 
      <id>www2.mycompany.com</id> 
      <name>mycompany Maven Repository</name> 
      <url>http://www2.mycompany.com/maven-repo</url> 
     </pluginRepository> 
    </pluginRepositories> 

    <dependencyManagement> 
     <dependencies> 
      <dependency> 
       <groupId>commons-io</groupId> 
       <artifactId>commons-io</artifactId> 
       <version>2.4</version> 
      </dependency> 
      <dependency> 
       <groupId>commons-codec</groupId> 
       <artifactId>commons-codec</artifactId> 
       <version>1.9</version> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 

    <build> 
     <pluginManagement> 
      <plugins> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-scm-plugin</artifactId> 
        <version>1.9</version> 
       </plugin> 

       <plugin> 
        <groupId>org.codehaus.mojo</groupId> 
        <artifactId>versions-maven-plugin</artifactId> 
        <version>2.1</version> 
        <configuration> 
         <excludes> 
          <exclude>javax:javaee-api:*:*</exclude> 
          <exclude>org.eclipse.persistence:*:*:*</exclude> 
          <exclude>org.hibernate:hibernate-validator:*:*</exclude> 
         </excludes> 
         <rulesUri>http://www.mycompany.com/ruleset.xml</rulesUri> 
        </configuration> 
       </plugin> 

       <plugin> 
        <groupId>org.codehaus.gmaven</groupId> 
        <artifactId>gmaven-plugin</artifactId> 
        <version>1.5</version> 
       </plugin> 
      </plugins> 
     </pluginManagement> 

     <plugins> 
      <plugin> 
       <groupId>org.codehaus.gmaven</groupId> 
       <artifactId>gmaven-plugin</artifactId> 
       <configuration> 
        <source> 
         String releaseVersion = project.version.substring(0, project.version.indexOf("-")); 

         String nextVersion; 
         int index = releaseVersion.lastIndexOf("."); 
         if(index == -1) nextVersion = (releaseVersion.toInteger() + 1) + "-SNAPSHOT"; 
         else 
         { 
          String prefix = releaseVersion.substring(0, index); 
          String suffix = releaseVersion.substring(index + 1); 

          nextVersion = prefix + "." + (suffix.toInteger() + 1) + "-SNAPSHOT"; 
         } 

         ant.exec(failonerror: "true", dir: "${basedir}", executable: "cmd") 
         { 
          arg(value: "/c") 
          arg(value: "mvn") 
          arg(value: "validate") 
          arg(value: "-Prelease-align") 
          arg(value: "-Dversion.release=" + releaseVersion) 
          arg(value: "-Dversion.next=" + nextVersion) 
         } 

         ant.exec(failonerror: "true", dir: "${basedir}", executable: "cmd") 
         { 
          arg(value: "/c") 
          arg(value: "mvn") 
          arg(value: "initialize") 
          arg(value: "-Prelease-prepare") 
          arg(value: "-Dversion.release=" + releaseVersion) 
          arg(value: "-Dversion.next=" + nextVersion) 
         } 

         ant.exec(failonerror: "true", dir: "${basedir}", executable: "cmd") 
         { 
          arg(value: "/c") 
          arg(value: "mvn") 
          arg(value: "deploy") 
          arg(value: "-Prelease-perform") 
          arg(value: "-Dversion.release=" + releaseVersion) 
          arg(value: "-Dversion.next=" + nextVersion) 
         } 
        </source> 
       </configuration> 
      </plugin> 
     </plugins> 

     <extensions> 
      <extension> 
       <groupId>org.apache.maven.wagon</groupId> 
       <artifactId>wagon-ftp</artifactId> 
       <version>2.6</version> 
      </extension> 
     </extensions> 
    </build> 

    <profiles> 
     <profile> 
      <id>buildall</id> 
      <build> 
       <plugins> 
        <plugin> 
         <groupId>org.codehaus.gmaven</groupId> 
         <artifactId>gmaven-plugin</artifactId> 
         <executions> 
          <execution> 
           <phase>validate</phase> 
           <goals> 
            <goal>execute</goal> 
           </goals> 
           <configuration> 
            <source> 
             for(d in project.dependencies) 
             { 
              if(d.groupId == "com.mycompany" &amp;&amp; d.version.endsWith("-SNAPSHOT")) 
              { 
               println "installing " + d 
               ant.exec(failonerror: "true", dir: "${basedir}/../" + d.artifactId, executable: "cmd") 
               { 
                arg(value: "/c") 
                arg(value: "mvn") 
                arg(value: "install") 
                arg(value: "-Pbuildall") 
               } 
              } 
             } 
            </source> 
           </configuration> 
          </execution> 
         </executions> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 

     <profile> 
      <id>release-align</id> 
      <build> 
       <plugins> 
        <plugin> 
         <groupId>org.codehaus.mojo</groupId> 
         <artifactId>versions-maven-plugin</artifactId> 
         <executions> 
          <execution> 
           <id>initial-updates</id> 
           <phase>validate</phase> 
           <goals> 
            <goal>update-parent</goal> 
            <goal>use-releases</goal> 
            <goal>commit</goal> 
           </goals> 
          </execution> 
         </executions> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 

     <profile> 
      <id>release-prepare</id> 
      <build> 
       <plugins> 
        <plugin> 
         <groupId>org.codehaus.gmaven</groupId> 
         <artifactId>gmaven-plugin</artifactId> 
         <executions> 
          <execution> 
           <id>release-snapshots</id> 
           <phase>validate</phase> 
           <goals> 
            <goal>execute</goal> 
           </goals> 
           <configuration> 
            <source> 
             if(project.parent != null &amp;&amp; project.parent.groupId == "com.mycompany" &amp;&amp; project.parent.version.endsWith("-SNAPSHOT")) 
             { 
              println "releasing " + project.parent 

              String releaseVersion = project.parent.version.substring(0, project.parent.version.indexOf("-")); 

              String nextVersion; 
              int index = releaseVersion.lastIndexOf("."); 
              if(index == -1) nextVersion = (releaseVersion.toInteger() + 1) + "-SNAPSHOT"; 
              else 
              { 
               String prefix = releaseVersion.substring(0, index); 
               String suffix = releaseVersion.substring(index + 1); 

               nextVersion = prefix + "." + (suffix.toInteger() + 1) + "-SNAPSHOT"; 
              } 

              ant.exec(failonerror: "true", dir: "${basedir}/../" + project.parent.artifactId, executable: "cmd") 
              { 
               arg(value: "/c") 
               arg(value: "mvn") 
               arg(value: "validate") 
               arg(value: "-Prelease-align") 
               arg(value: "-Dversion.release=" + releaseVersion) 
               arg(value: "-Dversion.next=" + nextVersion) 
              } 

              ant.exec(failonerror: "true", dir: "${basedir}/../" + project.parent.artifactId, executable: "cmd") 
              { 
               arg(value: "/c") 
               arg(value: "mvn") 
               arg(value: "initialize") 
               arg(value: "-Prelease-prepare") 
               arg(value: "-Dversion.release=" + releaseVersion) 
               arg(value: "-Dversion.next=" + nextVersion) 
              } 

              ant.exec(failonerror: "true", dir: "${basedir}/../" + project.parent.artifactId, executable: "cmd") 
              { 
               arg(value: "/c") 
               arg(value: "mvn") 
               arg(value: "deploy") 
               arg(value: "-Prelease-perform") 
               arg(value: "-Dversion.release=" + releaseVersion) 
               arg(value: "-Dversion.next=" + nextVersion) 
              } 
             } 

             for(d in project.dependencies) 
             { 
              if(d.groupId == "com.mycompany" &amp;&amp; d.version.endsWith("-SNAPSHOT")) 
              { 
               println "releasing " + d 

               String releaseVersion = d.version.substring(0, d.version.indexOf("-")); 

               String nextVersion; 
               int index = releaseVersion.lastIndexOf("."); 
               if(index == -1) nextVersion = (releaseVersion.toInteger() + 1) + "-SNAPSHOT"; 
               else 
               { 
                String prefix = releaseVersion.substring(0, index); 
                String suffix = releaseVersion.substring(index + 1); 

                nextVersion = prefix + "." + (suffix.toInteger() + 1) + "-SNAPSHOT"; 
               } 

               ant.exec(failonerror: "true", dir: "${basedir}/../" + d.artifactId, executable: "cmd") 
               { 
                arg(value: "/c") 
                arg(value: "mvn") 
                arg(value: "validate") 
                arg(value: "-Prelease-align") 
                arg(value: "-Dversion.release=" + releaseVersion) 
                arg(value: "-Dversion.next=" + nextVersion) 
               } 

               ant.exec(failonerror: "true", dir: "${basedir}/../" + d.artifactId, executable: "cmd") 
               { 
                arg(value: "/c") 
                arg(value: "mvn") 
                arg(value: "initialize") 
                arg(value: "-Prelease-prepare") 
                arg(value: "-Dversion.release=" + releaseVersion) 
                arg(value: "-Dversion.next=" + nextVersion) 
               } 

               ant.exec(failonerror: "true", dir: "${basedir}/../" + d.artifactId, executable: "cmd") 
               { 
                arg(value: "/c") 
                arg(value: "mvn") 
                arg(value: "deploy") 
                arg(value: "-Prelease-perform") 
                arg(value: "-Dversion.release=" + releaseVersion) 
                arg(value: "-Dversion.next=" + nextVersion) 
               } 
              } 
             } 
            </source> 
           </configuration> 
          </execution> 
         </executions> 
        </plugin> 
        <plugin> 
         <groupId>org.codehaus.mojo</groupId> 
         <artifactId>versions-maven-plugin</artifactId> 
         <executions> 
          <execution> 
           <id>final-updates</id> 
           <phase>initialize</phase> 
           <goals> 
            <goal>update-parent</goal> 
            <goal>use-releases</goal> 
            <goal>set</goal> 
            <goal>commit</goal> 
           </goals> 
           <configuration> 
            <newVersion>${version.release}</newVersion> 
           </configuration> 
          </execution> 
         </executions> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 

     <profile> 
      <id>release-perform</id> 
      <build> 
       <plugins> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-deploy-plugin</artifactId> 
        </plugin> 

        <plugin> 
         <groupId>org.codehaus.mojo</groupId> 
         <artifactId>versions-maven-plugin</artifactId> 
         <executions> 
          <execution> 
           <id>set-next-snapshot</id> 
           <phase>deploy</phase> 
           <goals> 
            <goal>set</goal> 
            <goal>commit</goal> 
           </goals> 
           <configuration> 
            <newVersion>${version.next}</newVersion> 
           </configuration> 
          </execution> 
         </executions> 
        </plugin> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-scm-plugin</artifactId> 
         <executions> 
          <execution> 
           <id>checkin-release</id> 
           <phase>verify</phase> 
           <goals> 
            <goal>checkin</goal> 
            <goal>tag</goal> 
           </goals> 
          </execution> 
          <execution> 
           <id>checkin-snapshot</id> 
           <phase>deploy</phase> 
           <goals> 
            <goal>checkin</goal> 
           </goals> 
          </execution> 
         </executions> 
         <configuration> 
          <tag>${project.version}</tag> 
          <message>auto-generated by release process</message> 
         </configuration> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 
    </profiles> 
</project> 

,這是一個項目POM使用另一個項目(弄平在工作區的結構)作爲依賴性

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <parent> 
     <groupId>com.mycompany</groupId> 
     <artifactId>test-release-parent</artifactId> 
     <version>1-SNAPSHOT</version> 
    </parent> 

    <modelVersion>4.0.0</modelVersion> 
    <artifactId>test-release-project</artifactId> 
    <version>1.0.0-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <name>${project.artifactId}</name> 
    <description>maven project to test a release process</description> 
    <inceptionYear>2014</inceptionYear> 
    <url>${web.projects}/${project.artifactId}</url> 

    <repositories> 
     <repository> 
      <id>www2.mycompany.com</id> 
      <name>mycompany Maven Repository</name> 
      <url>http://www2.mycompany.com/maven-repo</url> 
     </repository> 
    </repositories> 

    <scm> 
     <developerConnection>scm:svn:${svn.repository}/${project.artifactId}/trunk</developerConnection> 
     <url>${svn.repository}/${project.artifactId}/trunk</url> 
    </scm> 

    <dependencies> 
     <dependency> 
      <groupId>commons-io</groupId> 
      <artifactId>commons-io</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>commons-codec</groupId> 
      <artifactId>commons-codec</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>com.mycompany</groupId> 
      <artifactId>test-release-dependency</artifactId> 
      <version>1.0.0-SNAPSHOT</version> 
     </dependency> 
    </dependencies> 
</project> 

只需運行

mvn <some-phase> -Pbuildall 

到當前項目執行<some-phase>,執行上所有擁有和引用快照(父母和依賴性)

mvn groovy:execute 

執行釋放全資和引用的快照

背後的想法:

  • 程序發佈:
    1. 更新父版本(如果存在)
    2. 更新快照依賴性是否存在
    3. 如果父擁有和快照
      • 釋放(父)
    4. 每個擁有和快照依賴性
      • 釋放(依賴性)
    5. 更新父版本(現在必須存在)
    6. 更新owne d和快照依賴(現在必須存在)
    7. 集項目發行版本(即從1.0.0-快照1.0.0)
    8. 提交修改到SCM供應鏈管理
    9. 標籤凍結執行所有的Maven生命週期相直到部署
    10. 項目集下一版本(即從1.0.0到1.0.1-SNAPSHOT)
    11. 提交修改到SCM再次
+0

我已經做了類似的事情,但將它作爲一個單獨的腳本進行了外化(順便說一句,它也是常規)。我實際上已經嘗試了類似於你所做的一些事情,但發現它非常緩慢和越野車。因爲無法並行智能構建或使用持續集成服務器並行構建功能,所以速度較慢。版本插件也很慢。 Buggy,因爲版本/發佈插件有時會有更新版本的問題正確(你必須分叉,因爲pom正在改變)。 –

+0

@AdamGent最後,我用Java編寫了我自己的發佈工具,它使用命令行maven調用,僅用於* effective-pom * s和* clean deploy *,沒有發佈/無關的插件。 * versions-maven-plugin *和* maven-release-plugin *所做的所有工作實際上都是由Java代碼執行的。但是,當我有空閒時,我會檢查gradle並最終遷移我的所有項目。我對maven依賴管理非常滿意,但構建/發佈生命週期令人非常失望。 –

+0

是的釋放插件是...可怕的。我們也計劃殺死它。儘管Maven遇到了所有問題,但我仍然更喜歡Gradle。這聽起來很愚蠢,如果不是因爲Maven是如此聲明性的(即XML),我就不能編寫一個外部工具來完成所有依賴/發佈的東西。我做的一件事,我不知道你是否確實在釋放它們之前檢查上游依賴關係是否實際發生了變化(這實際上是相當訣竅)。 –

0

您還沒有提到,在你的父POM你正在使用的「模塊」標籤。我建議你應該使用它 - 這樣你可以指定項目的構建過程的排隊。

要解決您當前的問題,請創建單獨的模塊/項目。在pom中指定配置文件以觸發螞蟻操作。這應該做的伎倆。

你會呼籲父目錄mvn命令如下,即:

mvn clean install -Pdeploy 
+0

是的,我提到(在前面的問題修訂中)父母「沒有定義任何模塊」,我寫道我不希望父母也成爲一個聚合器。最後說明,使用maven的ant任務來調用遞歸maven? –

+0

對不起,我一定是錯過了我的推理..是的 - 以遞歸的方式使用maven - 威脅螞蟻在這種情況下作爲獨立於平臺的批處理程序。 –

+0

是一個很好的解決方案,但是是一種反模式:它包含了pom中的外部參考。如果maven不能處理這種簡單的情況,我認爲最好切換... –

0

更改根據您的依賴在SVN結構:

在家長,你必須定義模塊列表和模塊之間的依賴關係必須在適當的模塊中定義。

parent (pom.xml) 
+-- aaa (plugin) 
+-- bbb (jar) 
+-- ccc (jar) 
+-- ddd (war) 
+-- eee (war) 

版本應該是以後像3.0快照所有的模塊,可以簡單的發佈/從根位置部署等相同。

如果這不是你應該去的方式,你應該通過詹金斯單獨發佈所有這些項目。

+0

我不能對齊版本,我不能讓父母成爲一個聚合器(就像我寫的)。所以詹金斯似乎是這樣... –

1

您可以切換到搖籃,但它可能是更容易繼續使用Maven有一些小的修改:

  • 添加<modules>parent POM在您指定的所有子模塊。
  • 將父母版本設置爲與您的父母版本相同,例如, 1.0.0-SNAPSHOT
  • 即得到由其他建立包括項目,即bbbccc添加到您的父POM的<dependencyManagement>部分,將其版本是${project.version},並刪除在dddeee其具體版本。
  • 同樣,將aaa插件添加到父pom的<pluginsManagement>部分,將其版本設置爲${project.version},並從其他項目中刪除特定版本。

現在,您可以一次構建並釋放所有構建,例如,通過使用maven-release-plugin

+0

我很抱歉,但你指出了我寫的**我不想在我的問題**。 –

0

現在有可能你的模塊粒度太細,但是我個人認爲單獨構建是構建你係統的方式,這就是爲什麼。

親本 pom的主要工作是代表下一個版本。該版本可能是涉及幾個內部模塊的功能版本,也可能是隻有單個模塊發生更改的錯誤修復版本。

鑑於這種循環是這樣的:

  1. 修改 POM的版本對應於下一個「版本」。
  2. 更新作爲版本的一部分被修改的模塊版本。
  3. 更新模塊以使用修改後的快照親本並進行更改。
  4. 將父級中的模塊版本更新爲其發佈版本,併發布父級
  5. 更新每個模塊使用發佈的 pom並釋放模塊。

這種方法的好處是,如果未修改模塊,則使用以前發佈的模塊版本(從您的發行版回購中獲得,因此不能100%保證),而不進行重建(這將會發生採用多模塊方法)減少迴歸測試開銷。

如果每個版本隨模塊數量變化而變成負擔,可能是時候查看您的模塊結構了,但是這種方法的好處是,您可以通過系統中的所有模塊版本來降低迴歸測試的努力,並使其易於快速發佈。

+0

我不同意「父母的主要工作是代表下一個版本」。你的週期似乎是正確的,但它需要比我更多的手工工作。作爲最後一點,我不能回顧我的模塊結構,因爲有一個共同的基礎(罐子和插件),可以在不同的高級項目(不同的客戶供應)上重複使用,因此爲不同的客戶對齊版本是合同自殺 –

1

從條形圖的人創造了一個詹金斯插件:「Maven的級聯發佈插件」

https://github.com/barchart/barchart-jenkins-cascade-plugin/wiki/User-Manual

這需要你創建管理中,其他項目是爲了一個單獨的「佈局」項目發佈:

Root layout: 
<project> 
    <modules> 
    <module>a</module> 
    <module>ant</module> 
    <module>fish</module> 
    <module>fish/salmon</module> 
    <module>fish/shark</module> 
</modules> 

該項目仍然需要在顛覆,似乎,但你可以把它放在一個單獨的存儲庫,並與svn:externals例如鏈接的實際項目。然後Jenkins的插件會發佈一個模塊,它需要首先發布的模塊。

如釋放fish/shark -> 1.0,它可能需要釋放:

  • 一個 - > 1.1
  • 魚/鮭魚 - > 1.2
  • 魚/鯊魚 - > 1.0
+0

IMO從理論上講,這是最好的方法。實際上,我必須進行調查,不過謝謝你指出。 –