使用maven-release-plugin部署程序集包

Bas*_*erg 23 deployment maven-2 maven-assembly-plugin maven-release-plugin

我们使用Hudson和maven-release-plugin来完成发布版本.现在我有一个项目,其中包含一个程序集,它将所有需要的组件放在一起,然后将它们打包成一个带有所需目录结构的.tar.gz包.

现在我正在尝试使用release-plugin在发布期间将此包部署到我们的Maven存储库:执行目标,但只部署了标准的东西(sources,javadoc,POM).

我已经将汇编目标绑定到maven包阶段,而.tar.gz在发布期间进行构建,但没有上传到存储库.我在这里做错了什么提示?

这是assembly-plugin配置:

<plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>2.2-beta-4</version>
    <configuration>
      <descriptors>
        <descriptor>src/main/assembly/distribution.xml</descriptor>
      </descriptors>
      <finalName>${pom.artifactId}-${pom.version}</finalName>
      <appendAssemblyId>false</appendAssemblyId>
      <tarLongFileMode>warn</tarLongFileMode>
    </configuration>
    <executions>
        <execution>
            <id>dist-assembly</id>
            <phase>package</phase>
            <goals>
                <goal>assembly</goal>
            </goals>
        </execution>
    </executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)

我运行以构建版本的命令是

mvn release:prepare release:perform release:clean
Run Code Online (Sandbox Code Playgroud)

Bas*_*erg 34

与此同时,我找到了两种方法来做我想做的事.

maven-build-helper-plugin允许将额外的条目添加到应该部署的工件列表中:

    <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>build-helper-maven-plugin</artifactId>
         <version>1.3</version>
         <executions>
           <execution>
             <id>attach-distribution</id>
             <phase>package</phase>
             <goals>
               <goal>attach-artifact</goal>
             </goals>
             <configuration>
               <artifacts>
                 <artifact>
                   <file>target/${pom.artifactId}-${pom.version}.tar.gz</file>
                   <type>tar.gz</type>
                 </artifact>
               </artifacts>
             </configuration>
           </execution>
         </executions>
       </plugin>
Run Code Online (Sandbox Code Playgroud)

另一个很简单,maven-user邮件列表上的某个人指出了这一点.简单使用程序集:单个目标而不是asssembly:程序集.这样,在部署阶段,生成的工件将上载到存储库.

    <execution>
        <id>dist-assembly</id>
        <phase>package</phase>
        <goals>
            <goal>single</goal> <!-- that's all :) -->
        </goals>
    </execution>
Run Code Online (Sandbox Code Playgroud)