admin管理员组

文章数量:1530318

今天在编写项目的时候,导入了sigr:1.6.4的时候,报

Errors occurred while build effective model from 
C:\Users\xxx\.gradle\caches\modules-2\files-2.1\log4j\log4j\1.2.15\1483490805e8f86c21240958629905e733d079eb\log4j-1.2.15.pom:
    'build.plugins.plugin[io.spring.gradle.dependencymanagement.apache.maven.plugins:maven-antrun-plugin].dependencies.dependency.scope' for junit:junit:jar must be one of [compile, runtime, system] but is 'test'. in log4j:log4j:1.2.15

 在网上找了许多的问题,发现很少有真正解决的。经过我自己发现,原因是

  • org.springframework.boot:spring-boot-starter-web和sigr都会加载log4j,这样就产生jar冲突,因此,只需要把其中一个依赖去除log4j就可以,我这里去除的是sigr下的:

implementation ('org.fusesource:sigar:1.6.4'){
		exclude group:'log4j'
	}

利用exclude,可以对gradle中加载的某一个去除,冲突解决!

ps:如果需要源码的朋友,可以加QQ群获取,群:1039603877

--------------------------------------------------------------------------------------------

QQ群:1039603877,本群创建于2020/2/3:  本群原为1999人大群,主要是进行java开发技术交流,里面有java开发的业界大佬、牛人,很多群友都是CTO或者技术负责人,同时也有关于java岗位招聘等消息。欢迎大家进群学习和交流
 

本文标签: 报错解决方案BuildoccurredErrors