0

I was trying to use resource filtering to substiute some properties into a file but not successful. It is for a Springboot Application, in which I have the following in the pom.xml

    <build>
        <resources>
            <resource>
                <directory>src/main/resources-filtered</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <propertiesEncoding>default</propertiesEncoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

In src/main/resources-filtered, I have a file, test.xml, with the following contents

<test>
    <version>${project.version}</version>
</test>

After running mvn clean install, I am still seeing the file contains the in target/classes folder

I am actually wanting to use assembly plugin later on to create a zip containing those filtered files. So I will expect the output file should have been filtered

Tom
  • 371
  • 2
  • 6
  • 15

0 Answers0