Warble duplicate jar files


#1

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


#2

On Wed, Feb 25, 2009 at 9:05 AM, James N. removed_email_address@domain.invalid
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”]

  1. 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

#3

Thanks for the explanation.

-James


#4

default copying task. You can:

  1. Add an exclusion pattern:

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

  1. 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

#5

On Fri, Feb 27, 2009 at 1:17 PM, removed_email_address@domain.invalid 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