某些文件的maven-assembly-plugin

ato*_*fat 2 java maven-2 maven-assembly-plugin

我有多模块项目这是父pom.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.atoms</groupId>
    <artifactId>atoms-parent</artifactId>
    <packaging>pom</packaging>
    <version>1.0</version>
    <url/>
    <modules>
        <module>atoms-persistence</module>
        <module>atoms-reglas</module>
        <module>atoms-webservice</module>
    </modules>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>

                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptors>
                        <descriptor>assemble.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
Run Code Online (Sandbox Code Playgroud)

在项目atoms-persitence中我有以下文件:

com.atoms.vo.*

com.atoms.service.*

com.atoms.dao.*

在原子 - reglas我有:

com.atoms.rules.*

我如何使用程序集插件来创建一个只包含以下类的jar:

com.atoms.vo.*和com.atoms.rules.*?

Bor*_*vić 5

尝试这些方面:

<assembly>
    <id>atoms</id>
    <formats>
        <format>jar</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <fileSets>
        <fileSet>
            <directory>${basedir}/target/classes
            </directory>
            <outputDirectory>/</outputDirectory>
            <includes>
                <include>com/atoms/vo.**</include>
                <include>com/atoms/rules/**</include>
            </includes>
        </fileSet>
    </fileSets>
</assembly>
Run Code Online (Sandbox Code Playgroud)