Gradle war ignores transitive dependencies when using 'configurations.runtime.asPath' in custom task -
i'm facing behavior can't explain, using gradle 1.10 have:
settings.gradle:
include('lib1', 'lib2', 'web')
build.gradle:
subprojects { apply plugin: 'java' } project(':web') { apply plugin: 'war' dependencies { compile project(':lib1') } task mytask(type: javaexec, dependson: 'compilejava') { main = "some.thirdparty.class" args "--searchpath", configurations.runtime.aspath } } project(':lib1') { dependencies { compile project(':lib2') } } project(':lib2') { }
when run gradle clean war
have lib1.jar
in war/build/libs/web.war/web-inf/lib
.
to make web-inf/lib
contain both lib1.jar
, lib2.jar
have to:
- move
project('web')
block end of file - update
configurations.runtime.aspath
configurations.runtime
(but need provide class path path, not solution)
i read build lifecycle description, tried compare --debug outputs didn't help.
why happening? , solution provide module runtime class path path in javaexec task please?
aspath
resolves configuration, resolution work correctly if happens @ execution time rather configuration time (in particular in presence of project dependencies). try wrap args
line dofirst { ... }
.
Comments
Post a Comment