ssm中maven中profiles多环境配置

pom.xml


		loanNew
		
			
				src/main/resources
				
				true
			
			
				src/main/webapp/static/ueditor/jsp
				
				true
			
		
	
	
		
			dev
			
				true
			
			
				
				192.168.100.100:3306/dev
				
				http://192.168.11.45/loanNew
				
				loanNew
				
				**有限公司
				
				test
				
				192.168.100.100
				
				d:\\sql\\
				root
				root
				d:\\sql\\
			
			
				
					src/main/resources/jdbc.properties
					src/main/resources/mysql_backup.properties
					src/main/resources/projectUrl.properties
				
			
		

		
			test
			
				
				192.168.100.100:3306/test
				
				http://219.143.6.100:8080/loanNew
				
				loanNew
				
				**有限公司
				
				yin
				
				192.168.100.100
				
				d:\\sql\\
				root
				root
				d:\\sql\\
			
			
				
					src/main/resources/jdbc.properties
					src/main/resources/mysql_backup.properties
					src/main/resources/projectUrl.properties
				
			
		
		
			product
			

				
				192.168.100.100:3306/pro
				
				http://www.***.com/loanNew
				
				loanNew
				
				**有限公司
				
				pro
				
				192.168.100.100
				
				\\usr\\local\\java\\backup_sql\\
				root
				root
				\\usr\\local\\java\\backup_sql\\
			
			
				
					src/main/resources/jdbc.properties
					src/main/resources/mysql_backup.properties
					src/main/resources/projectUrl.properties
				
			
		
	


properties文件(以projectUrl.properties为例):

pro.url=${pro.url}
pro.name=${pro.name}
pro.company=${pro.company}
db.name=${db.name}
db.ip=${db.ip}


至此,多环境配置完成了,打包项目到服务器时只需Maven Bulid然后输入:package/package -Ptest/package -Pproduct即可

你可能感兴趣的:(框架)