spring-gradle-plugins / dependency-management-plugin

A Gradle plugin that provides Maven-like dependency management functionality
692 stars 87 forks source link

Errors occurred while build effective model #186

Closed 358235737 closed 7 years ago

358235737 commented 7 years ago

while i refresh dependencies,always show : Errors occurred while build effective model from D:\Users\DENGXINTAO073.gradle\caches\modules-2\files-2.1\log4j\log4j\1.2.16\88efb1b8d3d993fe339e9e2b201c75eed57d4c65\log4j-1.2.16.pom: 'build.plugins.plugin[io.spring.gradle.dependencymanagement.org.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.16

below as my build.gradle

buildscript { ext { springBootVersion = '1.5.3.RELEASE' } repositories { maven { url "http://nexus-stock.paic.com.cn:8080/nexus/content/repositories/public/" } } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") } }

allprojects { apply plugin: 'java' //Java插件 apply plugin: 'eclipse-wtp'//eclipse插件 apply plugin: 'idea' apply plugin: 'org.springframework.boot'

dependencyManagement {
  imports {
    mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Dalston.SR3'
  }
}

group = 'com.pa.openapi'
version = '1.0'
sourceCompatibility = 1.8//编译JDK版本
targetCompatibility = 1.8//目标JDK版本
compileJava.options.encoding = 'UTF-8'//编码设置
compileTestJava.options.encoding = 'UTF-8'

}

//所有子项目配置 final def var = subprojects { //skipTest跳过测试 gradle build -Dfile.encoding=UTF-8 -PskipTest=true test.onlyIf { !project.hasProperty('skipTest') } //仓库配置 //参照http://gradle.org/docs/2.2.1/userguide/dependency_management.html#sec:repositories //51.6 Repositories repositories { //mavenLocal() //mavenCentral() maven { url "http://nexus-stock.paic.com.cn:8080/nexus/content/repositories/public/" } } //MANIFEST.MF //jar清单,清单内容中可以按需求配置 jar { manifest { attributes("Implementation-Title": "Gradle", "Implementation-Version": version) } } //依赖管理 //参照http://gradle.org/docs/2.2.1/userguide/dependency_management.html

configurations {
        all*.exclude group: 'com.sun.jersey.contribs', module: 'jersey-apache-client4'
        all*.exclude group: 'com.sun.jersey', module: 'jersey-core'
        all*.exclude group: 'com.sun.jersey', module: 'jersey-client'
        //all*.exclude group: 'org.springframework.cloud', module: 'spring-cloud-netflix-core'
        //all*.exclude group: 'com.netflix.ribbon', module: 'ribbon'
        //all*.exclude group: 'com.netflix.ribbon', module: 'ribbon-core'
        //all*.exclude group: 'com.netflix.ribbon', module: 'ribbon-httpclient'
        //all*.exclude group: 'com.netflix.ribbon', module: 'ribbon-loadbalancer'
        compile.exclude group: 'io.github.openfeign', module: 'feign-core'
}

dependencies {
    compile 'org.springframework:spring-orm'
    compile 'org.springframework:spring-test'
    //compile 'org.springframework.cloud:spring-cloud-starter-config'
    //compile 'org.springframework.cloud:spring-cloud-starter-eureka'
    compile 'org.springframework.cloud:spring-cloud-zookeeper-dependencies'
    compile 'org.springframework.cloud:spring-cloud-starter-zookeeper-discovery'
    //compile 'org.springframework.cloud:spring-cloud-starter-zipkin:1.1.3.RELEASE'
    compile 'org.springframework.cloud:spring-cloud-starter-zipkin'
    //compile 'org.springframework.cloud:spring-cloud-starter-sleuth'
    compile 'org.springframework.cloud:spring-cloud-starter-feign'
    //compile 'org.springframework.cloud:spring-cloud-starter-zookeeper-config'
    //compile 'org.springframework.cloud:spring-cloud-starter-zookeeper-all'
    compile 'org.springframework.boot:spring-boot-starter-jdbc'
    //compile 'org.springframework.boot:spring-boot-starter-data-jpa'

    compile 'org.springframework.boot:spring-boot-starter-parent'
    compile ("org.springframework.boot:spring-boot-starter-web"){
         exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
    }
    testCompile 'org.springframework.boot:spring-boot-starter-test'
    compile 'org.springframework.boot:spring-boot-configuration-processor'
    compile 'org.springframework.boot:spring-boot-starter-actuator'

    compile group: 'org.glassfish.jersey.core', name: 'jersey-client', version: '2.25.1'
    compile group: 'org.glassfish.jersey.core', name: 'jersey-server', version: '2.25.1'
    compile group: 'org.glassfish.jersey.core', name: 'jersey-common', version: '2.25.1'

    compile group: 'com.netflix.feign', name: 'feign-httpclient', version: '8.18.0'

    compile group: 'org.bgee.log4jdbc-log4j2', name: 'log4jdbc-log4j2-jdbc4', version: '1.16'
    //compile group: 'log4j', name: 'log4j', version: '1.2.17'
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2'
    compile group: 'commons-collections', name: 'commons-collections', version: '3.2.1'
    compile group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.0'
    //compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.13'
    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.13'
    compile group: 'ch.qos.logback', name: 'logback-access', version: '1.2.3'
    compile group: 'commons-logging', name: 'commons-logging', version: '1.1.3'
    compile group: 'org.aspectj', name: 'aspectjweaver', version: '1.8.0'
    compile group: 'org.aspectj', name: 'aspectjrt', version: '1.8.6'
    compile group:  'org.codehaus.jackson', name:'jackson-core-lgpl', version:'1.9.13'

    compile group: 'javax.validation', name: 'validation-api', version: '1.1.0.Final'
    testCompile group: 'junit', name: 'junit', version: '4.11'
    compile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'

    compile group: 'org.codehaus.jackson', name: 'jackson-mapper-asl', version: "1.9.13"
    compile group: 'javax.servlet.jsp', name: 'jsp-api', version: "2.2"
    compile group: 'javax.servlet', name: 'javax.servlet-api', version: "3.0.1"
    compile group: 'jstl', name: 'jstl', version: "1.2"
    compile group: 'commons-fileupload', name: 'commons-fileupload', version: "1.3.1"
    compile group: 'org.hibernate', name: 'hibernate-validator', version: "5.2.2.Final"
    compile group: 'org.antlr', name: 'antlr', version: "3.5.2"
    compile group: 'dom4j', name: 'dom4j', version: "1.6.1"
    compile group: 'org.hibernate.javax.persistence', name: 'hibernate-jpa-2.1-api', version: "1.0.0.Final"
    compile group: 'org.jboss', name: 'jandex', version: "1.1.0.Final"
    //compile group: 'javassist', name: 'javassist', version: "3.18.1-GA"
    compile group: 'org.jboss.logging', name: 'jboss-logging', version: "3.3.1.Final"
    compile group: 'org.jboss.logging', name: 'jboss-logging-annotations', version: "2.0.1.Final"
    compile group: 'org.jboss.spec.javax.transaction', name: 'jboss-transaction-api_1.2_spec', version: "1.0.0.Final"
    compile group: 'com.mchange', name: 'c3p0', version: "0.9.2.1"
    //compile group: 'com.oracle', name: 'ojdbc14', version: "10.2.0.4.0"
    compile group: 'com.alibaba', name: 'fastjson', version: "1.2.29"

    //hession jar
    //compile group: 'com.john.spring', name: 'hessian-intf', version: "1.0.0"
    compile group: 'com.caucho', name: 'hessian', version: "4.0.7"

    compile group: 'org.apache.httpcomponents', name: 'httpclient', version: "4.5"
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "2.6.2"
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "2.6.2"
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: "2.6.2"
    compile group: 'com.google.code.gson', name: 'gson', version: "2.3.1"
    //compile group: 'commons-httpclient', name: 'commons-httpclient', version: "3.1"
    compile group: 'commons-codec', name: 'commons-codec', version: "1.10"
    compile group: 'com.google.guava', name: 'guava', version: "18.0"
    // compile (group:"org.mortbay.jetty", name:"jetty", version:"6.1.26") {
        // exclude(module: 'servlet-api')
     //}
     //dubbo
    compile (group:"com.alibaba", name:"dubbo", version:"2.8.7-pa-3") {
        exclude(module: 'spring')
        exclude(module: 'servlet-api')
    }
    //rest
    compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: "2.0"
  }

}

wilkinsona commented 7 years ago

Does your build actually fail? I believe that the error is benign, but it is indicating that log4j's pom is faulty. There's nothing that the dependency management plugin can do about the problems with log4j's pom.

358235737 commented 7 years ago

yes, it's ok ,while i update the log4j's pom to find the junit.jar and the change the scope as runtime,then the error disappeared ,thank you ~~!!!