This is follow up issue for https://issues.redhat.com/browse/WFLY-1160.
During development there were discussed few ways of improving user experience of global directory that weren't implemented as part of the original feature:
1. If some class from global directory throws an exception, it would be helpful is user was informed which jar contains this class.
2. If global directory contains corrupted jar file (e.g. text file which was renamed to .jar), deployment won't be successfully deployed. Server logs contains information that zip file could not be opened. Cli only prints out that deployment is missing dependencies - which isn't necessarily true.
It's possible that deployment isn't missing any dependencies - in this case, it would be better just to display a warning that there is a corrupted jar in global directory.
3. It would be good if users could specify dependencies for their libraries, something like this:
4. If jar contains class that has same name and package as some java ee class, for example custom javax.ws.rs.client.Client, it can cause error during execution:
It would be better if user was informed about duplicity during deployment.
5. If global directory has following hierarchy:
and class B uses A's feature that is only available in a.2.jar version of A.class then
it fails during execution when class B tries to access this feature of class A (because class A is loaded from a.1.jar and A in a.2.jar is ignored).
As before, it would be better if user was informed about presence of duplicate class A in global directory during deployment.