vscode-maven icon indicating copy to clipboard operation
vscode-maven copied to clipboard

Deselect profile problem

Open Sorreldd opened this issue 2 years ago • 5 comments

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)

  • OS: [Arch Linux, terminal bash or zsh]
  • VS Code version: [1.79.2]
  • Extension version [0.41.0]

Sorreldd avatar Jun 21 '23 14:06 Sorreldd

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

mavenUtils.ts#L149

jefferybradberry avatar Aug 10 '23 14:08 jefferybradberry

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] ------------------------------------------------------------------------

jefferybradberry avatar Sep 21 '23 14:09 jefferybradberry

Ran into this issue just now

gabrielbergoc avatar May 08 '24 23:05 gabrielbergoc

+1 :(

The content of envFile in launch.json also has this problem

arte0s avatar Oct 05 '24 13:10 arte0s

This is still an issue using zsh terminal in vscode on mac

lwiklander avatar Oct 08 '25 11:10 lwiklander