tomcat - gradle 问题 "main"groovy.lang.MissingPropertyException : No such property: baseDir for class: org. apache.catalina.core.StandardEngine

标签 tomcat gradle spring-boot gretty

这可能是一个简单的问题,但我现在没有看到。

我运行的命令是 gradlew.bat appRun --stacktrace 我的期望:我将有一个正在运行的 Web 应用程序。 (或者至少不会收到任何错误信息)

我的实际情况:我收到一条堆栈跟踪错误消息,指出

“main”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 可能是行

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

或在 gretty 部分但不确定请让我知道我还应该提供什么,我们将不胜感激

最佳答案

自从我上次看这个已经有一段时间了,但我相信这是由于主目录的 gradle.properties 中没有值。我相信这解决了这个问题,但不记得了

关于tomcat - gradle 问题 "main"groovy.lang.MissingPropertyException : No such property: baseDir for class: org. apache.catalina.core.StandardEngine,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43230675/

相关文章:

file - 为什么 lsof 报告的打开文件数高于 ulimit 的 "open file"输出

java - 如何使用注释为 spring 设置 context.xml?

unity3d - ClassNotFoundException 与 Unity 中的 moshi

java - Kafka无序消息场景处理

java - Spring Boot viewControllerHandlerMapping配置

eclipse - 在不重新加载页面的情况下将 jsp、css、js、html 的更改反射(reflect)到浏览器

java - 分布式 session 处理

android - 如何在Android库项目中按测试类型分隔源文件?

android - react 原生创建一个 android 模块 .gitignore 文件

java - 使用 Hikari CP 检测到明显的连接泄漏