<包含>標記在maven-dependency-plugin條目中看起來似乎不起作用。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>
通過上述條目中檢索到的測試others.tar的內容containts以下項目
common/a.sh common/b.sh common/common_test.sh
我期望的唯一公共/ common_test.sh到構建過程中被提取到目標目錄。但是,所有文件實際上都被提取到目標目錄。由於光盤上的空間限制,不需要的文件不會被提取。
我該如何恰當地選取需要提取的文件?
更新:似乎這是缺陷是版本2.8。它在插件的2.10版本中起作用。
我認爲你錯了。沒有必要使用排除。假設有2個文件A和B,只有pom.xml中的條目是 A.計算isIncluded(A)和!isExcluded(A)的值isIncluded(B)AND!isExcluded(B) –
好的。如果我看到你的語法,你已經給出了文件名,但它應該是類似 **/common_test.sh 。 –