I want to replace a Maven property in a pom.xml
file with a command line call via some Maven plugin.
<properties>
<my.property>ISO-8859-1</my.property>
<properties>
Do you know of a plugin which is able to do that?
The versions plugin takes very long since it checks whether some dependency is available. Besides that it doesn't work in my case.
To provide System Properties to the tests from command line, you just need to configure maven surefire plugin and use -D{systemproperty}={propertyvalue} parameter in commandline. Run Single Test with Maven : $ mvn test -Dtest=MessageUtilTest#msg_add_test -Dmy_message="Hello, Developer!"
To open the POM Editor, click on a project's pom. xml file. If you've customized the editors for a pom. xml file, and the POM Editor is not the default editor, you may need to right-click on the file and choose "Open With... / Maven POM Editor".
In maven pom. xml , a property is accessed by using ${property_name} . You can define your custom properties in Maven.
Passing an Argument to MavenMaven will use the value (2.5) passed as an argument to replace the COMMON_VERSION_CMD property set in our pom. xml. This is not limited to the package command — we can pass arguments together with any Maven command, such as install, test, or build.
All you need to do is add the following when running maven on the command line
-Dmy.property=propertyValue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With