I have a multi-module gradle project with the following basic structure:
root core c-interface m-interface
C-interface and m-interface depend on the main project:
compile project(':root:core')
The c-interface and m-interface use the WAR plugin, but the kernel is not and is only a jar.
In the main project, I deal with some file system dependencies with the following. One of these dependencies, which I cannot pack into WAR, generated by the c-interface and m-interface. I used to have this dependency in the nexus maven repository, so I could exclude it by group, name, version in the given run-time configuration in the c-interface and m-interface.
I cannot figure out how to do the same for a file dependency. The gradle dependencies task does not display dependencies between files, so I donβt know what I would invest in the provided runtime.
I am reading http://issues.gradle.org/browse/GRADLE-471 , but trying to use this idea does not seem to delete the archive from my packages. Here is what I am defining now (in core build.gradle):
compile fileTree(dir: 'dependencies/compile/archive', include: '*.jar', exclude: 'management.jar') compile(files('dependencies/compile/archive/management.jar')){ notPackaged = true }
Update
provided Compile without war plugin looked like an opportunity. I installed this in the build.gradle kernel and compiled it perfectly, but the c-interface and m-interface also needed dependencies at compile time. Including the file as provided by Compile (or even checking the health with compilation) in the c-interface and m-interface did not fix compile-time errors due to the absence of the management.jar dependency. My assumption is that it was already limited as provided by Compile in the kernel, that new declarations are ignored in the c-interface and m-interface.
kernel /build.gradle:
configurations { providedCompile } dependencies { providedCompile files('dependencies/compile/archive/management.jar') } sourceSets.main.compileClasspath += configurations.providedCompile sourceSets.test.compileClasspath += configurations.providedCompile sourceSets.test.runtimeClasspath += configurations.providedCompile
C interface / build.gradle:
providedCompile files('dependencies/compile/archive/management.jar')