Maven resource filtering exclude

前端 未结 2 1181
南旧
南旧 2021-02-19 08:59

I have a following maven configuration:

        
            
                src/main/resources

        
相关标签:
2条回答
  • 2021-02-19 09:47

    Binary filtering

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-resources-plugin</artifactId>
      <version>3.0.2</version>
      <configuration>
        <nonFilteredFileExtensions>
          <nonFilteredFileExtension>jks</nonFilteredFileExtension>
        </nonFilteredFileExtensions>
      </configuration>
    </plugin>
    
    0 讨论(0)
  • 2021-02-19 10:03

    According to the Maven Resource Filtering Documentation, this should work:

    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
            <excludes>
                <exclude>keystore.jks</exclude>
            </excludes>
        </resource>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>false</filtering>
            <includes>
                <include>keystore.jks</include>
            </includes>
        </resource>
    </resources>
    
    0 讨论(0)
提交回复
热议问题