使用maven的maven-shade-plugin插件时需要注意的一个问题

maven-shade-plugin插件有个配置属性:createDependencyReducedPom,默认值为true.

注意这个属性,如果你用这个插件来deploy,或者发布到中央仓库

这个属性会缩减你的pom文件,会把你依赖的干掉

正确的做法是把这个值改成false


				org.apache.maven.plugins
				maven-shade-plugin
				1.4
				
					false
				
				
					
						package
						
							shade
						
						
							
								
									org.durcframework.core.MainCore
								
							
						
					
				
			

官方说法:

createDependencyReducedPom boolean - Flag whether to generate a simplified POM for the shaded artifact. If set to true, dependencies that have been included into the uber JAR will be removed from the  section of the generated POM. The reduced POM will be named dependency-reduced-pom.xml and is stored into the same directory as the shaded artifact. Unless you also specify dependencyReducedPomLocation, the plugin will create a temporary file named dependency-reduced-pom.xml in the project basedir.
Default value istrue.

http://maven.apache.org/plugins/maven-shade-plugin/shade-mojo.html

你可能感兴趣的:(maven)