Skip to content

Optional goal parameter for maven.goal.custom command - #1108

Merged
Changyong Gong (chagong) merged 3 commits into
microsoft:mainfrom
BoykoAlex:custom-goal-param
Nov 18, 2025
Merged

Changyong Gong (chagong) merged 3 commits into
microsoft:mainfrom
BoykoAlex:custom-goal-param

Conversation

@BoykoAlex

Copy link
Copy Markdown
Contributor

No description provided.

@martinlippert

Copy link
Copy Markdown

Jinbo Wang (@testforstephen) wenyt (@wenytang-ms) Would be great to get your review on this and help merging and releasing this... :-)

@BoykoAlex

Copy link
Copy Markdown
Contributor Author

I have spotted "execute in background". This "background execution doesn't wait for the command in the terminal to complete and hence starts another maven goal execution is parallel which is a terrible idea as many times parallel execution of the same maven task leads to failures (removing and generating resources at the same time).
I don't know how to wait for the command to finish in the terminal... However, I think it is safe to skip the background execution for the maven custom goal executions. See the last commit for this change.

@chagong

Copy link
Copy Markdown
Contributor

Alex Boyko (@BoykoAlex) What's the use case for optional 'goal' parameter? I want to test it.

@BoykoAlex

Copy link
Copy Markdown
Contributor Author

Currently the use case is call it from spring-tools vscode extension. The command is executed programatically to execute process-aot goal. None of this has been pushed into main branch.
Here is the work in progress (but it is nearly completed): spring-projects/spring-tools#1713. The CodeLens would have a command that executes maven.goal.custom command with the path to the pom.xml being the first parameter and the process-aot goal (or compile process-aot as the second parameter. You'd need a sring boot 4 project in the workspace to test it.
Note that the maven.goal.custom already has the support for goal. The only downside is that it always expects the user to enter the goal via the UI. So, I'm not sure which part of this PR you'd like to test... The project to import into VSCode could be this one from the spring-tools repo: https://github.com/spring-projects/spring-tools/tree/aot-metadata/headless-services/spring-boot-language-server/src/test/resources/test-projects/data-repositories-jpa-4
You can run maven.goal.custom command via the command palette with the goal process-aot to test the "background execution" issue..

@chagong
Changyong Gong (chagong) merged commit f1a0c4f into microsoft:main Nov 18, 2025
@martinlippert

Copy link
Copy Markdown

Hey Changyong Gong (@chagong), thanks a lot for taking a look and for merging this. Would it be possible to get this out with a new release of the extension sometime soon? That would be awesome.

@wenytang-ms

wenyt (wenytang-ms) commented Nov 18, 2025 •

Copy link
Copy Markdown
Contributor

Martin Lippert (@martinlippert) we just publish the vscode-maven a preview bit with tag v0.44.2025111808 on marketplace, you could download this from prerelease channel and have a try!
Maybe there has a network latency, please wait and check for the latest prerelease bits.

@martinlippert

Copy link
Copy Markdown

wenyt (@wenytang-ms) Tried the pre-release, works perfectly. Would be great to get an official release out with this.

@wenytang-ms

Copy link
Copy Markdown
Contributor

Martin Lippert (@martinlippert) we already ship the 0.45.0 as the latest official release, you may upgrade the maven extension to have a try!

@martinlippert

Copy link
Copy Markdown

Awesome, thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants