Java IntelliJ Idea在提供的作用域中添加“ProviderdCompile”依赖项
我正在开发一个spring启动应用程序,它是由spring初始值设定项创建的,并且正在开发IntelliJ Idea 2017.3.4和Gradle 4.5.1,需要进行Java IntelliJ Idea在提供的作用域中添加“ProviderdCompile”依赖项,java,spring,spring-boot,gradle,intellij-idea,Java,Spring,Spring Boot,Gradle,Intellij Idea,我正在开发一个spring启动应用程序,它是由spring初始值设定项创建的,并且正在开发IntelliJ Idea 2017.3.4和Gradle 4.5.1,需要进行.war部署。为此,我将war插件添加到Gradle配置中,并将依赖项从 dependencies { compile('org.springframework.boot:spring-boot-starter-web') ...} 到 如前所述。war部署完美,但我的开发运行配置由于未找到依赖项而被破坏。我发
.war
部署。为此,我将war
插件添加到Gradle配置中,并将依赖项从
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
...}
到
如前所述。war部署完美,但我的开发运行配置由于未找到依赖项而被破坏。我发现这是因为Idea(或Gradle,idk)决定providedCompile
依赖项的范围必须为provided
。但是war插件清楚地记录了providedCompile
和providedRuntime
与compile
和runtime
具有相同的作用域
我怎样才能解决这个问题?我已经尝试过将作用域设置为手动编译,事情得到了解决,但这一直被Gradle覆盖。有没有一个非黑客的解决方案
感谢您的帮助
dependencies {
compile('org.springframework.boot:spring-boot-starter-web'){
exclude module: "spring-boot-starter-tomcat"
}
providedCompile 'org.springframework.boot:spring-boot-starter-tomcat'
...}