Use the Shell script in Linux to switch to the settings. xml file of Maven. 1. Problem Background: www.2cto.com. Because there are separate maven configurations in the company and at home, you need to modify settings. xml frequently.
To switch the profile. It is still too troublesome, so I plan to write a Shell to solve this problem. Ii. Analysis Solution a. First set settings. xml copies two copies called settings-home.xml one copy called settings-work.xml B, using automatic generation of soft connections to replace settings. xmlconf/change-setting.sh (and set executable permissions) file content: 01 #! /Bin/bash02PS3 = 'Please enter your choice: '03options = ("settings-home" "settings-work" "quit ") 04 select opt in "$ {options [@]}" 05do06 case $ opt in07 "settings-home") 08 ln-sf settings-home.xml settings. xml09 echo "change to settings-home! "10; 11" settings-work ") 12 ln-sf settings-work.xml settings. xml13 echo" change to settings-work! "14; 15" quit ") 16 break17; 18 *) echo invalid option; 19 esac20donec. Run this sh when switching.