复制到maven中的输出目录时排除文件

时间:2015-10-17 13:38:46

标签: java maven ant

我试图排除.jar个文件被复制到输出目录。我已尝试过给出的解决方案,即<excludes>*.jar</excludes><warSourceExcludes>*.jar</warSourceExcludes>,但它们都没有工作。

<plugin>
    <artifactId>maven-dependency-plugin</artifactId>
    <executions>
        <execution>
            <id>install-artifacts</id>
            <phase>install</phase>
            <goals>
                <goal>copy</goal>
            </goals>
            <configuration>
                <artifactItems>
                    <artifactItem>
                        <groupId>com.abc.xyz</groupId>
                        <artifactId>${project.artifactId}</artifactId>
                        <version>${project.version}</version>
                        <type>${project.packaging}</type>
                        <overWrite>true</overWrite>
                        <outputDirectory>../../ReleaseArtifacts</outputDirectory>
                    </artifactItem>
                </artifactItems>
                <stripVersion>true</stripVersion>
            </configuration>
        </execution>
        <execution>
            <id>install-artifacts-2</id>
            <phase>install</phase>
            <goals>
                <goal>copy</goal>
            </goals>
            <configuration>
                <artifactItems>
                    <artifactItem>
                        <groupId>com.abc.xyz</groupId>
                        <artifactId>${project.artifactId}</artifactId>
                        <version>${project.version}</version>
                        <type>${project.packaging}</type>
                        <overWrite>true</overWrite>
                        <outputDirectory>../../../ReleaseArtifacts/${project.version}</outputDirectory>             
                        <excludes>*.jar</excludes>                  
                    </artifactItem>
                </artifactItems>
                <stripVersion>true</stripVersion>
            </configuration>
        </execution>
    </executions>
</plugin>

0 个答案:

没有答案