Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1883751

Summary: F33 maven is failing at basic tasks like openliberty: liberty:dev java.lang.ExceptionInInitializerError in plugins
Product: [Fedora] Fedora Reporter: space88man <shihping.chan>
Component: mavenAssignee: Christopher Tubbs <ctubbsii>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 33CC: ctubbsii, decathorpe, java-maint-sig, java-sig-commits, mizdebsk, msrb, sochotni
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: maven-3.6.3-5.fc33 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-25 01:01:13 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 space88man 2020-09-30 07:00:17 UTC
Description of problem:
Using F33 maven is failing in
openliberty guide-getting-started liberty:dev goal


Version-Release number of selected component (if applicable):
maven-3.6.3-4.fc33.noarch
java-11-openjdk-11.0.9.6-0.0.ea.fc33.x86_64

How reproducible:
Always

Steps to Reproduce:
1. git clone https://github.com/openliberty/guide-getting-started.git 
2. mvn -X liberty:dev
3.

Actual results:
An API incompatibility was encountered while executing io.openliberty.tools:liberty-maven-plugin:3.2:dev: java.lang.ExceptionInInitializerError: null
Failed to execute goal io.openliberty.tools:liberty-maven-plugin:3.2:dev (default-cli) on project guide-getting-started: Could not get the highest version from the range: [19.0.0.6,): Unable to resolve version range fram io.openliberty:openliberty-kernel:zip:[19.0.0.6,) -> [Help 1]



Expected results:
Executing phases/goals succeeds


Additional info:
1. Using upstream apache-maven-3.6.3 works.
2. If you use upstream maven to run the goal (liberty:dev) once, which sets up the in-tree application server, and then use F33's maven to rerun the goal it works
3. I have observed this in other projects like wildfly, i.e., use F33 mvn until  hitting some java/maven-plugin Exception, switch to upstream mvn to cross this hurdle, then switch back to F33 mvn. After a few iterations, F33 mvn will generally the goal succesfully.

Comment 1 space88man 2020-09-30 07:03:44 UTC
To reproduce you need a clean ~/.m2/repository. If that directory and the repo target/ has been prepped by a working maven then F33's mvn will generally succeed.

Comment 2 space88man 2020-09-30 07:05:58 UTC
"Steps to Reproduce:", above, is incomplete. It should be:

1. git clone https://github.com/openliberty/guide-getting-started.git 
2. cd guide-getting-started/finish
3. rm -rf ~/.m2/repository/io/openliberty/
4. mvn -X liberty:dev

Comment 3 Christopher Tubbs 2020-09-30 07:11:29 UTC
Have you tried specifying the exact coordinates of liberty-maven-plugin, as in:

    mvn -X io.openliberty.tools:liberty-maven-plugin:3.2.3:dev

Narrowing down the coordinates like this can help isolate the problem.

Comment 4 space88man 2020-09-30 07:32:00 UTC
Thanks for the tip: I have tried again specifying 3.2.3 and am seeing (with the first "Caused by" clause much further down)

[DEBUG] Could not find metadata io.openliberty:openliberty-kernel/maven-metadata.xml in local (/btrfs/richard/.m2/repository
)
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo.maven.apache.org/maven2
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.maven.apache.org/maven2
Downloading from central: https://repo.maven.apache.org/maven2/io/openliberty/openliberty-kernel/maven-metadata.xml
[DEBUG] Writing tracking file /btrfs/richard/.m2/repository/io/openliberty/openliberty-kernel/resolver-status.properties
[WARNING] Could not transfer metadata io.openliberty:openliberty-kernel/maven-metadata.xml from/to central (https://repo.mav
en.apache.org/maven2): User-specified log class 'org.codehaus.mojo.pluginsupport.logging.DelegatingLog' cannot be found or i
s not useable.
org.eclipse.aether.transfer.MetadataTransferException: Could not transfer metadata io.openliberty:openliberty-kernel/maven-m
etadata.xml from/to central (https://repo.maven.apache.org/maven2): User-specified log class 'org.codehaus.mojo.pluginsuppor
t.logging.DelegatingLog' cannot be found or is not useable.
    at org.eclipse.aether.connector.basic.MetadataTransportListener.transferFailed (MetadataTransportListener.java:52)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run (BasicRepositoryConnector.java:369)
    at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run (RunnableErrorForwarder.java:75)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute (BasicRepositoryConnector.java:644

Caused by: org.apache.commons.logging.LogConfigurationException: User-specified log class 'org.codehaus.mojo.pluginsupport.logging.DelegatingLog' cannot be found or is not useable.
    at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation (LogFactoryImpl.java:804)
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance (LogFactoryImpl.java:541)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance (LogFactoryImpl.java:292)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance (LogFactoryImpl.java:269)
    at org.apache.commons.logging.LogFactory.getLog (LogFactory.java:655)
    at org.apache.http.impl.client.BasicAuthCache.<init> (BasicAuthCache.java:63)
    at org.apache.http.impl.client.BasicAuthCache.<init> (BasicAuthCache.java:81)
    at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.openConnectionInternal (AbstractHttpClientWagon.java:601)
    at org.apache.maven.wagon.AbstractWagon.openConnection (AbstractWagon.java:139)
    at org.apache.maven.wagon.AbstractWagon.connect (AbstractWagon.java:239)
    at org.eclipse.aether.transport.wagon.WagonTransporter.connectWagon (WagonTransporter.java:342)
    at org.eclipse.aether.transport.wagon.WagonTransporter.pollWagon (WagonTransporter.java:382)
    at org.eclipse.aether.transport.wagon.WagonTransporter.execute (WagonTransporter.java:431)
    at org.eclipse.aether.transport.wagon.WagonTransporter.get (WagonTransporter.java:412)

All the other "Caused by":
Caused by: org.apache.maven.plugin.MojoExecutionException: Could not get the highest version from the range: [19.0.0.6,)
    at io.openliberty.tools.maven.AbstractLibertySupport.createArtifact (AbstractLibertySupport.java:234)
    at io.openliberty.tools.maven.AbstractLibertySupport.getArtifact (AbstractLibertySupport.java:158)
    at io.openliberty.tools.maven.BasicSupport.init (BasicSupport.java:226)
    at org.codehaus.mojo.pluginsupport.MojoSupport.execute (MojoSupport.java:119)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
   

Caused by: org.eclipse.aether.resolution.VersionRangeResolutionException: Unable to resolve version range fram io.openliberty:openliberty-kernel:zip:[19.0.0.6,)
    at io.openliberty.tools.maven.AbstractLibertySupport.resolveVersionRange (AbstractLibertySupport.java:335)
    at io.openliberty.tools.maven.AbstractLibertySupport.createArtifact (AbstractLibertySupport.java:232)
    at io.openliberty.tools.maven.AbstractLibertySupport.getArtifact (AbstractLibertySupport.java:158)
    at io.openliberty.tools.maven.BasicSupport.init (BasicSupport.java:226)
    at org.codehaus.mojo.pluginsupport.MojoSupport.execute (MojoSupport.java:119)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)

Comment 5 space88man 2020-09-30 07:36:16 UTC
When I use upstream maven

[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.maven.apache.org/maven2
Downloading from central: https://repo.maven.apache.org/maven2/io/openliberty/openliberty-kernel/maven-metadata.xml
[DEBUG] Writing tracking file /btrfs/richard/.m2/repository/io/openliberty/openliberty-kernel/resolver-status.properties

Then it succeeds with
[DEBUG] Available versions: [19.0.0.6, 19.0.0.7, 19.0.0.8, 19.0.0.9, 19.0.0.10, 19.0.0.11, 19.0.0.12, 20.0.0.1, 20.0.0.2, 20.0.0.3, 20.0.0.4, 20.0.0.5, 20.0.0.6, 20.0.0.7, 20.0.0.8, 20.0.0.9, 20.0.0.10]
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo.maven.apache.org/maven2
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.maven.apache.org/maven2
Downloading from central: https://repo.maven.apache.org/maven2/io/openliberty/openliberty-kernel/20.0.0.10/openliberty-kerne

Comment 6 space88man 2020-09-30 07:50:56 UTC
Not reproducible under Fedora 32 — these versions work:

maven-3.6.1-5.fc32.noarch
java-11-openjdk-11.0.8.10-2.fc32.x86_64

Comment 7 Christopher Tubbs 2020-09-30 08:30:00 UTC
The error seems show trouble resolving dependencies of commons-logging. However, it looks like upstream Maven uses jcl-over-slf4j-1.7.29.jar on its path to redirect commons-logging implementation to slf4j (and then provides its own maven-slf4j-provider-3.6.3.jar for the implementation).

I do see that the Maven packaging seems to `Requires: commons-logging` and the following command shows the package includes some extra stuff in its lib directory which are not included upstream (notably, `commons-logging`, which shouldn't be there).

Here's a complete difference between /usr/share/maven/lib and upstream's lib directory:

--- /tmp/upstream-lib-directory.txt	2020-09-30 04:22:03.358919647 -0400
+++ /tmp/usr-share-maven-lib.txt	2020-09-30 04:22:05.535925914 -0400
@@ -1 +1 @@
-cdi-api-1.0.jar
+cdi-api-1.1.jar
@@ -2,0 +3,2 @@
+commons-codec-1.11.jar
+commons-codec.jar
@@ -5 +7,2 @@
-guava-25.1-android.jar
+commons-logging.jar
+guava-27.1-jre.jar
@@ -6,0 +10,5 @@
+hawtjni-runtime-1.17.jar
+httpclient-4.5.12.jar
+httpcomponents_httpclient.jar
+httpcomponents_httpcore.jar
+httpcore-4.4.13.jar
@@ -7,0 +16,2 @@
+jansi-linux.jar
+jansi-native-1.8.jar
@@ -31,0 +42 @@
+maven-wagon_http-shared.jar
@@ -41 +52,2 @@
-wagon-http-3.3.4-shaded.jar
+wagon-http-3.3.4.jar
+wagon-http-shared-3.4.1.jar

I think commons-logging shouldn't be there at all, since jcl-over-slf4j is already present.

Comment 8 space88man 2020-09-30 08:35:11 UTC
Oh - that seems to have worked - 
I removed commons-logging.jar from /usr/share/maven/lib and the goal runs sucessfully.

The odd thing is that it works on Fedora 32 and commons-logging.jar is there too.

Comment 9 Christopher Tubbs 2020-09-30 09:32:45 UTC
There are a few other differences in F32 as well. It's possible that in F32, other stuff is also on the class path that makes it work, or that the classes are found in jcl-over-slf4j first there... by luck.

Either way, it seems like commons-logging shouldn't be there at all, and I'm not sure why it is. I'm also not sure why commons-codec is on there at all, never mind the fact that it's there twice.

I'm working on a fix for F33 for the commons-logging issue. Please test it once it is merged and built (a comment should appear here once that happens).

Comment 10 Fedora Update System 2020-10-14 21:42:15 UTC
FEDORA-2020-51797730bf has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-51797730bf

Comment 11 Fedora Update System 2020-10-15 19:08:49 UTC
FEDORA-2020-51797730bf has been pushed to the Fedora 33 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-51797730bf`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-51797730bf

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2020-10-25 01:01:13 UTC
FEDORA-2020-51797730bf has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.