问题
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.
回答1:
have you applied eclipse-wtp
. I think eclipse-wtp
needs to be applied to all projects, including the root project if you have multiple projects.
My reference to the answer.
回答2:
There was a providedCompile 'anotherproject'
dependency, which contains log4j, and blocks it in dependent module.
来源:https://stackoverflow.com/questions/30238040/missing-dependencies-in-war-gradle-build-project