Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extraClasspath() method on WebAppContext dont support dir path #150

Closed
jmcc0nn3ll opened this issue Feb 16, 2016 · 4 comments
Closed

extraClasspath() method on WebAppContext dont support dir path #150

jmcc0nn3ll opened this issue Feb 16, 2016 · 4 comments

Comments

@jmcc0nn3ll
Copy link
Contributor

migrated from Bugzilla #438482
status ASSIGNED severity enhancement in component server for 9.2.x
Reported in version 8.1.12 on platform PC
Assigned to: Jan Bartel

On 2014-06-29 06:33:09 -0400, Nir Barel wrote:

Hi,

I am trying to load extra libs using extraClasspath() from a dir path but jars are not loaded.
if I specify the list of jars one by one it works well.
I checked that in Jetty 8 and Jetty 9
I need it to work for Jetty 8 mostly.

my configuration:

/war
/app/webapps/war.war
/extralibs

org.eclipse.jetty.servlet.Default.dirAllowed
false

On 2014-06-30 20:19:44 -0400, Jan Bartel wrote:

Nir,

If I understand correctly, you are asking for an enhancement to enable setExtraClasspath to recursively add jars to the classpath, yes? I'm updating the bug accordingly.

Jan

On 2014-07-01 00:59:54 -0400, Nir Barel wrote:

Hi,

In the documentation example you already explain that you support directory and not just jar's...

... http://wiki.eclipse.org/Jetty/Reference/Jetty_Classloading#Using_the_extraClasspath.28.29_method

jetty 9:
http://www.eclipse.org/jetty/documentation/current/jetty-classloading.html

So I think it's a bug and not enhancement.

can you fix it also for jetty 8?

On 2014-07-01 05:27:14 -0400, Jan Bartel wrote:

Nir,

I'm still not sure what problem you are reporting. The documentation and the code shows that we support a classpath just like a java classpath. In other words, you can add a series of extra classpath elements, where each element can be a directory of classes, or a jar file. Are you saying that this does not work? Or are you saying that you want to add a directory that contains jar files and have jetty add all the jar files in that directory???

Jan

(In reply to Nir Barel from comment # 2)

Hi,

In the documentation example you already explain that you support directory
and not just jar's...

... http://wiki.eclipse.org/Jetty/Reference/
Jetty_Classloading#Using_the_extraClasspath.28.29_method

jetty 9:
http://www.eclipse.org/jetty/documentation/current/jetty-classloading.html

So I think it's a bug and not enhancement.

can you fix it also for jetty 8?

On 2014-07-01 05:34:04 -0400, Nir Barel wrote:

Hi,

OK now I understand what ../my/classes means..
Yes I want to add folder with jars and let Jetty to load them all.
a "nice to have" feature can be arguments with exclude / include lists for this folder.

actually because jetty doesn't support it I add my own function that generate that list and I invoke a java method from the XML configuration.

can enhancement be delivered also to Jetty 8?

@chinhodado
Copy link

chinhodado commented Apr 21, 2017

I am running into this same issue. Is this fixed yet or is there a workaround, instead of having to specify each jar file manually?

@janbartel
Copy link
Contributor

@chinhodado we would be very happy to accept a pull request that implements this enhancement.

@i2shar
Copy link
Contributor

i2shar commented Dec 29, 2018

@janbartel: I recently encountered this issue as well. Saw your comment -- please review my pull request!

janbartel pushed a commit that referenced this issue Feb 6, 2019
* Issue #150: Ability to handle JAR directories in extraClasspath. In keeping with Java conventions[0], any directory paths ending in /* should be considered a JAR directory and all jars in that directory will be added (non recursively) to the classpath.

[0] https://docs.oracle.com/javase/8/docs/technotes/tools/windows/classpath.html

Signed-off-by: Tushar Inamdar <[email protected]>
@janbartel
Copy link
Contributor

This feature was added to jetty-9.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants