actions / setup-java

Set up your GitHub Actions workflow with a specific version of Java
MIT License
1.49k stars 719 forks source link

Offer AdoptOpenJDK in addition to Zulu #13

Closed ppalaga closed 3 years ago

ppalaga commented 4 years ago

Should be downloadable e.g. from https://adoptopenjdk.net/

giltene commented 4 years ago

@ibauersachs I think that if you check, you'll find that the "lowest common base" set of algorithms across e.g. {Oracle 8u, Red Hat 8u, Zulu 8u, Adopt 8u, Liberica 8u, Dragonwell 8u, IBM J9 8u, OpenJ9 8u, Corretto 8u, Debian 8u, Ubuntu 8u, CentOS 8u, etc. etc.} is not what you think it is. Some distros and updates remove algorithms that are included in the github locations you are searching in, while some add to them, and some do neither. Most of these distros do work hard to align with the upstream such that any bug fix, security update, or actual feature addition found in the actual upstream 8u for a given GA'ed update number is also reflected in their distro's matching update number [this is critical for e.g. knowing that security updates cover known vulnerabilities fixed in an upstream update], but most of them will have some other variances. Much like (but not quite as much like) debian and ubuntu vary as linux distros.

brunoborges commented 4 years ago

This once again proves to me that this Action, if used, should require user to indicate version and vendor.

madhurig commented 3 years ago

:wave: from the Actions team. Thank you for the discussion and feedback on this issue.

giltene commented 3 years ago

👋 from the Actions team. Thank you for the discussion and feedback on this issue.

  • We will be offering OpenJDK in addition to Zulu in the next version of the setup-java action.

While I welcome the multi-distro approach and the "distro" option (as noted earlier in this thread), let's make sure the terminology is correct. What I think you mean by the above is "we will be offering AdoptOpenJDK builds of OpenJDK in addition to the current Zulu builds of OpenJDK."

Since the Zulu builds of OpenJDK are a distribution of OpenJDK (no less so and not more so than the 6 other distros we are discussing as additional options), the original sentence structure doesn't parse. It would be the equivalent of saying "Offer Linux in addition to Ubuntu". The same can be said for the title on this issue, which should probably be renamed to e.g. "Offer AdoptOpenJDK in addition to Zulu". That original misspelling appears to have caused much confusion.

