resolved, found this:
http://stackoverflow.com/questions/5644011/multi-project-test-dependencies-with-gradle
in upstream:
configurations { customArtifacts }
artifacts { customArtifacts customJar }
in downstream:
dependencies {
compile project(":upstream") // adds default configurations jar to main
war
customWar project(":upstream")
customWar project(path: ":upstream", configuration: "customJar") // adds
custom jar from the new config
}
On Fri, Nov 11, 2011 at 8:54 PM, Brett Cave <[email protected]> wrote:
> hi,
>
> I have a multi project build. the upstream is a java project that produces
> 2 jar artifacts. The 2nd artifact is generated with:
>
> task customJar(type: Jar, dependsOn: customTaskClasses) {
>
> classifier = 'custom'
>
> from sourceSets.customTask.classes
> includes = ["com/**"]
>
> excludes = ["**/client"]
>
> }
>
> artifacts {
> archives customJar
> }
>
>
> The downstream project is a war project, with a default war task and an
> additional war task, generating 2 war artifacts. It has a dependency on the
> upstream, declared as:
>
> compile project(":upstream")
> customWar project(":upstream")
>
> The default war artifact requires the default artifact from upstream, but
> NOT the customJar. The customWar requires both artifacts.
>
> How would I exclude the customJar artifact from the default war?
>
> I have tried the following:
>
> // exclude filter on war task.
> war { excludes = ["**/*-custom.jar"] }
>
> // setting the dependency based on the upstream's runtime configuration:
> compile project(path: ":upstream", configuration: "runtime")
> // fails with "configuration not public" -
> http://comments.gmane.org/gmane.comp.programming.tools.gradle.user/7252
>
> // setting the dependency to the upstream's main classes:
> compile project(":upstream").sourceSets.main.classes
> // transitive dependencies are not resolved - classpath issues result in
> classnotfound exceptions.
>
>
> Perhaps a war.doLast that repacks the war, filtering out the custom jar?
>
> Regards,
>
>
>
--
Brett Cave
Jemstep, Inc
www.jemstep.com