microsoft / vscode-maven

VSCode extension "Maven for Java"
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-maven
Other
181 stars 88 forks source link

Deselect profile problem #977

Open Sorreldd opened 1 year ago

Sorreldd commented 1 year ago

When I deselect profile I get this generated command from the plugin. [artyom@artyom-vivobook backstage-ai]$ mvn clean -f "/home/artyom/Projects/backstage-ai/pom.xml" -P !spbgut

And error: bash: !spbgut: event not found

The exclamation mark needs to be escaped in most shells (but not required on Windows) Profile deselect shoud be -P '!profile1,profile2'
or
-P-profile1,-profile2 (without whitespace after P)

jefferybradberry commented 1 year ago

I'm running into this, too, using Bash and WSL. I think shell-friendly escapes are needed here:

mavenUtils.ts#L149

jefferybradberry commented 11 months ago

I found a workaround using the "set +o history" command to disable command history.

$ mvn clean verify site -f "pom.xml" -P !source
bash: !source: event not found
$ set +o history
$ mvn clean verify site -f "pom.xml" -P !source
[INFO] Scanning for projects...
[INFO] 
[...]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.979 s
[INFO] Finished at: 2023-09-21T10:40:21-04:00
[INFO] ------------------------------------------------------------------------
gabrielbergoc commented 4 months ago

Ran into this issue just now