[GRADLE-3233] Nullpointer exception in uploadArchives Created: 30/Jan/15  Updated: 06/Feb/15  Resolved: 30/Jan/15

Status: Resolved
Project: Gradle
Affects Version/s: 2.3-rc-1
Fix Version/s: 2.3-rc-3

Type: Bug
Reporter: Gradle Forums Assignee: René Gröschke (Inactive)
Resolution: Fixed Votes: 0

Known Issue Of:

 Description   

http://forums.gradle.org/gradle/topics/-2-3-rc-1-regression-npe-in-uploadarchives

when having a dependency with a null version, a nullpointer exception occurs in the mapToMavenSyntax logic:

{{Caused by: java.lang.NullPointerException
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.DefaultVersionSelectorScheme.parseSelector(DefaultVersionSelectorScheme.java:21)
at org.gradle.api.publication.maven.internal.MavenVersionRangeMapper.map(MavenVersionRangeMapper.java:28)
at org.gradle.api.publication.maven.internal.ant.DefaultPomDependenciesConverter.mapToMavenSyntax(DefaultPomDependenciesConverter.java:135)
at org.gradle.api.publication.maven.internal.ant.DefaultPomDependenciesConverter.createMavenDependency(DefaultPomDependenciesConverter.java:125)
at org.gradle.api.publication.maven.internal.ant.DefaultPomDependenciesConverter.createMavenDependencyFromDependencyDescriptor(DefaultPomDependenciesConverter.java:113)
at org.gradle.api.publication.maven.internal.ant.DefaultPomDependenciesConverter.addFromDependencyDescriptor(DefaultPomDependenciesConverter.java:104)
at org.gradle.api.publication.maven.internal.ant.DefaultPomDependenciesConverter.convert(DefaultPomDependenciesConverter.java:47)
at org.gradle.api.publication.maven.internal.DefaultMavenPom.getGeneratedDependencies(DefaultMavenPom.java:158)
at org.gradle.api.publication.maven.internal.DefaultMavenPom.getEffectivePom(DefaultMavenPom.java:168)
at org.gradle.api.publication.maven.internal.DefaultMavenPom.writeTo(DefaultMavenPom.java:189)
at org.gradle.api.publication.maven.internal.DefaultMavenPom$1.execute(DefaultMavenPom.java:199)
at org.gradle.api.publication.maven.internal.DefaultMavenPom$1.execute(DefaultMavenPom.java:197)
at org.gradle.internal.IoActions$TextFileWriterIoAction.execute(IoActions.java:110)
... 80 more}}

In general this still leads to an invalid pom file which might or might not result in an exception when the pom file is validated. It turns out that the maven pom validation from used in the maven ant tasks we use under the hood of the uploadArchives task is flaky.



 Comments   
Comment by René Gröschke (Inactive) [ 06/Feb/15 ]

also happens when using incubating maven-publish plugin. fixed in release branch

Generated at Wed Jun 30 12:43:27 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.