I have very simple maven descriptor which defined some properties:
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<properties>
<it.port>8080</it.port>
</properties>
</project>
I can override it.port
property with command:
$ mvn -Dit.port=8181 verify
But following command doesn't work as expected:
$ MAVEN_OPTS="-Dit.port=8181" mvn verify
This pass system variable to the JVM but maven refuse to override this property and default value given to test (8080). Original problem is that TeamCity (out CI server) pass system variables to the JVM in MAVEN_OPTS
, so property overriding doesn't work.
Can I override maven properties with MAVEN_OPTS
environment variable?
No you can't. You can:
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