Jak mogę łączyć słoiki za pomocą Maven?

Poniższy fragment tworzy 2 JARS:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>2.4</version>
    <executions>
        <execution>
            <id>build-dependency</id>
            <phase>compile</phase>
            <goals>
                <goal>jar</goal>
            </goals>
            <configuration>
                <classifier>dependency</classifier>
                <classesDirectory>${project.build.directory}\dependency</classesDirectory>
                <includes>
                    <include>${dependancyInclude}</include>
                </includes>
            </configuration>
        </execution>
        <execution>
            <phase>compile</phase>
            <goals>
                <goal>jar</goal>
            </goals>
            <configuration>
                <classifier>module</classifier>
                <classesDirectory>${project.build.directory}\classes</classesDirectory>
            </configuration>
        </execution>
    </executions>
</plugin>

Chciałbym połączyć te dwa pliki JAR w jeden za pomocą wtyczki zespołu, obecnie mam następujące:

<plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>2.2</version>
    <executions>
        <!-- Combine all the JARs in the /target folder into one JAR -->
        <execution>
            <id>make-assembly</id>
            <phase>compile</phase>
            <goals>
                <goal>single</goal>
            </goals>
            <configuration>
                <attach>true</attach>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
                <finalName>${project.artifactId}-${project.version}</finalName>
                <appendAssemblyId>true</appendAssemblyId>
            </configuration>
        </execution>
    </executions>
</plugin>

Obecnie tylko jeden z dwóch JAR znajduje się w końcowym pliku JAR, który jest tworzony przez wtyczkę zespołu.

questionAnswers(1)

yourAnswerToTheQuestion