This should work,

package(:war).path('WEB-INF/classes').exclude(_(:target, :classes,
"org/fedoraproject/candlepin/model/**.class"))

This exclude business is haphazard at best.  I had to try different
combinations until I got to the working one.

We're tracking this issue with
http://issues.apache.org/jira/browse/BUILDR-335 and I'll hope to give it a
good kick in the schnaz when I get time.

alex


On Tue, Mar 9, 2010 at 8:41 AM, Jesus M. Rodriguez <jmro...@gmail.com>wrote:

> On Mon, Mar 8, 2010 at 6:28 PM, Alex Boisvert <alex.boisv...@gmail.com>
> wrote:
> > On Mon, Mar 8, 2010 at 2:04 PM, Jesus M. Rodriguez <jmro...@gmail.com
> >wrote:
> >
> >> I'm trying to package up our model classes in their own jar file with
> >> the name of model.jar.
> >>
> >> I got it to generate the jar file with just my model classes but can't
> >> figure out how to give it a different name.
> >>
> >>  package(:jar).clean.include
> >> 'target/classes/org/fedoraproject/candlepin/model',
> >> :path=>"org/fedoraproject/candlepin/"
> >>
> >> The next part is excluding those classes from the war file, any tips
> >> on this would also be helpful.
> >>
> >> Thanks in advance,
> >>
> >>
> > Hi Jesus,
> >
> > To change the name you use the :id parameter,
> >
> > package :jar, :id=>'candlepin'
> >
> > To exclude classes from the .war, you have to use the (unintuitive) path
> +
> > exclude combination,
> >
> >
> package(:war).path('WEB-INF/classes').exclude('org/fedoraproject/candlepin/model/**/*')
>
> That doesn't seem to work. The war file still has all of the model
> classes in it.
> I tried a few things:
>
> package(:war).path('WEB-INF/classes').exclude('**/model/**/*')
> ...('WEB-INF/classes/**/model/**')
> ...('WEB-INF/classes/org/fedoraproject/candlepin/model/**')
> ...('org/fedoraproject/candlepin/model')
>
> and quite a few others :)
>
> jesus
>

Reply via email to