Java maven依赖插件<;包括>;标签不';行不通

Java maven依赖插件<;包括>;标签不';行不通,java,maven,maven-3,maven-dependency-plugin,Java,Maven,Maven 3,Maven Dependency Plugin,下面给出的maven依赖插件条目中的标记似乎不起作用 <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>unpack</id> <phase>pack

下面给出的maven依赖插件条目中的标记似乎不起作用

            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <id>unpack</id>
                    <phase>package</phase>
                    <goals>
                        <goal>unpack</goal>
                    </goals>
                    <configuration>
                        <artifactItems>
                            <artifactItem>
                                <groupId>org.test</groupId>
                                <artifactId>test-build-common</artifactId>
                                <version>${project.version}</version>
                                <classifier>others</classifier>
                                <type>tar</type>
                                <outputDirectory>target</outputDirectory>
                                <includes>**/common_test.sh</includes>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>
maven依赖插件
打开
包裹
打开
组织测试
测试构建通用
${project.version}
其他
焦油
目标
**/公共_test.sh
上述条目检索到的test-others.tar的内容包含以下项目

common/a.sh common/b.sh common/common_test.sh 普通/a.sh 普通/b.sh 公共/公共_测试.sh 我希望在构建期间将唯一的common/common_test.sh提取到目标目录。但是,所有文件实际上都被提取到目标目录。由于光盘上的空间限制,无法提取不需要的文件

我如何才能正确地只选择需要提取的文件


更新:这似乎是2.8版的错误。它在插件的2.10版中工作。

您还必须使用exclude,因为如果您要查看包含的文档, (组件代码=返回ISinclude(名称)和!ISExclude(名称);)

因此,使用以及将工作良好

您可以使用下面的链接作为参考。

使用2.10版或更高版本的maven依赖插件。版本2.8和2.9未正确处理包括、排除和删除

我认为你错了。不需要使用exclude。假设有r2个文件A和B。pom.xml中唯一的条目是A。计算包含(A)和的值!我不包括(A)我包括(B)和!我排除在外(B)好的。如果我看到您的语法,您已经在中给出了文件名,但它应该类似于**/common_test.sh。