buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lacton <>
Subject Re: Using Include/Exclude when Packaging Jars
Date Wed, 10 Sep 2008 06:01:42 GMT

I think what your looking for is the 'clean' method.


Other than that, package :jar includes the contents of the compiler's
target directory and resources, which most often is exactly what you
intend it to do. If you want to include other files in the JAR,
instead or in addition, you can do so using the include and exclude
methods. If you do not want the target directory included in your JAR,
simply call the clean method on it:

package(:jar).clean.include( only_these_files )

In your case, that would mean writing

package(:jar, :file=>foo_jar).clean.include('**/Foo*.class')


On Tue, Sep 9, 2008 at 10:37 PM, rp.andrew.moore
<> wrote:
> rp.andrew.moore wrote:
>> Hi, I'm relatively new to ruby and buildr, but I'm running into some
>> trouble when including or excluding class files for a jar.
>> I'm building two jars from the same sub project... one jar has all but a
>> couple class files, while the other jar needs to exclude all but a couple
>> class files.
>> It seems like this does what I expect when excluding a few files:
>>     package(:jar).exclude('**/Foo*.class')
> I forgot to mention that the result of running the exclude like this is that
> I get a jar with all the class files that don't start with "Foo". Which is
> what I expect. It is the "include" part that doesn't behave as I expected.
> Thanks again for your help.
> ~ Andrew
> --
> View this message in context:
> Sent from the Apache Buildr - User mailing list archive at

View raw message