feign icon indicating copy to clipboard operation
feign copied to clipboard

Add module descriptor

Open C-Otto opened this issue 3 years ago • 2 comments

OpenFeign 10.10.1 does not seem to include a valid JPMS module descriptor:

$ jar --file=~/.gradle/caches/modules-2/files-2.1/io.github.openfeign/feign-core/10.10.1/d09c5d478b1cd83e95035539687b9ff4905dc99c/feign-core-10.10.1.jar --describe-module
No module descriptor found. Derived automatic module.

[email protected] automatic
requires java.base mandated
contains feign
contains feign.auth
contains feign.codec
contains feign.optionals
contains feign.querymap
contains feign.stream
contains feign.template

Please add this so that OpenFeign can be used in Java 9+ projects that make use of modules.

C-Otto avatar Jan 24 '21 13:01 C-Otto

Open Feign can be used with Java 9+ projects, so your request is misleading, as these newer JDKs will derive an automatic module, as you've seen. We do not include module descriptors as our target platform is still Java 8. We will consider adding module descriptors when we update our baseline for the latest Java 11 LTS

kdavisk6 avatar Feb 03 '21 04:02 kdavisk6

Maven supports building older libraries with java 8 while still shipping a java 9+ module-info https://maven.apache.org/plugins/maven-compiler-plugin/examples/module-info.html

Sineaggi avatar Mar 15 '21 16:03 Sineaggi

Alternatively the ModiTect tools may be used to add a full module descriptor while still remaining Java8 compatible

Jetty did it this way before moving their baseline to Java 11.

aalmiray avatar Feb 03 '23 15:02 aalmiray

If you willing to send a pull request, I can review, approve, merge and cut a release with this

velo avatar Feb 04 '23 02:02 velo

Great! Just did a quick check for split packages on all projects defined by the feign-bom artifact (using https://github.com/AdoptOpenJDK/jsplitpkgscan) and I'm happy to report there are no split packages 🎉! This makes the next step much simpler.

aalmiray avatar Feb 04 '23 10:02 aalmiray

Blocked by https://github.com/Netflix/ribbon/issues/387

aalmiray avatar Feb 04 '23 13:02 aalmiray

The soap module declares a service /META-INF/services/javax.xml.soap.SAAJMetaFactory with com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl as value. AFAICT full module descriptors are not allowed to expose services found in unexported packages. Generated module feign.soap won't export package com.sun.xml.messaging.saaj.soap thus causing a failure.

Is this service really required? If so, could it be exported by the owning module?

aalmiray avatar Feb 04 '23 13:02 aalmiray

Netflix ribbon is in maintenance mode and has not posted a release since Aug 5 2001. Making ribbon modular requires resolving split packages which would result in binary compatibility breakage (prompting a major version bump). That's a lot of effort and there's no guarantee the change will be accepted nor released.

Instead I'd recommend not modularizing feign-ribbon at this time.

aalmiray avatar Feb 06 '23 11:02 aalmiray

Hmm why was this marked as completed? I'm waiting on feedback from Feign team members to see if the proposed changes are adequate. Then I can send a PR.

aalmiray avatar Feb 18 '23 10:02 aalmiray

I just closed the issue, I don't know why GitHub thinks this is related to some kind of completion. In my understanding it's not worth it modularizing feign-ribbon and, by extension, feign. It seems you still have hopes of doing this, though? I'm not using feign anymore, so I don't really care, but I'll leave this issue open if you prefer.

C-Otto avatar Feb 18 '23 10:02 C-Otto

Is this service really required? If so, could it be exported by the owning module?

I would say to modularize what is possible and ignore everything else like soap module.

If you can get a PR over the line shortly I can include on the upcoming releases

velo avatar Feb 18 '23 23:02 velo