禁用Maven-remote-resources-plugin的资源过滤

Tan*_*ect 1 filtering maven maven-resources-plugin

我正在尝试使用maven-remote-resources-plugin在多模块maven项目中的模块之间共享大量资源。不幸的是,共享二进制资源在绑定过程中被破坏了,大概是通过过滤。

我确信在此阶段会发生损坏,因为从本地存储库中提取共享资源jar包含损坏的二进制文件。

是否可以关闭对Maven-remote-resources-plugin的过滤?

目前,我共享资源模块中的pom看起来像

<build>
  <plugins>
    <plugin>
       <artifactId>maven-remote-resources-plugin</artifactId>
       <executions>
         <execution>
           <goals>
             <goal>bundle</goal>
           </goals>
         </execution>
       </executions>
       <configuration>
         <includes>
           <include>**/*</include>
         </includes>
       </configuration>
     </plugin>
  </plugins>
</build>

<dependencies>
  <dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-remote-resources-plugin</artifactId>
    <version>1.3</version>
  </dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)

use*_*849 5

听起来好像资源在捆绑期间被破坏了。由于资源项目只是一个jar,它将resources作为默认生命周期的一部分执行插件。尝试将其添加到资源项目的POM中。

<plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.6</version>
    <executions>
      <execution>
        <id>default-resources</id>
        <configuration>
          <nonFilteredFileExtensions>
            <nonFilteredFileExtension>exe</nonFilteredFileExtension>
            <nonFilteredFileExtension>dontFilterMeEither</nonFilteredFileExtension>
          </nonFilteredFileExtensions>
          [...]
        </configuration>
      </execution>
    </executions>
  </plugin>
Run Code Online (Sandbox Code Playgroud)

文档描述了默认情况下哪些二进制文件未过滤。上面的配置将扩展添加到列表中。