Replacing the jar from the runtime messes up scenarios where the jar is depended upon by other wars/jars. A more optimal solution is to put wars (and jars when applying a new ejb-jar plugin) into a new configuration (ear-components or some other name) that is automatically picked up by an ear depending upon it.
:-( Unfortunately, I've been unable to devote any time to implementing such a solution over the past month and a half. I'm hoping that changes in a couple of weeks, but no promises. -Spencer >________________________________ > From: "[email protected]" <[email protected]> >To: [email protected] >Sent: Friday, January 6, 2012 2:03 PM >Subject: Re: [gradle-user] Re: Can't access war artifact from dependencies in >1.0? > > >Personally, it seems that applying the WAR plugin should put the WAR artifact in the runtime configuration (replacing the JAR). Since we are wrapping all of the Gradle plugins for other reasons, we have the following workaround in place. Another hack approach, but this allows us to use simple project dependencies and get the intended effect. > >project.configurations.each { Configuration configuration -> > def jarArtifact = configuration.artifacts.find { > it.file == jar.archivePath > } > if (jarArtifact != null) { > configuration.artifacts.remove(jarArtifact) > project.artifacts.add(configuration.name, task) > } >} > >Here's the link to the issue Bryan >references:http://issues.gradle.org/browse/GRADLE-1912 > >Andrew Oberstar > > > >From: bryan <[email protected]> >To: [email protected] >Date: 01/06/2012 12:52 PM >Subject: [gradle-user] Re: Can't access war artifact from dependencies in 1.0? >>________________________________ > > > >FWIW, the solution above isn't entirely complete. I also wanted to package >the transitive dependencies for the war that were not embedded in the war >itself. Thus in addition to above, I also specified: > >compile project(":mywar") > >...and in mywar's build.grade I set jar.enabled=false. Kind of a hack but >gets the job done until GRADLE-1912 is fixed. > >-- >View this message in context: >http://gradle.1045684.n5.nabble.com/Can-t-access-war-artifact-from-dependencies-in-1-0-tp5124737p5126375.html >Sent from the gradle-user mailing list archive at Nabble.com. > >--------------------------------------------------------------------- >To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > > > >
