在战争中缺乏依赖性。 Gradle构建项目 [英] Missing dependencies in war. Gradle build project

查看:122
本文介绍了在战争中缺乏依赖性。 Gradle构建项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由gradle构建的战争项目。
我在gradle.build文件中有一个字符串: compile'log4j:log4j:1.2.17'
但是没有任何log4j.jar在myproject.war文件中生成的WEB-INF / lib目录中。



但在编译配置中定义的所有其他库都存在。
为什么这么奇怪的行为,它是一个错误还是某种功能?如何将它包含在我的webarchive中?



Eclipse在项目的web app libraries部分显示log4j.jar。
我在Eclipse和控制台中使用gradle v.2.3。

解决方案

有一个 provideCompile'anotherproject'依赖项,其中包含log4j,并将其封锁在依赖模块中。


I've a war project build by gradle. And I've a string in gradle.build file: compile 'log4j:log4j:1.2.17' But thereis no any log4j.jar in resulting WEB-INF/lib directory in myproject.war file.

But all other libs defined in "compile" configuration are there. Why so strange behaviour, is it a bug or some kind of feature? And how to include it in my webarchive?

Eclipse shows log4j.jar in "web app libraries" part of the project. I'm using gradle v. 2.3 from Eclipse and console.

解决方案

There was a providedCompile 'anotherproject' dependency, which contains log4j, and blocks it in dependent module.

这篇关于在战争中缺乏依赖性。 Gradle构建项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