Murali.Molluru
Murali.Molluru

Reputation: 139

How to replace a token with value in java source using maven replacer plugin?

<plugin>
    <groupId>com.google.code.maven-replacer-plugin</groupId>
    <artifactId>replacer</artifactId>
    <version>1.5.0</version>
    <executions>
        <execution>
            <id>DB schema-replacement</id>
            <phase>compile</phase>
            <goals>
                <goal>replace</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <includes>
            <include>src/main/java/com/swissre/gc7/dao/hibernate/*.java</include>
            <include>src/main/java/com/swissre/gc7/dao/*.java</include>
            <include>src/main/java/com/swissre/gc7/dao/hibernate/*.java</include>
            <include>src/main/java/com/swissre/gc7/dao/*/*/hibernate/*.java</include>
            <include>src/main/java/com/swissre/gc7/dao/*/*/valueGroup/hibernate/*.java</include>
        </includes>
        <replacements>
            <replacement>
                <token>G10MDA.</token> <!-- Token which needs to be replaced -->
                <value>S1MTHT.</value> <!-- Value which is replaced for given token -->
            </replacement>
            <replacement>
                <token>"G10MDA.</token> <!-- Token which needs to be replaced -->
                <value>"S1MTHT.</value> <!-- Value which is replaced for given token -->
            </replacement>
.....
.....

This above code is not working.

Could you please someone help me?

i want to replace token in java source file and value should be included in .class file.

Upvotes: 2

Views: 1116

Answers (0)

Related Questions