Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a multi-release jar? #238

Closed
laeubi opened this issue Aug 9, 2022 · 14 comments
Closed

Provide a multi-release jar? #238

laeubi opened this issue Aug 9, 2022 · 14 comments

Comments

@laeubi
Copy link

laeubi commented Aug 9, 2022

Is your feature request related to a problem? Please describe.
Currently there are two jar build, one for java 8 and one for java 11

Describe the solution you'd like
JEP 238 defines a way to build a single jar that can contain code for java 8 and any version 9+ in the same jar.

Additional context
Having only one dependency will likely simplify build (only one pom) and usage (java 11 code is automatically used when running on a suitable vm).

@filip26
Copy link
Owner

filip26 commented Aug 9, 2022

Hi @laeubi, thank you for sharing JEP 238. I've been looking for something like that for a long time.

@laeubi
Copy link
Author

laeubi commented Aug 9, 2022

The maven setup is a bit cumbersome, but if you like you can find an example here: https://github.com/ClickHouse/clickhouse-jdbc/blob/f285b73d45597e29cf36dff4daf4cb4f9f53453a/pom.xml#L498-L532

@filip26
Copy link
Owner

filip26 commented Aug 9, 2022

thanks, that looks promising, I see it uses jdkToolchain. I wonder how to build it using Github Actions.

@filip26
Copy link
Owner

filip26 commented Aug 9, 2022

#166

@laeubi
Copy link
Author

laeubi commented Aug 9, 2022

I wonder how to build it using Github Actions.

You can vote for actions/setup-java#276

You can add a static one e.g. like this
https://github.com/eclipse-platform/eclipse.platform/blob/master/.github/toolchains.xml

and pass it to the maven build:
https://github.com/eclipse-platform/eclipse.platform/blob/4d2af8c7770d66a025f349513b5fe9f379a2630b/.github/workflows/build.yml#L31

but I have also seen generate it on the fly...

@filip26 filip26 added this to the 1.3.2 milestone Aug 12, 2022
@laeubi
Copy link
Author

laeubi commented Aug 15, 2022

@filip26 is there any schedule for this already? Once this is done I'd like to propose a patch on this to add OSGi meta-infos, so would be nice to hear if it makes sense to wait for this or better do the work twice in the old infrastructure.

@filip26
Copy link
Owner

filip26 commented Aug 15, 2022

Hi @laeubi ,
I'm sorry, but I cannot set a date. Titanium is an open-source project and no one gets paid to work on it., It could be a week or a few months.

@laeubi
Copy link
Author

laeubi commented Aug 15, 2022

Alright, let me know if I can help with anything.

@filip26
Copy link
Owner

filip26 commented Aug 15, 2022

Well, I'm happy to accept any PR that is in benefit of the library users ;)

@filip26
Copy link
Owner

filip26 commented Nov 21, 2022

add a resource Multi-release JARs - Good or bad idea?

@laeubi
Copy link
Author

laeubi commented Nov 22, 2022

Well that is more than five years ago now and I see MJARS in the wild (e.g. gson)... beside that its not the responsibility of a library to overcome possibly limitations of tools (gradle?), but for sure it is your choice in the end :-)

@filip26
Copy link
Owner

filip26 commented Nov 22, 2022

thank you for the reaction. The only motivation to provide JRE8 build is Android development for which Gradle is preferred over Maven. Do you have an experience with MJARS on Android?

@laeubi
Copy link
Author

laeubi commented Nov 22, 2022

No, but as MJARs (from Java/Android POV) are just jars with a few extra bytes I won't expect anything worse here and any Java ) compliant JVM should support MJARs at the runtime.

@filip26 filip26 removed this from the 1.3.2 milestone Mar 16, 2023
@filip26
Copy link
Owner

filip26 commented Dec 1, 2023

closed due inactivity, feel free to re-open with new information.

@filip26 filip26 closed this as completed Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants