我正在尝试在maven-assembly-plugin中使用正则表达式,如下所示。有两个文件以httpcore开头。
我想排除httpcore-4.2.4.jar但包含httpcore-nio-4.2.4.jar。当版本号改变时,我不想总是改变这个描述符。所以我尝试创建如下的描述符。
<fileSet>
<directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/lib/runtimes</directory>
<outputDirectory>${pom.artifactId}-${pom.version}/lib/runtimes/</outputDirectory>
<excludes>
<exclude>%regex[httpcore-([0-9.]+)\.jar]</exclude>
</excludes>
</fileSet>
但仍然会复制这两个文件。
答案 0 :(得分:0)
由于正则表达式不起作用,我使用了下面的描述符。
<fileSet>
<directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/lib/runtimes</directory>
<outputDirectory>${pom.artifactId}-${pom.version}/lib/runtimes/</outputDirectory>
<excludes>
<exclude>*/httpclient*</exclude>
<exclude>*/httpcore*</exclude>
<exclude>*/commons-logging*</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/lib/runtimes</directory>
<outputDirectory>${pom.artifactId}-${pom.version}/lib/runtimes/</outputDirectory>
<includes>
<include>*/httpcore-nio*</include>
</includes>
</fileSet>