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

Fix distribution management snapshot repository load #146

Merged

Conversation

rikycaldeira
Copy link
Contributor

This typo when getting the ID can lead to this error when there's only a snapshot repository in the distribution management

[ERROR] Internal error: java.lang.NullPointerException: Cannot invoke "org.apache.maven.model.DeploymentRepository.getId()" because the return value of "org.apache.maven.model.DistributionManagement.getRepository()" is null -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException: Cannot invoke "org.apache.maven.model.DeploymentRepository.getId()" because the return value of "org.apache.maven.model.DistributionManagement.getRepository()" is null
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:109)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.maven.model.DeploymentRepository.getId()" because the return value of "org.apache.maven.model.DistributionManagement.getRepository()" is null
    at io.repaint.maven.tiles.TilesMavenLifecycleParticipant.discoverAndSetDistributionManagementArtifactoryRepositoriesIfTheyExist (TilesMavenLifecycleParticipant.groovy:374)
    at io.repaint.maven.tiles.TilesMavenLifecycleParticipant.afterProjectsRead (TilesMavenLifecycleParticipant.groovy:338)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:223)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)

@rikycaldeira rikycaldeira force-pushed the fix-distribution-management-snapshot branch from 78a482b to 25c938e Compare October 17, 2023 09:57
@talios
Copy link
Member

talios commented Oct 17, 2023

Well I feel like an idiot with that change! I wonder if this is also contributing to the issue found in #144.

@talios talios merged commit 4ac6409 into repaint-io:master Oct 17, 2023
@rikycaldeira
Copy link
Contributor Author

Well I feel like an idiot with that change! I wonder if this is also contributing to the issue found in #144.

Happens! Looking at #144 it seems related 🤔

@talios
Copy link
Member

talios commented Oct 17, 2023

I have an unpushed change to try and resolve #144 - but sounds like that's not working for the OP even tho it solved the NPE - so that might be a separate issue.

I'll look at releasing 2.38 with both fixes tomorrow then look at trying to reproduce it.

@talios
Copy link
Member

talios commented Oct 17, 2023

This has now been released as 2.38. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants