Java Maven着色插件替换persistence.xml
在maven软件包期间,我有一个奇怪的行为。我有一个工件A,它取决于B 在A中有一个包含persistence.xml的META-INF文件夹,在B中也有一个包含persistence.xml的META-INF文件夹 这是pom的一个相对阴影插件和依赖项的文件Java Maven着色插件替换persistence.xml,java,maven,maven-plugin,maven-shade-plugin,Java,Maven,Maven Plugin,Maven Shade Plugin,在maven软件包期间,我有一个奇怪的行为。我有一个工件A,它取决于B 在A中有一个包含persistence.xml的META-INF文件夹,在B中也有一个包含persistence.xml的META-INF文件夹 这是pom的一个相对阴影插件和依赖项的文件 <dependency> <groupId>com.mycopany</groupId> <artifactId>B</artifactId&g
<dependency>
<groupId>com.mycopany</groupId>
<artifactId>B</artifactId>
<version>1.0.2</version>
</dependency>
</dependencies>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<shadedArtifactAttached>true</shadedArtifactAttached>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
考虑到B也是一个着色工件,如何从B中排除persistence.xml文件?使用第二个过滤器并排除persistence.xml,如下所示:
<filter>
<artifact>B</artifact>
<excludes>
<exclude>path/persistence.xml</exclude>
</excludes>
</filter>
更多的细节在这里
而在中,不知何故,这对我不起作用。你能举一个路径的例子吗?