0

I am trying to use the com.google.code.maven-replacer-plugin but is seems to have no effect at all.

    <build>
            <plugins>
                <plugin>
                    <groupId>com.google.code.maven-replacer-plugin</groupId>
                    <artifactId>maven-replacer-plugin</artifactId>
                    <version>1.3.5</version>
                    <executions>
                        <execution>
                            <id>replaceTokens</id>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>replace</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <file>src/main/resources/executionConfig/execution-configuration.properties</file>
                        <replacements>
                            <replacement>
                                <token>ImportResultToXray</token>
                                <value>false</value>
                            </replacement>
                        </replacements>
                    </configuration>
                </plugin>
            </plugins>
    </build>

In properties file I have ImportResultToXray set to true and assumed that the plugin would change it to false. But this does not happen. Am I getting something wrong here?

Jefe infiltrado
  • 364
  • 2
  • 15
  • Why do you need the replacer plugin? What is the purpose ? Show an example of the property file? Why do you change the production property file? – khmarbaise Feb 15 '23 at 19:59
  • For convenience I want to have everything running with a simple configuration, but I want to have the option to add option to the run from a Maven command. So I thought just replacing the variable's values would do that. I am aware that in the end I have to put a ${variable} as value, but I wanted to see if it works with a hardcoded value first. – Jefe infiltrado Feb 16 '23 at 08:29
  • 1
    You can use the filtering instead separate plugin...https://maven.apache.org/plugins/maven-resources-plugin/examples/filtering-properties-files.html – khmarbaise Feb 16 '23 at 08:53
  • Thanks, much better, though the documentation is horrible, but I found my way though to what I am looking for. – Jefe infiltrado Feb 16 '23 at 12:08
  • if you think the docs is bad please create a jira issue how to improve the docs.... or create an PR on the appropriate github repo – khmarbaise Feb 16 '23 at 13:10

0 Answers0