2011-03-28 123 views
0

我需要保持在工件處理過程中創建的狀態。所以我有想法將這些狀態綁定到一個自己的zip文件中,並在準備階段解壓縮它。額外應該是部署的真實結果。這個結果是創建文件的一個包,在下一個工件中很有價值。多個彙編結果

我正在嘗試創建兩個結果拉鍊,但在部署過程中忽略了第二個程序集名稱,並始終部署myArtifact-version.zip。

怎麼了?

由於提前, 斯文

我的POM樣子:

​​

的組件是:

GEN-results.xml:

<assembly ... > 
    <id></id> 
    <formats><format>zip</format></formats> 
    <baseDirectory></baseDirectory> 
    <includeBaseDirectory>false</includeBaseDirectory> 
    <fileSets> 
     <fileSet> 
      <directory>${project.build.directory}/export</directory> 
      <includes> 
       <include>something.*/**/*.*</include> 
      </includes> 
     </fileSet> 
    </fileSets> 
</assembly> 

束-gen-status.xml

<assembly ... > 
    <id></id> 
    <formats><format>zip</format></formats> 
    <baseDirectory></baseDirectory> 
    <includeBaseDirectory>false</includeBaseDirectory> 
    <fileSets> 
     <fileSet> 
      <directory>${project.build.directory}/config</directory> 
      <includes> 
       <include>status.file</include> 
      </includes> 
      <outputDirectory>classes/scripts</outputDirectory> 
     </fileSet> 
    </fileSets> 

</assembly> 

回答

0

這允許我僅將狀態文件附加到當前工件。但是當我嘗試添加狀態工件時,我得到一個依賴週期。

<project ...> 
    <artifactId>myArtifact</artifactId> 
    <groupId>de.myGroup</groupId> 
    <packaging>pom</packaging> 
    ... 
    <dependencies> 
    <dependency> 
     <groupId>de.myGroup</groupId> 
     <artifactId>myArtifact</artifactId> 
     <classifier>status</classifier> 
     <version>${project.version}</version> 
    </dependency> 
    </dependencies> 
    ... 
<build> 
    <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-dependency-plugin</artifactId> 
     <executions> 
      <execution> 
       <phase>package</phase> 
       <goals> 
        <goal>unpack-dependencies</goal> 
       </goals> 
       <configuration> 
        <outputDirectory>${project.build.directory}/config</outputDirectory> 
        <includeClassifiers>status</includeClassifiers> 
       </configuration> 
      </execution> 
     </executions> 
    </plugin> 
    ... 
    exec 
    ... 
    <plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>build-helper-maven-plugin</artifactId> 
    <executions> 
     <execution> 
     <id>status</id> 
     <phase>package</phase> 
     <goals><goal>attach-artifact</goal></goals> 
     <configuration> 
     <artifacts> 
       <artifact> 
      <file>${project.build.directory}/config/status.file</file> 
      <type>file</type> 
       <classifier>status</classifier> 
      </artifact> 
     </artifacts> 
     </configuration> 
     </execution> 
     </executions> 
    </plugin>