lnkToKing 2017-06-23 06:12 采纳率: 0%
浏览 10068

IDEA导入gradle项目,所以用compile方式引入包都变成了provided

build.gradle文件配置如下:

 buildscript {
    ext {
        springBootVersion = '1.5.2.RELEASE'
    }
    repositories {
        mavenLocal()
        jcenter()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

version '1.0-SNAPSHOT'

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'

sourceCompatibility = 1.8
targetCompatibility = 1.8

[javadoc, compileTestJava]*.options*.encoding = 'UTF-8'

compileJava {
    options.encoding = 'UTF-8'
    options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}

repositories {
    mavenLocal()
    //mavenCentral()
    jcenter()
}

configurations {
    compile.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
    compile.exclude group: 'org.apache.tomcat'
    compile.exclude group: 'org.apache.tomcat.embed'
    all*.exclude module: 'spring-boot-starter-logging'
}

dependencies {
    compile('org.springframework.boot:spring-boot-starter-jersey')
    //compile('org.springframework.boot:spring-boot-starter-actuator')
    compile('org.springframework.boot:spring-boot-starter-undertow')
    compile('org.springframework.boot:spring-boot-starter-log4j2')

    compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.1.1') // mybatis support

    // use swagger2 for api documentation
    compile('io.swagger:swagger-jersey2-jaxrs:1.5.10')

    compile('org.apache.commons:commons-lang3:3.4')
    compile('commons-codec:commons-codec:1.10')

    runtime('com.alibaba:druid:1.0.27') // alibaba datasource
    runtime('mysql:mysql-connector-java') // mysql jdbc driver
    runtime('org.apache.logging.log4j:log4j-jul:2.7') // log4j jul bridge(for java.util.logging.Logger)

    testCompile('org.springframework.boot:spring-boot-starter-test')
    testCompile('org.glassfish.jersey.connectors:jersey-apache-connector:2.25.1') // support jersey client using apache http client
}

idea {
    module {
        downloadJavadoc = false
        downloadSources = true
    }
}

IDEA导入项目后的包变成了provided
图片说明

  • 写回答

1条回答 默认 最新

  • lnkToKing 2017-06-26 03:37
    关注

    问题解决了,本来用的是2016.3的版本,用最新2017.1的版本就好了

    评论

报告相同问题?

悬赏问题

  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥30 最小化遗憾贪心算法上界
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