我试图使用maven依赖插件解包jar文件.但我只想在jar文件中有一个文件,并且想要排除jar内的META-INF目录.我该怎么做?
这是我到目前为止:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
<type>jar</type>
<outputDirectory>${project.basedir}/src/test/</outputDirectory>
<excludes>META-INF</excludes>
</artifactItem>
</artifactItems>
<excludes>META-INF</excludes>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
找到了解决方案.
<artifactItem>
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
<type>jar</type>
<outputDirectory>${project.basedir}/src/test/</outputDirectory>
<excludes>META-INF/</excludes>
</artifactItem>
Run Code Online (Sandbox Code Playgroud)
只需/在目录名后添加正斜杠:
| 归档时间: |
|
| 查看次数: |
1802 次 |
| 最近记录: |