Bug 2164437

Summary: maven:3.6 should not pull in more than one Java version
Product: Red Hat Enterprise Linux 9 Reporter: Marián Konček <mkoncek>
Component: mavenAssignee: Mikolaj Izdebski <mizdebsk>
Status: CLOSED ERRATA QA Contact: Martin Kyral <mkyral>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.1CC: mizdebsk, mkyral, redhat
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: javapackages-tools-6.0.0-4.el9 apache-commons-cli-1.4-17.el9 apache-commons-codec-1.15-7.el9 apache-commons-io-2.8.0-8.el9 apache-commons-lang3-3.12.0-6.el9 atinject-1.0.3-6.el9 cdi-api-2.0.2-6.el9 google-guice-4.2.3-9.el9 guava-30.1-6.el9 httpcomponents-client-4.5.13-3.el9 httpcomponents-core-4.4.13-7.el9 jakarta-annotations-1.3.5-13.el9 jansi-2.3.3-6.el9 jsr-305-3.0.2-6.el9 maven-resolver-1.6.1-10.el9 maven-shared-utils-3.3.4-3.el9 maven-wagon-3.4.2-7.el9 plexus-cipher-1.7-27.el9 plexus-classworlds-2.6.0-11.el9 plexus-containers-2.1.0-10.el9 plexus-interpolation-1.26-11.el9 plexus-sec-dispatcher-1.4-37.el9 plexus-utils-3.3.0-10.el9 sisu-0.3.4-10.el9 slf4j-1.7.30-13.el9 jsoup-1.13.1-10.el9 maven-3.6.3-15.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 07:53:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marián Konček 2023-01-25 14:47:09 UTC
This bug was initially created as a copy of Bug #2162308

I am copying this bug because: 
It was found that this bug also affects RHEL 9


+++ This bug was initially created as a clone of Bug #1991521 +++

Description of problem:

The point of the maven-openjdk17 metapackage is to permit Maven to be installed and have its dependencies satisfied by OpenJDK 17. See the cloned bug for initial work on that.

The maven-libs package depends on java-headless | java-11-headless. Neither are provided by OpenJDK 17 (see 2080229 for discussion on that), and so maven-libs forces the installation of OpenJDK 8 or 11.

A fix would be to adjust the maven-libs dependency to be

  dependency: (java-headless or java-11-headless or java-17-headless)

Version-Release number of selected component (if applicable):

1:3.6.2-7.module+el8.6.0+13337+afcb49ec.noarch

How reproducible:

Always

Steps to Reproduce:
1. microdnf install maven-openjdk17
2. rpm -qa java-*

Actual results:

java-11-openjdk-...
java-11-openjdk-headless-...
java-17-openjdk-...
java-17-openjdk-headless-...

Expected results:

java-17-openjdk-...
java-17-openjdk-headless-...

Additional info:

It'd be great to finally be able to install maven with any of the redhat-provided OpenJDK versions without pulling in a spare JDK as well. This is a major pain for the containers.

Comment 3 Mikolaj Izdebski 2023-01-30 18:59:27 UTC
Now that requires generator in javapackages-tools has been updated,
all packages maven depends on must be rebuilt to have auto-requires regenerated.

More merge requests opened:
https://gitlab.com/redhat/centos-stream/rpms/apache-commons-cli/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/apache-commons-codec/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/apache-commons-io/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/apache-commons-lang3/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/atinject/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/cdi-api/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/google-guice/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/guava/-/merge_requests/10
https://gitlab.com/redhat/centos-stream/rpms/httpcomponents-client/-/merge_requests/10
https://gitlab.com/redhat/centos-stream/rpms/httpcomponents-core/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/jakarta-annotations/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/jansi/-/merge_requests/14
https://gitlab.com/redhat/centos-stream/rpms/jsr-305/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/maven/-/merge_requests/16
https://gitlab.com/redhat/centos-stream/rpms/maven-resolver/-/merge_requests/11
https://gitlab.com/redhat/centos-stream/rpms/maven-shared-utils/-/merge_requests/10
https://gitlab.com/redhat/centos-stream/rpms/maven-wagon/-/merge_requests/10
https://gitlab.com/redhat/centos-stream/rpms/plexus-cipher/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/plexus-classworlds/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/plexus-containers/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/plexus-interpolation/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/plexus-sec-dispatcher/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/plexus-utils/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/sisu/-/merge_requests/9
https://gitlab.com/redhat/centos-stream/rpms/slf4j/-/merge_requests/9

Comment 4 Mikolaj Izdebski 2023-01-30 19:13:30 UTC
All the above merge requests have been merged.

Comment 7 Mikolaj Izdebski 2023-01-31 08:09:02 UTC
*** Bug 2101289 has been marked as a duplicate of this bug. ***

Comment 8 Mikolaj Izdebski 2023-02-02 07:52:09 UTC
Note regarding verification and test coverage:
This bug is covered by /Sanity/openjdk-packages test that checks
whether only a single expected version of OpenJDK is installed.
https://src.fedoraproject.org/tests/maven/blob/main/f/Sanity/openjdk-packages

Comment 10 Marián Konček 2023-02-02 16:05:01 UTC
Pre-verification:
MR is a valid change to fix the issue.
Tests (/Sanity/openjdk-packages) were added and check for absence of java packages of different versions.
Tests passed.

Comment 15 errata-xmlrpc 2023-05-09 07:53:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (maven bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2402