Maven 发布插件 jar-with-dependencies

Maven release plugin jar-with-dependencies

我得到了 pom 文件的 maven-assembly-plugin 部分,如下所示:

        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>com.my.package.MyMainClass</mainClass>
                    </manifest>
                    <manifestEntries>
                        <Class-Path>.</Class-Path>
                    </manifestEntries>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
            <executions>
             <execution>
                 <id>make-assembly</id>
                 <goals>
                     <goal>single</goal>
                 </goals>
             </execution>
            </executions>
        </plugin>

和 maven-release-plugin 这样的:

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
                <goals>deploy</goals>
                <checkModificationExcludeList>pom.xml</checkModificationExcludeList>
                <tagNameFormat>@{project.version}</tagNameFormat>
                <providerImplementations>
                    <git>jgit</git>
                </providerImplementations>                  
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.apache.maven.scm</groupId>
                    <artifactId>maven-scm-provider-jgit</artifactId>
                    <version>1.9.2</version>
                </dependency>
            </dependencies>
        </plugin>

我需要为 Archiva 发布一个 jar-with-dependency 文件,但是 release:perform 命令只上传 jar,里面没有任何依赖项。我错过了什么?

好的..我必须回答我自己的问题。它只是缺少执行阶段 "package" 到程序集插件中。这是新的:

         <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>com.my.package.MyMainClass</mainClass>
                    </manifest>
                    <manifestEntries>
                        <Class-Path>.</Class-Path>
                    </manifestEntries>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
            <executions>
             <execution>
                 <id>make-assembly</id>
                 <goals>
                     <goal>single</goal>
                 </goals>
             </execution>

             <!-- was missing the following one -->
             <execution>
                <phase>package</phase>
                <goals>
                    <goal>single</goal>
                </goals>
            </execution>

            </executions>
        </plugin>

感谢 Sergey 为我指出打包阶段。