On 6/17/11 6:39 AM, Szczepan Faber wrote:
Would this put all of the flat war's dependencies into the ear's lib dir?  I
can't see that it would...

You're right, it wouldn't.

What do you think?

Would it also remove the jars from WEB-INF/lib of the war?

No, you'd need to have avoided putting them there yourself by using providedCompile and/or providedRuntime in the war project's dependencies instead of compile and/or runtime. That plus setting the ear plugin's skinnyDeploy flag to true will do the job (I tested it yesterday).

I can make a pull request for this if you like.

It feels that the ear plugin is missing a direct way of configuring
the contents of the lib folder. Something like war plugin's
'classpath' property.

Well, technically classpath isn't really direct access to the war's lib folder--it puts things into different places depending on whether they're files or folders. With that said, the ear task has a "lib" CopySpec property that can be used to put stuff into the ear's lib folder. Should I add something else? I'm not familiar enough with Gradle's constructs like CopySpec and FileCollection, nor Task and Plugin to understand what would work and what wouldn't.

On Thu, Jun 16, 2011 at 5:22 PM, David Gileadi<[email protected]>  wrote:
On 6/16/11 5:00 AM, Szczepan Faber wrote:

Hey,

I'm reluctant to add additional properties to the dependency notation
to satisfy the ear plugin. However, we can surely figure out some
other way to configure such behavior :)

BTW. I think you can already achieve what you need with vanilla
Gradle. Have your war project configure a 'flat' configuration:

configurations {
        flat
}

task flatWar(type: War, dependsOn: classes) {
        classpath = sourceSets.main.output
}

artifacts {
     flat flatWar
}

Then in your ear project:

dependencies {
     deploy project(path: ':myWebApp', configuration: 'flat')
}

Would this put all of the flat war's dependencies into the ear's lib dir?  I
can't see that it would...

My thinking was that you could put all of the war project's dependencies
into the war's providedCompile configuration, which I thought would create a
war without those dependencies in its WEB-INF/lib:

apply plugin: 'war'
dependencies {
  providedCompile 'com.acme:awesome-api:1.0'
  // etc.
}

The ear would still need some kind of a flag to let it know that it should
put all the war's dependencies into its own lib dir.  On my local system I
created such a flag:

ear {
  skinnyDeploy = true
}
dependencies {
  deploy project('mywar')
}

Which tells the ear plugin to put all the dependencies from its "deploy"
modules into its own lib dir.  I think I have it working, but it needs more
testing.

What do you think?


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email









---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to