Description
Multiple JARs containing one or more *.class in the same package org/apache/wicket/serialize/IClusterable.class should not be in Maven binary wicket-util
The Maven wicket-util JAR has one or more *.class files in the same package as another JAR.
wicket-core has org/apache/wicket/Application.class (1 file listed of 79)
wicket-util has org/apache/wicket/IClusterable.class (1 file listed of 1)
This is not allowed by standard Java ClassLoading rules. The ClassLoader has the right to stop searching to remainder of the CLASSPATH once it finds the first CLASSPATH entry to contain one or more file resources inside a package. That CLASSPATH entry can then be considered authoritative for that package.
The specification allows for a ClassLoader implemented to perform an exhaustive search of all CLASSPATH entries (if it wants) but it is not a requirement. So in this way you need to specialized ClassLoader in order to see 1 package split across multiple JARs.
It is better for all Java projects to produce redistributes / binary releases that are are compatible as possible with the Java ecosystem.
This issue is also a violation of OSGi packaging principals. If you happen to care about OSGi.
Possible Solution:
1) Ensure the org/apache/wicket/IClusterable.class file is put into the wicket-core Maven module.
2) Change the package that IClusterable belongs, maybe org/apache/wicket/serialize/IClusterable.class would be a good choice. But I'd guess this breaks backwards compatibility.
It maybe worth investigating why org/apache/wicket/serialize/ISerializer.class is also in wicket-util as I think this also would be better moved into wicket-core. However this is not causing any harm that I can see as no other JAR I have checked contains one or more file resources in the package org/apache/wicket/serialize. There is a package called org/apache/wicket/serialize/java in wicket-core but that does not count for the purpose of this rule.
Attachments
Issue Links
- duplicates
-
WICKET-4438 Make Wicket more OSGi friendly
-
- Resolved
-