Skip to content
New issue

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

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

Already on GitHub? # to your account

Log the version of JDK installed #92

Closed
asarkar opened this issue Aug 14, 2020 · 6 comments
Closed

Log the version of JDK installed #92

asarkar opened this issue Aug 14, 2020 · 6 comments
Labels
feature request New feature or request to improve the current logic v2 setup-java

Comments

@asarkar
Copy link

asarkar commented Aug 14, 2020

The output from the action doesn't mention the version of JDK installed, which would be very useful to see.

Set up JDK
writing /home/runner/.m2/settings.xml
Run actions/setup-java@v1
/bin/tar --version
tar (GNU tar) 1.29
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
/bin/tar xz --warning=no-unknown-keyword -C /home/runner/work/_temp/temp_540774269 -f /home/runner/work/_temp/a981e5ab-5d0c-4c33-99f2-53d62a23bdf4
creating settings.xml with server-id: github; environment variables: username=$GITHUB_ACTOR, password=$GITHUB_TOKEN, and gpg-passphrase=null
writing /home/runner/.m2/settings.xml
@giltene
Copy link
Contributor

giltene commented Aug 14, 2020

I too think that reporting (and verifying) the version installed would be generally useful. The simplest way to do this is to execute java -version. One can obviously do that as a step in the job itself, but it would probably be useful (and cheap enough) to do this implicitly in the action as a good logging practice, as the version information is often needs for diagnostic reasons (and the need is usually noticed after the fact, rather than as a planned thing).

@asarkar
Copy link
Author

asarkar commented Jan 31, 2021

Is it possible to implement this seemingly easy ticket instead of waiting for the Big Bang #98 that could take months or even years?

@dmitry-shibanov
Copy link
Contributor

Hello everyone. Setup-java@v2 was released and it logs version of setup java. Please see migration guide from v1 to v2. If you have any concerns feel free to reopen the issue.

@asarkar
Copy link
Author

asarkar commented Apr 7, 2021

@dmitry-shibanov I migrated to v2 and it looks good. Thank you. Couple of comments:

  1. Not a big deal, but having a default distribution would be nice.
  2. v2 seems to be more verbose, especially the downloading JDK part. Not sure if I want to see the action setting up Java in my build logs. May be hide it unless verbose: true is set?

v1

Run actions/setup-java@v1
/usr/bin/tar --version
tar (GNU tar) 1.30
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
/usr/bin/tar xz --warning=no-unknown-keyword -C /home/runner/work/_temp/temp_1161855869 -f /home/runner/work/_temp/abd98200-ef11-4248-8e23-b2b76bf9846e
creating settings.xml with server-id: github; environment variables: username=$GITHUB_ACTOR, *** and gpg-passphrase=null
writing /home/runner/.m2/settings.xml

v2:

Run actions/setup-java@v2
Trying to resolve the latest version from remote
Resolved latest version as 8.0.282+8
Trying to download...
Downloading Java 8.0.282+8 (Zulu) from https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-linux_x64.tar.gz ...
Extracting Java archive...
/usr/bin/tar xz --warning=no-unknown-keyword -C /home/runner/work/_temp/89eaf85a-fb1a-4dd2-822e-925174a055b4 -f /home/runner/work/_temp/648b7ad7-d4ed-4f1e-b303-11adf58a3fae
Java 8.0.282+8 was downloaded
Setting Java 8.0.282+8 as the default

Java configuration:
  Distribution: zulu
  Version: 8.0.282+8
  Path: /opt/hostedtoolcache/Java_Zulu_jdk/8.0.282-8/x64

Creating settings.xml with server-id: github
Writing to /home/runner/.m2/settings.xml

@dmitry-shibanov
Copy link
Contributor

Hello @asarkar. Thank you for your response and feedback.

  1. We're not planning to make distribution field default one based on ADR.
  2. Yes, sure. Setup-java@v2 is more verbose. But I'm not sure, that we should hide this logs. If you have any concerns about it, you can create separate issue to discuss it deeper.

@asarkar
Copy link
Author

asarkar commented Apr 7, 2021

Opened #157 for verbosity.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature request New feature or request to improve the current logic v2 setup-java
Projects
None yet
Development

No branches or pull requests

4 participants