This doesn't have the intended effect either. In fact, it pretty much blows
away the entire classpath.
Taking a look at the source code for War sheds some light:
webInf.into('classes') {
from {
def classpath = getClasspath()
classpath ? classpath.filter {File file -> file.isDirectory()} : []
}
}
It looks like this pulls in the contents of *anything* that is a directory,
but without filtering the contents of that directory in any way. I may be
wrong, being new at Gradle and all, but it looks as if I would need to
completely override this behavior in favor of something that works at a more
granular level.
Any other thoughts would be appreciated.
Thanks,
Matt
On Mon, Jan 31, 2011 at 3:04 PM, Rene Groeschke <[email protected]> wrote:
> Hi Matt,
> okay, I you use system.properties only locally (e.g. inside your IDE).
> If you really need to ignore the system.properties just for creating
> your war file you have to exclude that file from your wars classpath:
> ----
> war{
> classpath = fileTree(classpath).exclude('**/system.properties')
> }
> ---
>
> does this fit your needs?
>
> regards,
> René
>
> add the following snippet
> To get the another approach
> Am 31.01.11 21:45, schrieb Matt Stine:
> > This does exclude it from the war, but it also effectively nukes it for
> all
> > gradle tasks. For example, tests which depend on system.properties now
> cause
> > "gradle test" to fail.
> >
> > -Matt
> >
> > On Mon, Jan 31, 2011 at 2:20 PM, Rene Groeschke <[email protected]>
> wrote:
> >
> >> Hi Matt,
> >> you can add the following snippet to your buildfile:
> >> ----
> >> processResources{
> >> exclude '**/system.properties'
> >> }
> >> ----
> >>
> >> regards,
> >> René
> >>
> >> Am 31.01.11 21:07, schrieb Matt Stine:
> >>> I'm trying to exclude a properties file that is located in
> >>> src/main/resources from the war generated via "gradle war." This will
> be
> >>> deployed directly into Tomcat on various environments. The version
> >> located
> >>> in the source tree is only for development on local workstations (i.e.
> >>> running in the IDE or via gradle jettyRun).
> >>>
> >>> Here's what I have:
> >>>
> >>> war {
> >>> exclude '**/system.properties'
> >>> }
> >>>
> >>> Lo and behold, system.properties is still included in the war.
> >>>
> >>> What am I missing?
> >>>
> >>> Thanks in advance for the help.
> >>>
> >>
> >> --
> >> ------------------------------------
> >> Rene Groeschke
> >>
> >> [email protected]
> >> http://www.breskeby.com
> >> http://twitter.com/breskeby
> >> ------------------------------------
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list, please visit:
> >>
> >> http://xircles.codehaus.org/manage_email
> >>
> >>
> >>
> >
>
>
> --
> ------------------------------------
> Rene Groeschke
>
> [email protected]
> http://www.breskeby.com
> http://twitter.com/breskeby
> ------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
--
Matt Stine
Deep South Software: Training, Consulting, Coaching
http://www.deepsouthsoftware.com
[email protected]