Is there a way to use maven property in Java class during compilation

Viewed 40102

I just want to use maven placeholder in my Java class at compile time in order to reduce duplication.

Something like that:

pom.xml

<properties>
  <some.version>1.0</some.version>
</properties>

SomeVersion.java

package some.company;

public class SomeVersion {

    public static String getVersion() {
        return "${some.version}"
    }

}
4 Answers
Related