aleksandr-m / gitflow-maven-plugin

The Git-Flow Maven Plugin supports various Git workflows, including GitFlow and GitHub Flow. This plugin runs Git and Maven commands from the command line.
https://aleksandr-m.github.io/gitflow-maven-plugin/
Apache License 2.0
493 stars 181 forks source link

passing multiple options does not work for arg line #212

Closed mteubner closed 4 years ago

mteubner commented 4 years ago

Hi,

like already mentioned in

https://github.com/aleksandr-m/gitflow-maven-plugin/issues/127 https://github.com/aleksandr-m/gitflow-maven-plugin/issues/150 https://github.com/aleksandr-m/gitflow-maven-plugin/issues/190

It is not possible to pass more the one argument to the release process. I tried many possibilities, but did not succeed. my problem is that I want to pass a setting file and an profile, but all tries I did lead to not grabbing the settings and therefore failing to use a custome repository for dependencies.

Full command:

mvn --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true --settings=/builds/xxx/.m2/settings.xml -Djib.to.auth.username=2e7 -Djib.to.auth.password=[MASKED] -Djib.from.auth.username=2e7 -Djib.from.auth.password=[MASKED] gitflow:release-start gitflow:release-finish -Prelease -DreleaseVersion= -DdevelopmentVersion=0.7.1-SNAPSHOT -DargLine='--settings=/builds/xxx/.m2/settings.xml -Pinstaller-cli'

Tries -DargLine=' -Pinstaller-cli --settings=$CI_PROJECT_DIR/.m2/settings.xml' -DargLine="--settings=$CI_PROJECT_DIR/.m2/settings.xml -Pinstaller-cli" -DargLine="-Pinstaller-cli --settings=$CI_PROJECT_DIR/.m2/settings.xml"

You said on 127 "Works for me. Can you show exact path you're using?" Can you tell me what you need to reproduce this problem.

Kind Rgeards

aleksandr-m commented 4 years ago

@mteubner Just tested it again and again it works for me. :) All your examples should work.

Maybe the $CI_PROJECT_DIR variable is not getting resolved. Can you try to run this locally. Also to eliminate permission issues, try to move your custom settings.xml file to some other location (e.g. into your project) and see if it works.

aleksandr-m commented 4 years ago

@mteubner BTW you can use verbose parameter to see inner maven commands output in the console.

mteubner commented 4 years ago

Thank you for your fast answer. I can't explain what went wrong. We changed the settings into the environment so only one parameter remains and this works like a charm. probably the variable is not resolved when in quotes I don't know. With only the settings parameter it works.

Anyhow sorry for your time. We will work with the one parameter strategy.

I'll come back if a second parameters appears, with an verbosed log file :)

Thank You again.

benjamin-cartereau commented 4 months ago

I have been facing the same issue(s). Example of command line : mvn -B -e -X gitflow:release -Denv=int-devi -Dverbose=true -Dusername=xxxxxx -Dpassword=******** -DpostReleaseGoals=deploy -DargLine='-X -Denv=int-devi -Pmy-release-profile' when looking at debug logs I can see : [DEBUG] (s) argLine = '-X And the executed command is then logged that way :

[INFO] Cleaning and testing the project.
[DEBUG] mvn clean test '-X
Error translating Commandline.

Eventually other parameters are not passed and the maven command fail.

I have been testing different alternatives : [...] -DargLine="-X -Denv=int-devi -Pmy-release-profile" [...] "-DargLine=-X -Denv=int-devi -Pmy-release-profile" [...] '-DargLine=-X -Denv=int-devi -Pmy-release-profile' none of them are working correctly.

The only way I have made it work is this weird (no closing quote) syntax : [...] '-DargLine=-X -Denv=int-devi -Prelease-profile-cnav

Best regards and thanks for the plugin