Use the Shell script in Linux to switch the settings. xml file of Maven
Source: Internet
Author: User
Use the Shell script in Linux to switch the settings of Maven. xml File 1. Problem background www.2cto.com because there are separate maven configurations in the company and at home, you need to modify settings frequently. the activeProfile in xml to switch the profile. It's still too troublesome...
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.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.