0
|
I'd like to set a property if an environment variable is set. I googled a lot on it and all I found is something similar to the code below, but I keep getting the error:
*[FATAL] Non-parseable POM Y:\Maven\parent-pom\pom.xml: TEXT must be immediately followed by END_TAG and not START_TAG (position: START_TAG s een ...roperties"\r\n classpathref="maven.plugin.classpath" />... @29:55) @ line 29, column 55*
That's the code I'm trying, its inside a pom.xml and I ran the command -
mvn --errors deploy
Of course, I'll be happy to get any other solution, if you have other suggestion on how to set a property in pom.xml depending on an environment variable content.
Thanks, Eli
|
1
|
usage of tasks inside properties tag is wired , use maven-antrun plugin instead. you can set maven properties with
|
Can you please give me an example ? I couldn't find it in the link you sent – Elyahu Aug 5 at 8:44
|
1
|
A much better approach would be to use profile activations.
|
Update:
mvn -s $PROJECT_SETTINGS -P myProfile ....
Update 2:
hello
mvn -P build_in_spanish ...
- Profiles can be in the POM or in a separated settings file. The latter approach gives the most flexibility.
- Profiles can be explicitly enabled (using the "-P" command line option or by attempting to discover the environment it sits within. This is a design choice)