2017-04-05 44 views
0

這可能是一個簡單的問題,但我現在沒有看到它。gradle issue「main」groovy.lang.MissingPropertyException:沒有這樣的屬性:baseDir類:org.apache.catalina.core.StandardEngine

我運行的命令是gradlew.bat appRun --stacktrace 我的期望:我將有一個正在運行的Web應用程序。 (或者至少沒有得到任何錯誤消息)

我實際的:我得到的陳述

「主」 groovy.lang.MissingPropertyException的堆棧跟蹤錯誤消息:沒有這樣的屬性:BASEDIR類:org.apache .catalina.core.StandardEngine

這裏是我的構建腳本

buildscript { 
repositories { 
    maven { 
     url "https://plugins.gradle.org/m2/" 
    } 
} 
dependencies { 
    classpath "org.springframework.boot:spring-boot-gradle-plugin:1.5.2.RELEASE" 
} 

} 

apply plugin: 'org.springframework.boot' 
apply plugin: 'java' 
apply plugin: 'war' 
apply from: 'gretty.plugin' 
apply plugin: 'idea' 

group 'com.mycom' 
version tpos_version 
description 'TPOS' 


idea { 
    project { 
    languageLevel = '1.8' 
    } 
    module { 
     downloadJavadoc = true 
     downloadSources = true 
    } 
} 
sourceCompatibility = 1.8 
targetCompatibility = 1.8 


gretty { 
    httpPort = 9070 
    contextPath = 'rus-tpos' 
    servletContainer = 'tomcat7' 
    realm = 'auth' 
    realmConfigFile = 'tomcat-users.xml' 
} 



repositories { 
    mavenLocal() 
    maven { 
     url nexusReadRepoUrl 
     credentials { 
     username nexusReadUsrName 
     password nexusReadUsrPwd 
     } 
    } 
    jcenter() 

} 


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

dependencies { 
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: spring_boot_version 
compile group: 'org.springframework.boot', name: 'spring-boot-configuration-processor', version: spring_boot_version 
compile group: 'org.springframework.hateoas', name: 'spring-hateoas', version: '0.23.0.RELEASE' 

providedRuntime group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: spring_boot_version 
testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: spring_boot_version 

compile group: 'org.yaml', name: 'snakeyaml', version: '1.18' 
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.5' 
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2' 

compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0' 
compile group: 'com.google.guava', name: 'guava', version: '16.0' 
compile group: 'com.jayway.jsonpath', name:'json-path', version:'2.2.0' 

compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: jackson_version 
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jackson_version 
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: jackson_version 

compile group: 'io.springfox', name: 'springfox-swagger2',version: '2.6.1' 
compile group: 'io.springfox', name: 'springfox-swagger-ui',version: '2.6.1' 

compile group: 'io.springfox', name:'springfox-petstore',version: '2.6.1' 

testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3' 
testCompile group: 'junit', name: 'junit', version: '4.12' 
} 

processResources { 
expand("application.version": version) 
} 

我認爲它與Tomcat也許行

0123特價
providedRuntime group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: spring_boot_version 

或gretty部分,但不知道請讓我知道什麼,我應該提供的任何援助表示讚賞

+0

自從我上次看了這個已經有一段時間了,但相信這是由於在gradle中沒有值。屬性在家庭目錄..我相信這解決了這個問題,但不記得 – user297863

回答

0

它已經有一段時間,因爲我最後看了這一點,但認爲這是由於不在家庭目錄gradle.properties價值..我相信,這解決了這個問題,但不記得

+0

所以Gradle沒有這樣的屬性:錯誤應該解決使gradle.properties有它在任何項目或家庭D irectory並確保您已爲文件中的該屬性分配了一個值。 – user297863

相關問題