Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.12.1
-
None
-
openjdk 15.0.1 2020-10-20
OpenJDK Runtime Environment (build 15.0.1+9-18)
OpenJDK 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)
Description
Hi!
I was trying to release a project today and my task mvn changes:announcement-send failed with:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-changes-plugin:2.12.1:announcement-mail (default-cli) on project elasticsearch-beyonder: Execution default-cli of goal org.apache.maven.plugins:maven-changes-plugin:2.12.1:announcement-mail failed: Unable to load the mojo 'announcement-mail' in the plugin 'org.apache.maven.plugins:maven-changes-plugin:2.12.1'. A required class is missing: com/sun/net/ssl/internal/ssl/Provider
So I started to look at the stacktrace:
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:539) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:124) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290) at org.apache.maven.cli.MavenCli.main (MavenCli.java:194) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:564) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356) Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider at org.apache.maven.plugin.announcement.AnnouncementMailMojo.<init> (AnnouncementMailMojo.java:229) at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:64) at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstanceWithCaller (Constructor.java:500) at java.lang.reflect.Constructor.newInstance (Constructor.java:481) at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance (DefaultConstructionProxyFactory.java:86) at com.google.inject.internal.ConstructorInjector.provision (ConstructorInjector.java:105) at com.google.inject.internal.ConstructorInjector.access$000 (ConstructorInjector.java:32) at com.google.inject.internal.ConstructorInjector$1.call (ConstructorInjector.java:89) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:115) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:133) at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:68) at com.google.inject.internal.ConstructorInjector.construct (ConstructorInjector.java:87) at com.google.inject.internal.ConstructorBindingImpl$Factory.get (ConstructorBindingImpl.java:267) at com.google.inject.internal.InjectorImpl$2$1.call (InjectorImpl.java:1016) at com.google.inject.internal.InjectorImpl.callInContext (InjectorImpl.java:1103) at com.google.inject.internal.InjectorImpl$2.get (InjectorImpl.java:1012) at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1051) at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48) at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:81) at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:53) at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:65) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:115) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:133) at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:68) at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:63) at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:45) at com.google.inject.internal.InjectorImpl$2$1.call (InjectorImpl.java:1016) at com.google.inject.internal.InjectorImpl.callInContext (InjectorImpl.java:1092) at com.google.inject.internal.InjectorImpl$2.get (InjectorImpl.java:1012) at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162) at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81) at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51) at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263) at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255) at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:519) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:124) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290) at org.apache.maven.cli.MavenCli.main (MavenCli.java:194) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:564) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356) Caused by: java.lang.ClassNotFoundException: com.sun.net.ssl.internal.ssl.Provider at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239) at org.apache.maven.plugin.announcement.AnnouncementMailMojo.<init> (AnnouncementMailMojo.java:229) at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:64) at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstanceWithCaller (Constructor.java:500) at java.lang.reflect.Constructor.newInstance (Constructor.java:481) at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance (DefaultConstructionProxyFactory.java:86) at com.google.inject.internal.ConstructorInjector.provision (ConstructorInjector.java:105) at com.google.inject.internal.ConstructorInjector.access$000 (ConstructorInjector.java:32) at com.google.inject.internal.ConstructorInjector$1.call (ConstructorInjector.java:89) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:115) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:133) at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:68) at com.google.inject.internal.ConstructorInjector.construct (ConstructorInjector.java:87) at com.google.inject.internal.ConstructorBindingImpl$Factory.get (ConstructorBindingImpl.java:267) at com.google.inject.internal.InjectorImpl$2$1.call (InjectorImpl.java:1016) at com.google.inject.internal.InjectorImpl.callInContext (InjectorImpl.java:1103) at com.google.inject.internal.InjectorImpl$2.get (InjectorImpl.java:1012) at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1051) at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48) at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:81) at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:53) at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:65) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:115) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:133) at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:68) at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:63) at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:45) at com.google.inject.internal.InjectorImpl$2$1.call (InjectorImpl.java:1016) at com.google.inject.internal.InjectorImpl.callInContext (InjectorImpl.java:1092) at com.google.inject.internal.InjectorImpl$2.get (InjectorImpl.java:1012) at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162) at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81) at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51) at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263) at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255) at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:519) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:124) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290) at org.apache.maven.cli.MavenCli.main (MavenCli.java:194) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:564) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
And found that:
Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider at org.apache.maven.plugin.announcement.AnnouncementMailMojo.<init> (AnnouncementMailMojo.java:229)
The source code shows:
if ( isSslMode() ) { try { // Try to load the SSL Provider class before we use it, it isn't present in non-Sun JVMs this.getClass().getClassLoader().loadClass( "com.sun.net.ssl.internal.ssl.Provider" ); Security.addProvider( new com.sun.net.ssl.internal.ssl.Provider() ); props.put( "mail.smtp.socketFactory.port", String.valueOf( getSmtpPort() ) ); props.put( "mail.smtp.socketFactory.class", SSL_FACTORY ); props.put( "mail.smtp.socketFactory.fallback", "false" ); } catch ( ClassNotFoundException e ) { getLogger().error( "You can't use sslMode because your system is missing an SSL Provider.", e ); } }
So I tried to run it with:
<sslMode>false</sslMode>
But it was failing with the same error. Which is expected as the code was failing while calling the ctor not while running the initialize() method.
In fact, I think that this line is wrong as the compiler is probably linking to this class and because this class can not be found at runtime (using OpenJDK 15), it fails to create an instance.
Security.addProvider( new com.sun.net.ssl.internal.ssl.Provider() );
I created a sample project which reproduces the behavior.
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.example</groupId> <artifactId>maven-changes-plugin</artifactId> <version>1.0-SNAPSHOT</version> <properties> <maven.compiler.source>15</maven.compiler.source> <maven.compiler.target>15</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-changes-plugin</artifactId> <version>2.12.1</version> </dependency> </dependencies> </project>
package fr.pilato.test.maven.changes; import org.apache.maven.plugin.announcement.mailsender.ProjectJavamailMailSender; public class Launcher { public static void main(String[] args) { new ProjectJavamailMailSender(); } }
Let me know if I can provide any other details.
Thanks!
Attachments
Issue Links
- is fixed by
-
MCHANGES-403 Remove use of internal Sun SSL provider
- Closed