Forum: JRuby warble duplicate jar files

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bcf23fd7e4ca8b75df30109fbe616b02?d=identicon&s=25 James Norton (Guest)
on 2009-02-25 18:06
(Received via mailing list)
I am running warbler 0.9.12 with Rails 2.2.2 and I have added jar files
to
lib/java.  Uncommenting the following line in config/warble.rb causes
these
jar files to appear twice in the war file, under WEB-INF/lib and under
WEB-INF/lib/java:

config.java_libs += FileList["lib/java/*.jar"]

I have not modified warble.rb in any other way.  Is this a bug or am I
doing
something wrong?

-James
526d60de6472502bb570a9df2842b33b?d=identicon&s=25 Nick Sieger (Guest)
on 2009-02-25 18:34
(Received via mailing list)
On Wed, Feb 25, 2009 at 9:05 AM, James Norton <jamesnorton@gmail.com>
wrote:
> I am running warbler 0.9.12 with Rails 2.2.2 and I have added jar files to
> lib/java.  Uncommenting the following line in config/warble.rb causes these
> jar files to appear twice in the war file, under WEB-INF/lib and under
> WEB-INF/lib/java:
>
> config.java_libs += FileList["lib/java/*.jar"]
>
> I have not modified warble.rb in any other way.  Is this a bug or am I doing
> something wrong?

It's sort-of-not-really-a-bug. Warbler copies everything in lib/ to
WEB-INF/lib by default. You're also telling it to copy lib/java to
WEB-INF/lib but you're not telling it to exclude lib/java from the
default copying task. You can:

1. Add an exclusion pattern:

  config.excludes = FileList["lib/java/*.jar"]

2. Just store your jar files in lib/*.jar and they will show up in the
right place by default.

Cheers,
/Nick

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

    http://xircles.codehaus.org/manage_email
Bcf23fd7e4ca8b75df30109fbe616b02?d=identicon&s=25 James Norton (Guest)
on 2009-02-25 19:10
(Received via mailing list)
Thanks for the explanation.

-James
5a579b3ae2e98ebcc09403f38a390216?d=identicon&s=25 unknown (Guest)
on 2009-02-27 20:20
(Received via mailing list)
> default copying task. You can:
>
> 1. Add an exclusion pattern:
>
>   config.excludes = FileList["lib/java/*.jar"]
>
> 2. Just store your jar files in lib/*.jar and they will show up in the
> right place by default.

Out of curiosity, why do jars need to be in WEB-INF/lib, and not
WEB-INF/lib/blah/blah/blah? This is probably a J2EE 101 question, but on
a
project we did a couple years ago, we had lib/jars for jars we used in
dev
and prod, and lib/jars/waronly for jars that we wanted to have available
in production, too (goldspike and jruby-complete were both in
lib/jars/waronly). We had no special include or exclude for these, so
they
just ended up in the same place in the war (i.e. WEB-INF/lib/jars/...).
Did we just get lucky? Or are servlet containers supposed to look
through
WEB-INF/lib recursively for jars to put on the classpath?

--
Matt


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

    http://xircles.codehaus.org/manage_email
526d60de6472502bb570a9df2842b33b?d=identicon&s=25 Nick Sieger (Guest)
on 2009-02-28 04:46
(Received via mailing list)
On Fri, Feb 27, 2009 at 1:17 PM,  <maburke@sep.com> wrote:
> WEB-INF/lib/blah/blah/blah? This is probably a J2EE 101 question, but on a
> project we did a couple years ago, we had lib/jars for jars we used in dev
> and prod, and lib/jars/waronly for jars that we wanted to have available
> in production, too (goldspike and jruby-complete were both in
> lib/jars/waronly). We had no special include or exclude for these, so they
> just ended up in the same place in the war (i.e. WEB-INF/lib/jars/...).
> Did we just get lucky? Or are servlet containers supposed to look through
> WEB-INF/lib recursively for jars to put on the classpath?

Maybe some servers/containers look recursively, but it has been my
experience that jars alwasy go only in WEB-INF/lib. YMMV...

/Nick

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

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.