繁体   English   中英

Maven的依赖关系的插件 <includes> 标签不起作用

[英]maven-dependency-plugin <includes> tag doesn't work

下面给出的maven-dependency-plugin条目中的<includes>标签似乎不起作用。

            <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>

由上述条目检索的test-others.tar的内容包含以下项目

common/a.sh  
common/b.sh  
common/common_test.sh

我希望在构建期间将唯一的common / common_test.sh提取到目标目录。 但是,所有文件实际都是提取到目标目录。 由于光盘上的空间限制,不会提取不需要的文件。

如何才能正确选择要提取的所需文件?

更新:似乎这是bug版本2.8。 它适用于插件的2.10版本。

您还必须使用exclude,因为如果您将看到包含的文档,(组件代码= return isIncluded(name)AND!isExcluded(name);)

所以也要使用,这样可以正常使用。

您可以使用以下链接供您参考。 https://maven.apache.org/plugins/maven-dependency-plugin/unpack-dependencies-mojo.html

使用maven-dependency-plugin的2.10或更高版本。 版本2.8和2.9不处理包含,正确排除。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM