Eclipse-使用码头在Gradle项目中启动后,控制台中没有日志记录

时间:2018-12-28 12:23:23

标签: eclipse gradle jetty build.gradle logback

我刚开始使用gradle和码头环境进行开发。我有一个现有的gradle项目,该项目在码头上运行。当我使用“ Run jetty”运行应用程序时,在Eclipse控制台中仅显示启动日志。我可以访问所有api端点。这意味着应用程序已成功启动。但是我看不到代码中存在的任何日志。

2018-12-28 17:23:15.877:INFO::jetty-6.1.26
2018-12-28 17:23:17.649:INFO:/controller:Initializing Spring root WebApplicationContext
2018-12-28 17:25:15.897:INFO:/controller:Initializing Spring FrameworkServlet 'restsvc'
2018-12-28 17:25:18.201:INFO::Started SelectChannelConnector@0.0.0.0:8080

这是加载所有jar文件之后控制台中的最后四行。

我不知道问题是什么。我试图找出答案。可能是gradle设置问题。我已经附加了gradle.properties文件和build.gradle文件。

gradle.properties

    version = 2.0-SNAPSHOT
    langLevel = 1.7
    defaultEncoding = UTF-8

    ### ORACLE CHANGE :  CONFIGURATION ###
    jettyHome = C:/jetty-distribution-8.1.21.v20160908/jetty-distribution-8.1.21.v20160908
    ideaJdkName = 1.8.0_101

    springVersion = 4.0.6.RELEASE
    springWsVersion = 2.2.0.RELEASE
    hibernateVersion = 4.3.6.Final
    bonecpVersion = 0.8.0.RELEASE
    guavaVersion = 18.0
    mysqlVersion = 5.1.32
    slf4jVersion = 1.7.7
    logbackVersion = 1.1.2
    jacksonDatabindVersion = 2.4.1.3
    servletApiVersion = 3.1.0
    javaPNSVersion = 2.2.1
    springSecurityVersion = 4.0.2.RELEASE
    javaxMailVersion = 1.4.1
    springContextSupportVersion = 4.0.5.RELEASE
    apacheHttpComponentsHttpClientVersion = 4.3.3
    mpkorstanjeSimmetricsCore = 4.1.0
    springBootStarterRedisVersion = 1.2.0.RELEASE
    junitVersion = 4.12
    commonIoVersion = 1.3.2
    lombokVersion = 1.16.18
    pushyVersion = 0.13.3

build.gradle

ext.projectGroup = rootProject.name    
buildscript {
  repositories {
    jcenter()
  }
  dependencies {
    classpath "no.nils:wsdl2java:0.6"
    classpath 'org.codehaus.groovy:groovy-backports-compat23:2.3.5'
  }
}



allprojects {
  apply plugin: 'idea'
  //apply plugin: 'io.spring.dependency-management'

  repositories {
    mavenLocal()
    mavenCentral()
  }
}

// apply from: file('gradle/check.gradle')

subprojects {
  apply plugin: 'java'

  group = "lk.ideahub.${projectGroup}"
  sourceCompatibility = langLevel
  targetCompatibility = langLevel

  compileJava {
    options.encoding = defaultEncoding
    options.compilerArgs = ["-Xlint:deprecation", "-Xlint:unchecked"]
  }

  compileTestJava {
    options.encoding = defaultEncoding
  }

  tasks.withType(Jar) {
    baseName = "${projectGroup}-${project.name}"
  }

  tasks.withType(War) {
    baseName = "${projectGroup}-${project.name}"
  }

  configurations {
    all*.exclude group: "commons-logging", module: "commons-logging"
  }

  dependencies {
    compile "org.springframework:spring-context:${springVersion}"
    compile "org.slf4j:slf4j-api:${slf4jVersion}"
    compile "org.projectlombok:lombok:${lombokVersion}"
  }
}

project(':service') {
  dependencies {
  }
}

