Maven依赖最佳实践

1、排除依赖

剔除传递依赖,改直接依赖


	4.0.0
	com.juvenxu.mvnbook
	project-a
	1.0.0
	
		
			com.juvenxu.mvnbook
			project-b
			1.0.0
			
				
					com.juvenxu.mvnbook
					project-c
				
			
		
		
			com.juvenxu.mvnbook
			project-c
			1.1.0
		
	

2、归类依赖

中定义常量,中使用


	4.0.0
	com.juvenxu.mvnbook
	account-email
	1.0.0
	
	
		2.5.6
	
	
		
			org.springframework
			spring-core
			${springframework.version}
		
		
			org.springframework
			spring-beans
			${springframework.version}
		
		
			org.springframework
			spring-context
			${springframework.version}
		
	

3、优化依赖

mvn dependency:list

mvn dependency:tree

mvn dependency:analyze

你可能感兴趣的:(Java,maven,java,前端)