Note the similar issues open for Corretto (https://github.com/actions/setup-java/issues/68), Liberica (https://github.com/actions/setup-java/issues/70), Dragonwell (https://github.com/actions/setup-java/issues/71), SAPMachine (https://github.com/actions/setup-java/issues/72), and the Oracle builds of OpenJDK (https://github.com/actions/setup-java/issues/69). The "distro" option should probably be designed to accommodate them all.

OpenJDK is already pre-installed on the GitHub Actions Virtual Environments - https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md.

Here too I think the meaning is "AdoptOpenJDK builds of OpenJDK are now pre-installed on... ". OpenJDK was already pre-installed there long ago, via the Zulu builds of OpenJDK. This is presumably the addition of another distro to the available mix (or at least I hope that's what it is).

  • We will plan to make it extensible for the community to add additional distributions to the setup-java action
konradpabjan commented 3 years ago

Thanks for the clarification @giltene

"AdoptOpenJDK builds of OpenJDK in addition to the current Zulu builds of OpenJDK." sounds more in line with what we are planning on doing

Expect a PR with an ADR (architecture decision record) soon-ish. The main goals & anti-goals will be listed out. We'll leverage https://github.com/actions/setup-java/pull/67 for sure.

giltene commented 3 years ago

@konradpabjan I'd like to request that the title of this issue be renamed to "Offer AdoptOpenJDK in addition to Zulu". Can someone with the privileges to do so take care of that?

This new/improved name will capture the actual intent and will help remove much of the recurring confusion that the current thread seems to have around the relationship that the various OpenJDK binary distros have to the Oracle-trademarked OpenJDK project.

As noted earlier, the current issue title reads similarly to "Offer Linux in addition to Ubuntu"...

brunoborges commented 3 years ago

That's a great observation @giltene , thanks for sharing it.

konradpabjan commented 3 years ago

I've created a pull request with an ADR (architecture decision record) that outlines a roadmap & plan for the v2 version of setup-java that will support AdoptOpenJDK binaries in addition to Zulu.

Any feedback, ideas or suggestions will be greatly appreciated: https://github.com/actions/setup-java/pull/97

maxim-lobanov commented 3 years ago

Hello everyone! We are on the final line for V2-preview release with support multiple vendors: Adoptium and Zulu for now. We would be appreciate for any review for this PR: https://github.com/actions/setup-java/pull/132

maxim-lobanov commented 3 years ago

Hello! V2-preview is available with support of Adopt OpenJDK. We would be appreciate for any testing before v2 stable release:

- name: setup-java
  uses: actions/setup-java@v2-preview
  with:
    distribution: 'adopt'
    java-version: '11'

README for v2-preview: https://github.com/actions/setup-java/tree/v2-preview

davidkarlsen commented 3 years ago

@maxim-lobanov the action works fine, however we require this fix too: https://github.com/actions/setup-java/pull/82 in order for this action to be useful to us...

maxim-lobanov commented 3 years ago

@davidkarlsen , your proposal makes sense to me and looks like it won't be a breaking change since we default new property to true by default. We are okay to include these changes to v2. I have left a couple of comments in #82 . Could you please rebase your branch based on v2-preview branch and re-target pull-request (I guess you will have a ton of conflicts)? If you don't have a time - we will adapt your PR for v2 in a few days.

davidkarlsen commented 3 years ago

@joschi could you rebase https://github.com/actions/setup-java/pull/82 again - seems like it can be picked up for real this time...

maxim-lobanov commented 3 years ago

@davidkarlsen , @joschi , I have prepared PR from my side because moving changes to V2 can be tricky (hope you don't mind): https://github.com/actions/setup-java/pull/136

davidkarlsen commented 3 years ago

@maxim-lobanov no prob - it's not my PR - I just need the feature :-) Nice to see it moving forward.

joschi commented 3 years ago

@davidkarlsen Go ahead, please. 😃

maxim-lobanov commented 3 years ago

136 was merged.

You can test it right now:

- name: Setup Java
  uses: actions/setup-java@v2-preview
  with:
    distribution: 'adopt'
    java-version: '11'
    server-id: maven
    server-username: MAVEN_USERNAME
    server-password: MAVEN_CENTRAL_TOKEN
    gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
    gpg-passphrase: MAVEN_GPG_PASSPHRASE
    overwrite-settings: false

We are going to release v2 stable by the end of next week but we would be very appreciate for any testing of v2-preview and confirmations that it works as expected with both adopt and zulu distributions

davidkarlsen commented 3 years ago

@maxim-lobanov tested - it works fine!

MarcelCoding commented 3 years ago

Are there any plans to add adopt-hotspot and adopt-openj9, to be able to also select the implementation and not only the vendor?

maxim-lobanov commented 3 years ago

Hello everyone! We have just released setup-java@v2 with support of Adopt. You can start using it via the following code snippet:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
  with:
    distribution: 'adopt'
    java-version: '11'
- run: java -cp java HelloWorldApp

Please find more details in repo readme.

maxim-lobanov commented 3 years ago

@MarcelCoding , no plans for now but I think it is something that we can consider. Feel free to create a feature request

MarcelCoding commented 3 years ago

@MarcelCoding , no plans for now but I think it is something that we can consider. Feel free to create a feature request

I've created one: https://github.com/actions/setup-java/pull/155

dmitry-shibanov commented 3 years ago

Hello everyone. On Monday 5th April we released setup-java@v2 and also resolved some other issues related to setup-java@v1 in v2. Now task supports to setup AdoptOpenJdk in addition to Zulu's distribution. It can be done through required distribution field. For detailed explanation you can see migration guide from v1 to v2 and advanced usage for setup-java@v2. If you face up with strange or unexpected behaviour feel free to create separate issue.

zygisk-topjohnu commented 1 year ago

update