Open jstaerk opened 1 month ago
workaround/fix? apparently as described in #297 adding the classifier in the POM
<dependency>
<groupId>org.mustangproject</groupId>
<artifactId>validator</artifactId>
<version>2.12.0</version>
<classifier>shaded</classifier>
</dependency>
Had similar NoClassDefFoundError and specifying the shaded variant solved this issue for me, too.
In a build.gradle.kts file it would look like this:
implementation("org.mustangproject:library:2.12.0:shaded")
For me it looks like the POM of the non-shaded version is broken in 2.12.0.
When adding the non-shaded library to a project, all dependencies are missing (pdfbox, jdom etc). Looking at the POM uploaded at maven central shows, that there is not a single non-test dependency declared in the library-pom nor in the parent.
This is really weird and forces the user to define all additional dependencies manually (without knowing which are missing or which versions should be used). I fixed it in my project by taking the missing dependencies from the POM found in this repo, but I think the POM should contain the required dependencies in the next release.
It doesnt seem to be broken, it just no longer contains transitive dependencies. Not only do I currently have no idea how to change that, I also don't know why this does not seem to have been the case since the fix for #297 was a long time way ago :-( We need both versions. I would prefer having the shaded one being the default, however.
Using a (fat) shaded-jar as default is not very common and seems confusing to me.
It will cause issues when you have a JPMS compliant project. It will also be an issue if you have a bigger project (or a JEE project) where you have a lot of dependencies already in your classpath. As soon as mustang will be added, it may provide classes which are not from mustang but from mustang's dependencies conflicting with the dependencies already defined in the project (e.g. slf4j, XML libraries, PDFBox, Apache-Batik (which is also used when POI is part of the project) etc).
Therefore I would advice to keep the shaded jar as it is now: found with another classifier.
I only had a quick look at the pom's of the project. They definitely need some love and improvements. I see lots of duplicated lines (which are already defined in parent and will be inherited), plugins and the used versions and configuration can be put in PluginManagement section and only needs to be referenced in the appropriate module later on.
Maybe I find some spare time this weekend, then I would take a closer look and provide a PR for POM cleaning.
A bit earlier than I thought, but I opened a PR (#446) to cleanup the POMs.
Great! Thanks @hypfvieh for providing the pull request.
I also stumbled about the missing dependencies in maven central.
Who can review and merge this PR?
Thanks, bye Peter
Just looked at latest release 2.13.0 in Maven Central, still all non-test dependencies missing in library
artifact pom :-(
Mustang deployed via maven throws exceptions like
the jar file of the validator is only 3.5 instead of 53.5mb in size and reminds very much of the uber jar discussion #297