[Bug 1930541] Re: [SRU] Maven 3.6.3-1 fails to run with OpenJDK 17
Vladimir Petko
1930541 at bugs.launchpad.net
Thu Nov 9 13:26:47 UTC 2023
** Summary changed:
- Maven 3.6.3-1 fails to run with OpenJDK 17
+ [SRU] Maven 3.6.3-1 fails to run with OpenJDK 17
--
You received this bug notification because you are a member of Ubuntu
Sponsors, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1930541
Title:
[SRU] Maven 3.6.3-1 fails to run with OpenJDK 17
Status in guice package in Ubuntu:
Confirmed
Status in maven package in Ubuntu:
Confirmed
Status in guice source package in Focal:
New
Status in maven source package in Focal:
New
Status in maven package in Debian:
Fix Released
Bug description:
[Impact]
Maven 3.6.3-1 fails to run with OpenJDK 16 and 17.
Users building for OpenJDK 17 are unable to use the packaged Maven.
This bug was fixed in Maven 3.6.3-2 (and above)[1]
Packages maven and guice need to be updated in focal to fix this bug.
[Test Plan]
For the version in the release pocket and the version in the proposed pocket, use maven to compile https://github.com/socialsoftware/quizzes-tutor:
$ sudo apt install openjdk-17-jdk maven=$VERSION
$ git clone https://github.com/socialsoftware/quizzes-tutor.git
$ cd quizzes-tutor
$ cd backend
$ mvn clean compile
This should fail for the version in the release pocket, with the error below, and succeed for the version in the proposed pocket.
Sample test script:
```
#!/bin/bash
set -ex
lxc launch ubuntu:focal tester
lxc exec tester -- apt install -y software-properties-common
lxc exec tester -- add-apt-repository -y ppa:vpa1977/maven-sru-2
lxc exec tester -- apt install -y maven openjdk-17-jdk-headless
lxc exec tester -- git clone https://github.com/socialsoftware/quizzes-tutor.git
lxc exec tester -- /bin/sh -c "cd quizzes-tutor/backend && mvn clean compile"
lxc delete -f tester
```
[Where problems could occur]
Guice:
- this SRU installs a new artifact - guice-no-aop-4.2.1.jar. There is no other impact for this package.
Maven:
- guice.jar is replaced with guice-no-aop.jar. This is optional[2] functionality and Apache's release of maven 3.6.3 includes `guice-4.2.1-no_aop.jar`[3]
- Maven should be tested against Java versions present in focal, e.g. test building a sample project:
```
#!/bin/bash
set -ex
for x in openjdk-11-jdk-headless openjdk-13-jdk-headless openjdk-16-jdk-headless openjdk-17-jdk-headless openjdk-8-jdk-headless; do
lxc launch ubuntu:focal tester
lxc exec tester -- apt install -y software-properties-common
lxc exec tester -- add-apt-repository -y ppa:vpa1977/maven-sru-2
lxc exec tester -- apt install -y maven $x
lxc exec tester -- git clone https://github.com/mkyong/maven-examples
for module in java-multi-modules java-project maven-code-coverage maven-mutation-testing maven-profiles maven-static-code-analysis maven-unit-test; do
lxc exec tester -- /bin/sh -c "cd maven-examples/$module && mvn clean compile"
done
lxc delete -f tester
done
```
[Original Description]
*System info*:
```
$ lsb_release -rd
Description: Ubuntu 20.04.2 LTS
Release: 20.04
$ apt-cache policy maven
maven:
Installed: 3.6.3-1
Candidate: 3.6.3-1
Version table:
*** 3.6.3-1 500
500 http://ch.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
500 http://ch.archive.ubuntu.com/ubuntu focal/universe i386 Packages
100 /var/lib/dpkg/status
$ apt-cache policy openjdk-16-jdk
openjdk-16-jdk:
Installed: 16.0.1+9-1~20.04
Candidate: 16.0.1+9-1~20.04
Version table:
*** 16.0.1+9-1~20.04 500
500 http://ch.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
500 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages
500 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu focal/main amd64 Packages
100 /var/lib/dpkg/status
```
*Summary*
Maven 3.6.3-1 apparently fails to run with OpenJDK 16. It seems to be a bug and was fixed in Maven 3.6.3-2 (and above) according to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=980467.
*Expected behaviour*
I expect to be able to use maven with all currently supported General Availability Java versions.
*Observed behaviour*
I installed OpenJDK 16 (via PPA, see version above) and tried to compile a Maven project, producing the following output:
```
$ mvn compile
[ERROR] Error executing Maven.
[ERROR] java.lang.IllegalStateException: Unable to load cache item
[ERROR] Caused by: Unable to load cache item
[ERROR] Caused by: Could not initialize class com.google.inject.internal.cglib.core.$MethodWrapper
$ echo $?
1
```
Thanks and kind regards,
-Manu
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=980467
[2] https://github.com/google/guice/wiki/OptionalAOP
[3] https://github.com/apache/maven/releases/tag/maven-3.6.3
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/guice/+bug/1930541/+subscriptions
More information about the Ubuntu-sponsors
mailing list