project(':controller') {
  apply plugin: 'war'

  dependencies {
    compile project(':modules')
    compile "org.springframework:spring-webmvc:${springVersion}"
    compile "org.slf4j:jcl-over-slf4j:${slf4jVersion}"
    compile "org.slf4j:jul-to-slf4j:${slf4jVersion}"
    compile "org.slf4j:log4j-over-slf4j:${slf4jVersion}"
    compile "ch.qos.logback:logback-core:${logbackVersion}"
    compile "ch.qos.logback:logback-classic:${logbackVersion}"
    compile "com.fasterxml.jackson.core:jackson-databind:${jacksonDatabindVersion}"
    compile "org.apache.commons:commons-io:${commonIoVersion}"
    providedCompile "javax.servlet:javax.servlet-api:${servletApiVersion}"
  }

  task deploy(type: Copy) {
    from war
    into "${jettyHome}/webapps"
  }
}

project(':modules') {
  apply plugin: 'no.nils.wsdl2java'

  wsdl2java {
    wsdlsToGenerate = [
            [file("$projectDir/src/main/resources/VoucherService.wsdl")],
            [file("$projectDir/src/main/resources/CGWebService.wsdl")]
    ]
    generatedWsdlDir = file("$projectDir/src/generated/java")
    wsdlDir = file("$projectDir/src/main/resources")
  }

  afterEvaluate {
    compileJava.dependsOn.remove wsdl2java
    compileJava.dependsOn.remove xsd2java
    clean.dependsOn.remove deleteGeneratedSources
    wsdl2java.dependsOn deleteGeneratedSources
  }

  sourceSets {
    main.java.srcDirs += [wsdl2java.generatedWsdlDir]
  }

  dependencies {
    compile "org.springframework:spring-orm:${springVersion}"
    compile "org.springframework:spring-webmvc:${springVersion}"
    compile "org.springframework.ws:spring-ws-core:${springWsVersion}"
    compile "org.springframework:spring-aop:${springVersion}"
    compile 'org.aspectj:aspectjrt:1.6.11'
    compile 'org.aspectj:aspectjweaver:1.6.11'
    compile "org.hibernate:hibernate-entitymanager:${hibernateVersion}"
    compile "com.jolbox:bonecp:${bonecpVersion}"
    compile "com.google.guava:guava:${guavaVersion}"
    // ### ORACLE CHANGE :  CONFIGURATION ###
    //compile "mysql:mysql-connector-java:${mysqlVersion}"
    compile "com.fasterxml.jackson.core:jackson-databind:${jacksonDatabindVersion}"
    compile "com.github.fernandospr:javapns-jdk16:${javaPNSVersion}"
    compile "org.springframework.security:spring-security-core:${springSecurityVersion}"
    compile "javax.mail:mail:${javaxMailVersion}"
    compile "org.springframework:spring-context-support:${springContextSupportVersion}"
    compile "org.apache.httpcomponents:httpclient:${apacheHttpComponentsHttpClientVersion}"
    compile "com.github.mpkorstanje:simmetrics-core:${mpkorstanjeSimmetricsCore}"
    compile "org.springframework.boot:spring-boot-starter-redis:${springBootStarterRedisVersion}"
    compile 'org.springframework:spring-test:4.1.7.RELEASE'
    compile "net.sf.ehcache:ehcache-core:2.4.6"
    compile "io.jsonwebtoken:jjwt:0.7.0"
    compile "com.turo:pushy:0.13.3"
    compile "org.apache.poi:poi:3.17"        // For `.xls` files
    compile "org.apache.poi:poi-ooxml:3.17"  // For `.xlsx` files
    compile "io.netty:netty-tcnative-boringssl-static:2.0.8.Final"

    testCompile "junit:junit:${junitVersion}"
    compile fileTree('lib')
  }
}

idea {
  project {
    jdkName = ideaJdkName
    languageLevel = langLevel
  }
}

任何帮助将不胜感激。

非常感谢您!

0 个答案:

没有答案