GedMarc commented on pull request #26: URL: https://github.com/apache/commons-fileupload/pull/26#issuecomment-623378285
@rmannibucau that is some good thinking - there are a lot of the libraries that I could shade in cleanly (ref http://www.guicedee.com), but a couple of them I had no choice but to clone and modify - Fileupload was one of those I could shade in cleanly if you looked at the fork. Let me put some of my thought process, maybe can clean and fix it up a bit. The goal post was for POI-OOXML and CXF, which was eventually successful, unfortunately xmlbeans and the enormous resource path structure causes JLink and JMod to fail with the classic ASM "method too large exception". So only xml-beans was a real problem. I had to painstakingly start from zero and only include the resources required. I found a reference to a "xmlbeans-lite" but no actual jar or anything.  A pure moditect inclusion of the module-info file into META-INF/versions/9 was enough up till that point @jochenw I hope that is a small enough change :)  After delivering all of these as modules, I was asked to visit the rest of the commons libraries. Again I didn't do Math4. So.. In my adventures of creating the first JLink/JImage/JPackage full system suite, I ended up finishing the following using the exact same formula across the board, and is where all my comments stem from, why I've had to research so deeply into the implementations, and why I am (rather) against a JDK8 only path. - Jackson JSON to fully support modules using the above methodology. https://github.com/FasterXML/jackson-jdk11-compat-test - MSSQL server driver - Hibernate JRT support - Over 150 libraries to modular ``` <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <configuration> </configuration> <executions> <execution> <id>shade</id> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <artifactSet> <includes> <include>commons-fileupload:commons-fileupload:*</include> <include>portlet-api:portlet-api:*</include> </includes> </artifactSet> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.moditect</groupId> <artifactId>moditect-maven-plugin</artifactId> <executions> <execution> <id>add-module-infos</id> <phase>package</phase> <goals> <goal>add-module-info</goal> </goals> <configuration> <overwriteExistingFiles>true</overwriteExistingFiles> <module> <moduleInfoFile> src/moditect/module-info.java </moduleInfoFile> </module> </configuration> </execution> </executions> </plugin> ``` Module-Info file ``` exports org.apache.commons.fileupload; exports org.apache.commons.fileupload.disk; exports org.apache.commons.fileupload.servlet; requires static javax.servlet.api; requires transitive org.apache.commons.io; ``` So file upload - easy, straight up just push and insert. Codec. not so much. Had to modify files - JDK 12 I think it was where it broke. was a while ago. jakarta-el uses yield() so doesn't even compile in JDK14 The guys at RESTEasy even went so far as to say (with their split of SPI's into their own JAR, which is an illegal action in modular development) that they won't support it. I'm hoping you guys don't go down that same path :) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
