Because the company project needs to use the company’s internal Maven resources, it is not required at home, so it is time-consuming to switch settings back and forth. To achieve automation, consider making a script to switch sources.
Scripting - Preliminary Scheme
I saw an article on the Internet - script switching, which gave me inspiration. Paste the script here.
As above, you can implement interactive script execution to switch. But this solution still needs to execute the script every time.
Is there a way to do one-click switching? Yes! Alfred can.
Create Alfred Workflow-Advanced Solution
Add input keyword
Add list filter
Add script execution
For the above script, make the following improvements.
mvn setting default configuration
Here is the maven default settings.xml configuration
In order to improve the experience, each time the switch is successful, you will be notified.
So we can switch Maven settings with one click now. Perfect.