[ 
https://issues.apache.org/jira/browse/MNG-8121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17846618#comment-17846618
 ] 

Gili edited comment on MNG-8121 at 5/15/24 12:53 PM:
-----------------------------------------------------

[~sjaranowski] I think you nailed it, but I also think that [~cstamas] has 
missed an important use-case that only nexus-staging-plugin seems to handle: 
deploying artifacts from different machines into the same staging environment.

In the context of cmake-maven-plugin and other projects that deploy native 
artifacts, we build the project on different machines. Then each machine 
uploads native files specific to that platform into the same staging 
environment. Then, we tag all the files as a single release.

Correct me if I'm wrong, but I don't think this is possible using 
release-maven-plugin.

In the context of nexus-staging-plugin, we are trying to deploy using the same 
"stagingRepositoryId" and "stagingProfileId" values from multiple machines.

Is it possible to do this using maven-deploy-plugin somehow?


was (Author: cowwoc):
[~sjaranowski] I think you nailed it, but I also think that [~cstamas] has 
missed an important use-case that only nexus-staging-plugin seems to handle: 
deploying artifacts from different machines into the same staging environment.

In the context of cmake-maven-plugin and other projects that deploy native 
artifacts, we build the project on different machines. Then each machine 
uploads native files specific to that platform into the same staging 
environment. Then, we tag all the files as a single release.

Correct me if I'm wrong, but I don't think this is possible using 
release-maven-plugin.

> NullPointerException at 
> org.apache.maven.artifact.repository.metadata.Metadata.merge 
> (Metadata.java:293)
> --------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-8121
>                 URL: https://issues.apache.org/jira/browse/MNG-8121
>             Project: Maven
>          Issue Type: Bug
>          Components: Artifacts and Repositories
>    Affects Versions: 3.9.6
>         Environment: Maven 3.9.6
> maven-plugin-plugin 3.13.0
> org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13
>            Reporter: Gili
>            Priority: Major
>
> TL;DR {{org.apache.maven.artifact.repository.metadata.Metadata.merge 
> (Metadata.java:293)}} throws {{NullPointerException}} if previous releases of 
> a plugin did not have a goalPrefix set.
>  
> At least, this is my interpretation of what is going on.
>  
> Background
> -------------
>  
> I have an open-source project at 
> [https://github.com/cmake-maven-project/cmake-maven-project/tree/v3.27.1-b1] 
> with the following coordinates:
>  
> <groupId>com.googlecode.cmake-maven-project</groupId>
> <artifactId>cmake</artifactId>
>  
> If I upgrade "maven-plugin-plugin" from version 3.10.1 to 3.13.0 I am forced 
> to set "<goalPrefix>" because of 
> https://issues.apache.org/jira/browse/MPLUGIN-450 and 
> [https://github.com/apache/maven-plugin-tools/commit/ed4774bcd8b8d2d1f7ff1196cf7644054cb3ae14#diff-624cbd32cd7fc0f3f9154fbec92b8a1aebb04614360b4a0b5fc28a407e99d743L96]
>  
> In my particular case, I set "<goalPrefix>cmake-binaries</goalPrefix>" inside 
> cmake-binaries-plugin/pom.xml.
> Now, when I try deploying a release to Maven Central I get the following 
> exception stack trace:
>  
>  
> {noformat}
> java.lang.NullPointerException
>     at org.apache.maven.artifact.repository.metadata.Metadata.merge 
> (Metadata.java:293)
>     at 
> org.apache.maven.artifact.repository.metadata.AbstractRepositoryMetadata.updateRepositoryMetadata
>  (AbstractRepositoryMetadata.java:99)
>     at 
> org.apache.maven.artifact.repository.metadata.AbstractRepositoryMetadata.storeInLocalRepository
>  (AbstractRepositoryMetadata.java:59)
>     at org.apache.maven.artifact.repository.metadata.MetadataBridge.merge 
> (MetadataBridge.java:56)
>     at org.eclipse.aether.internal.impl.DefaultDeployer.upload 
> (DefaultDeployer.java:399)
>     at org.eclipse.aether.internal.impl.DefaultDeployer.deploy 
> (DefaultDeployer.java:294)
>     at org.eclipse.aether.internal.impl.DefaultDeployer.deploy 
> (DefaultDeployer.java:202)
>     at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy 
> (DefaultRepositorySystem.java:393)
>     at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy 
> (DefaultArtifactDeployer.java:131)
>     at 
> org.sonatype.nexus.maven.staging.deploy.strategy.AbstractDeployStrategy.deployUp
>  (AbstractDeployStrategy.java:213)
>     at 
> org.sonatype.nexus.maven.staging.deploy.strategy.StagingDeployStrategy.finalizeDeploy
>  (StagingDeployStrategy.java:125)
>     at org.sonatype.nexus.maven.staging.deploy.DeployMojo.execute 
> (DeployMojo.java:213)
>     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:126){noformat}
>  
> I assume that this is caused by {{preExisting.getPrefix()}} returning null, 
> but I have no idea why this is happening. Perhaps this is caused by previous 
> versions not have a goalPrefix set? Shouldn't the implementation handle this 
> possibility?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to