slachiewicz commented on issue #659: URL: https://github.com/apache/maven-wagon/issues/659#issuecomment-5225727860
Still open, but the implementation suggested in the description will not work as written. `javax.activation.MimetypesFileTypeMap` lives in the `java.activation` module, which was removed from the JDK in Java 11. Wagon compiles against a Java 8 baseline, so it would still build, but at runtime under any modern JDK the class is simply absent unless a `jakarta.activation` dependency is added — and adding one to a transport library used by every Maven build is not attractive. `java.nio.file.Files.probeContentType(Path)` has been available since Java 7 and needs no dependency. It is platform-dependent, though: it consults the OS content-type detectors and can return `null`, so a fallback map for the extensions that actually matter here — `.jar`, `.pom`, `.xml`, `.asc`, `.sha1`, `.md5` — would still be needed. Worth deciding what problem this is solving before implementing either. If it is repository managers rejecting or mis-storing uploads because everything arrives as `application/octet-stream`, a small explicit extension map is both sufficient and predictable, and avoids making upload behaviour depend on the OS of the machine running the build. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
