Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[deploy] Improve error message when Maven Central Deploy fails with wrong credentials #1078

Closed
aalmiray opened this issue Nov 30, 2022 Discussed in #1077 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request released Issue has been released
Milestone

Comments

@aalmiray
Copy link
Member

Discussed in #1077

Originally posted by manikmagar November 30, 2022
I was attempting a maven central deploy and accidentally flipped the OSS repo credentials (and so the tweet :) https://twitter.com/ManikMagar/status/1597957765179518976?s=20&t=9xM8v6KR1JzagD5C3SVY1A)

image

Using JReleaser maven plugin 1.3.1 and jreleaser:deploy kept failing with following error in trace.log org.jreleaser.model.spi.deploy.DeployException: Could not find a staging profile matching -

This did not help much find the cause of incorrect credentials. After so many attempts and a close manual inspection of the setup I realized the cause 😆 😪 .

I think Maven deploy-related error messages could be improved to help debug the issue.

[ERROR] JReleaser failed after 4.321 s
org.jreleaser.model.JReleaserException: Unexpected error
	at org.jreleaser.engine.deploy.maven.MavenDeployers.deploy(MavenDeployers.java:128)
	at org.jreleaser.engine.deploy.maven.MavenDeployers.deploy(MavenDeployers.java:111)
	at org.jreleaser.workflow.DeployWorkflowItem.doInvoke(DeployWorkflowItem.java:35)
	at org.jreleaser.workflow.AbstractWorkflowItem.lambda$invoke$0(AbstractWorkflowItem.java:43)
	at org.jreleaser.engine.hooks.CommandHookExecutor.execute(CommandHookExecutor.java:52)
	at org.jreleaser.workflow.AbstractWorkflowItem.invoke(AbstractWorkflowItem.java:43)
	at org.jreleaser.workflow.WorkflowImpl.execute(WorkflowImpl.java:102)
	at org.jreleaser.maven.plugin.JReleaserDeployMojo.execute(JReleaserDeployMojo.java:78)
	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)
	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:957)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:47)
	at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:156)
	at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:72)
Caused by: org.jreleaser.model.spi.deploy.DeployException: Could not find a staging profile matching {groupId-excluded}
	at org.jreleaser.sdk.nexus2.Nexus2MavenDeployer.deploy(Nexus2MavenDeployer.java:82)
	at org.jreleaser.engine.deploy.maven.ProjectMavenDeployer.deploy(ProjectMavenDeployer.java:55)
	at org.jreleaser.engine.deploy.maven.MavenDeployers.deploy(MavenDeployers.java:124)
	... 36 more
Caused by: org.jreleaser.sdk.nexus2.Nexus2Exception: Unexpected error
	at org.jreleaser.sdk.nexus2.Nexus2.wrap(Nexus2.java:277)
	at org.jreleaser.sdk.nexus2.Nexus2.findStagingProfileId(Nexus2.java:125)
	at org.jreleaser.sdk.nexus2.Nexus2MavenDeployer.deploy(Nexus2MavenDeployer.java:79)
	... 38 more
Caused by: org.jreleaser.sdk.nexus2.api.NexusAPIException
	at org.jreleaser.sdk.nexus2.Nexus2$NexusErrorDecoder.decode(Nexus2.java:413)
	at feign.AsyncResponseHandler.handleResponse(AsyncResponseHandler.java:98)
	at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:141)
	at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:91)
	at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100)
	at com.sun.proxy.$Proxy32.getStagingProfiles(Unknown Source)
	at org.jreleaser.sdk.nexus2.Nexus2.lambda$findStagingProfileId$4(Nexus2.java:126)
	at org.jreleaser.sdk.nexus2.Nexus2.wrap(Nexus2.java:269)
	... 40 more

In the past, I have seen that same error but due to different root cause (Discussion #1008) - OSS URL being wrong. That made me focus more on the URL issue but that wasn't the cause this time.

@aalmiray aalmiray self-assigned this Nov 30, 2022
@aalmiray aalmiray added the enhancement New feature or request label Nov 30, 2022
@aalmiray aalmiray added this to the v1.4.0 milestone Nov 30, 2022
@aalmiray aalmiray changed the title [deploy] Improved error message when Maven Central Deploy fails with wrong credentials? [deploy] Improve error message when Maven Central Deploy fails with wrong credentials Nov 30, 2022
@aalmiray aalmiray added the released Issue has been released label Dec 29, 2022
@aalmiray
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released Issue has been released
Projects
None yet
Development

No branches or pull requests

1 participant