Possible wrong loading of Tomcat 8 PostResources

Description

I had fix an issue with Tomcat 8 Resources Loading in CARGO-1361.
But after using cargo 1.4.18 with other projects I saw that it will possible to have some loading bug with 2 major cases :

  1. Classes defined before libs, are not loading before libs

    A class with same name is present in target/classes et in the jar. After Tomcat 8 started I saw that is the jar class who being load first every time.

  2. If directory declared contains many lib (such as maven repository with SNAPSHOT for example), all will be loaded, it's not that we want, it must declared the good file if it's given

    The directory 0.0.2-SNAPSHOT contains 2 jars. I want only one.

After many search in the Tomcat source code, I think the best implementation for JAR, is this:

It's pretty surprising for me, but I have test many possibilities, and it's the only one who work if we want reference the file, and not the folder.

I give a PR to do this

Status

Assignee

Thomas Collignon

Reporter

Thomas Collignon

Components

Fix versions

Affects versions

1.4.18

Priority

Major
Configure