我在maven中的程序集插件没有存档我最后一个jar中的所有工件,有时它确实存在,有时它不会,我很困惑

时间:2013-01-19 11:25:17

标签: maven-assembly-plugin

有点修复.....不用提及对maven来说很新鲜

搜索出来并创建了一个多模块项目.....我使用标记到我的主POM的assembly.xml将所有模块工件* .jar存档到最终的si-installer.jar中。

这是我的主人pom就像

 <modules>
    <module>si_config_support/src/main/java/com/tcs/bancs/si</module>
    <module>SI_CORE/src/main/xsd</module>
    <module>SI_CORE/src/main/java/com/tcs/bancs/si/core</module>
    <module>SI_CORE/src/main/java/com/tcs/bancs/si/impl/adapter/jmsadapter</module>
    <module>SI_CORE/src/main/java/com/tcs/bancs/si/impl/actions</module>
    <module>SI_CORE/src/main/java/com/tcs/bancs/si/core/process/message</module>
    <module>SI_CORE/src/main/java/com/tcs/bancs/si/main</module>
</modules>

<build>
    <extensions>
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-ssh</artifactId>
            <version>1.0-beta-7</version>
        </extension>
    </extensions>  

    <plugins>
        <plugin>

<groupId>org.codehaus.mojo</groupId>  
<artifactId>wagon-maven-plugin</artifactId>  
<version>1.0-beta-3</version>  
  <executions>
    <execution>
      <id>upload-javadoc</id>
      <phase>deploy</phase>
      <goals>
        <goal>upload</goal>
      </goals>
      <configuration>
        <serverId>InBlrBnc107</serverId>
        <fromDir>/home0/u485309/User/Maven_SonarTest/target</fromDir>
        <includes>*.jar</includes>
        <excludes>pom.xml</excludes>
        <url>http://172.19.97.248:8081/artifactory/simple</url>
        <toDir>SIDeployment/Service-Integrator/si-main</toDir>
      </configuration>
      </execution>
    </executions>
    </plugin>


        <!--plugin>
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-antrun-plugin</artifactId>
    <version>1.6</version>
    <executions>
      <execution>
        <phase>deploy</phase>
        <configuration>
          <target>
            <scp file="/home0/u485309/User/Maven_SonarTest/target/si-installer-9.0.jar" todir="sidevperf:password@172.19.98.18:/home/sidevperf/USERS" trust="true"/>
          </target>
        </configuration>
        <goals>
          <goal>run</goal>
        </goals>
      </execution>
    </executions>
     <dependencies>
          <dependency>  
            <groupId>ant-jsch</groupId>  
            <artifactId>ant-jsch</artifactId>  
            <version>1.8.1</version>  
        </dependency> 

        <dependency>          
            <groupId>com.jcraft</groupId>           
            <artifactId>jsch</artifactId>          
            <version>0.1.42</version>       
       </dependency>  
     </dependencies> 
  </plugin-->

        <plugin>
            <groupId>org.apache.maven.plugins</groupId> 
            <artifactId>maven-install-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <createChecksum>true</createChecksum>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId> 
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <appendAssemblyId>false</appendAssemblyId>
                <finalName>si-installer-9.0</finalName>
                <descriptors>
                    <descriptor>si-assembly.xml</descriptor>
                </descriptors>
                <attach>false</attach>
                <archive>
                    <manifest>
                        <mainClass>com.tcs.mswitch.installer.Install</mainClass>
                    </manifest>
                </archive>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id>
                    <phase>install</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.1</version>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.basedir}/installer/thirdparty-lib</outputDirectory>
                        <overWriteIfNewer>true</overWriteIfNewer>
                        <includeScope>provided</includeScope>
                        <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
                    </configuration>
                </execution>    
            </executions>
        </plugin>

和我的si汇编是这样的:

<assembly>
<id>Service-Integrator</id>
<formats>
    <format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>

<fileSets>
    <fileSet>
        <directory>/home0/u485309/User/Maven_SonarTest/si_config_support/src/main/java/com/tcs/bancs/si/target</directory>
        <outputDirectory>SI_COMPONENTS/lib</outputDirectory>
        <includes>
            <include>si-config-support-9.0.jar</include>
        </includes>
    </fileSet>
    <fileSet>
        <directory>/home0/u485309/User/Maven_SonarTest/SI_CORE/src/main/xsd/target</directory>
        <outputDirectory>SI_COMPONENTS/lib</outputDirectory>
        <includes>
            <include>si-config-9.0.jar</include>
        </includes>
    </fileSet>
    <fileSet>
        <directory>/home0/u485309/User/Maven_SonarTest/SI_CORE/src/main/java/com/tcs/bancs/si/core/target</directory>
        <outputDirectory>SI_COMPONENTS/lib</outputDirectory>
        <includes>
            <include>si-core-9.0.jar</include>
        </includes>
    </fileSet>

    <fileSet>
        <directory>/home0/u485309/User/Maven_SonarTest/SI_CORE/src/main/java/com/tcs/bancs/si/impl/adapter/jmsadapter/target</directory>
        <outputDirectory>SI_COMPONENTS/lib</outputDirectory>
        <includes>
            <include>si-jms-adapter-9.0.jar</include>
        </includes>
    </fileSet>
    <fileSet>
        <directory>/home0/u485309/User/Maven_SonarTest/SI_CORE/src/main/java/com/tcs/bancs/si/impl/actions/target</directory>
        <outputDirectory>SI_COMPONENTS/lib</outputDirectory>
        <includes>
            <include>si-processing-actions-9.0.jar</include>
        </includes>
    </fileSet>
    <fileSet>
        <directory>/home0/u485309/User/Maven_SonarTest/SI_CORE/src/main/java/com/tcs/bancs/si/core/process/message/target</directory>
        <outputDirectory>SI_COMPONENTS/lib</outputDirectory>
        <includes>
            <include>si-message-processor-9.0.jar</include>
        </includes>
    </fileSet>
    <fileSet>
        <directory>/home0/u485309/User/Maven_SonarTest/SI_CORE/src/main/java/com/tcs/bancs/si/main/target</directory>
        <outputDirectory>SI_COMPONENTS/lib</outputDirectory>
        <includes>
            <include>si-main-9.0.jar</include>
        </includes>
    </fileSet>
    <fileSet>
        <directory>/home0/u485309/User/Maven_SonarTest/installer/groovy-dependencies</directory>
        <outputDirectory/>
        <includes>
            <include>**/*</include>
        </includes>
        <!--excludes>
            <exclude>META-INF/**/*</exclude>
        </excludes-->
    </fileSet>
    <fileSet>
        <directory>/home0/u485309/User/Maven_SonarTest/installer/thirdparty-lib</directory>
        <outputDirectory>SI_COMPONENTS/thirdparty-lib</outputDirectory>
        <includes>
            <include>*.jar</include>
        </includes>
        <excludes>
            <exclude>bancsjmx-2.0.jar</exclude>
            <exclude>xsd.jar</exclude>
        </excludes>
    </fileSet>
    <fileSet>
        <directory>/home0/u485309/User/Maven_SonarTest/installer/thirdparty-lib</directory>
        <outputDirectory>SI_COMPONENTS/lib</outputDirectory>
        <includes>
            <include>bancsjmx-2.0.jar</include>
            <!--include>xsd.jar</include-->
        </includes>
    </fileSet>

    <fileSet>
        <directory>/home0/u485309/User/Maven_SonarTest/DeliveryComponents</directory>
        <outputDirectory>SI_COMPONENTS</outputDirectory>
        <includes>
            <include>**/*</include>
        </includes>
    </fileSet>
</fileSets>

我有两个问题 - :

1)我的所有阶段都针对每个模块运行,因此我的si-installer.jar将成为我的最后一个jar,为所有模块创建,并且还运行所有模块的ant任务...以及使用上传到神器所有阶段都有货车?如何在完成所有子模块的编译后停止像打包和部署这样的阶段?

2)我的最终工件jar si-installer.jar有时候我的所有子模块都是jar,而在其他时候只有一个jar(在assembly.xml的文件集中最后提到的bancsjmx.jar)进入最后的工件si- installer.jar是assembly.xml中的bancsjmx.jar,我很困惑?这种行为也是零星的...有时候我会把所有的罐子放在最后的罐子里....有时候我只说一个......看起来就像maven做了一些多线程的东西......慢慢的事情好转!!!请帮忙

以前有人遇到过这样的问题吗?

0 个答案:

没有答案