Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.6.3
-
None
Description
Due to the change introduced in MNG-6705 (https://github.com/apache/maven/commit/53f04f03e3e58c75dcc791d557758357a6ec7983) an empty version being passed to the constructor of DefaultArtifact leads to an IllegalArgumentException
java.lang.IllegalArgumentException: version can neither be null, empty nor blank
at org.apache.commons.lang3.Validate.notBlank(Validate.java:454)
at org.apache.maven.artifact.ArtifactUtils.notBlank(ArtifactUtils.java:107)
at org.apache.maven.artifact.ArtifactUtils.toSnapshotVersion(ArtifactUtils.java:57)
at org.apache.maven.artifact.DefaultArtifact.setBaseVersionInternal(DefaultArtifact.java:389)
at org.apache.maven.artifact.DefaultArtifact.selectVersion(DefaultArtifact.java:506)
at org.apache.maven.artifact.DefaultArtifact.selectVersionFromNewRangeIfAvailable(DefaultArtifact.java:494)
at org.apache.maven.artifact.DefaultArtifact.<init>(DefaultArtifact.java:106)
at org.apache.maven.artifact.DefaultArtifact.<init>(DefaultArtifact.java:86)
Prior to Maven 3.6.2 this was throwing no exception at all (only null version values were rejected).
Although throwing an exception for an invalid version is probably fine it should rather be a InvalidArtifactRTException thrown for other mandatory but empty arguments in https://github.com/apache/maven/blob/c0012c08aaad27473770fc39ab7e39026238c7e1/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java#L165-L184
Attachments
Issue Links
- causes
-
JCRVLT-769 mapPackageDependencyToMavenGa does no longer work
- Closed
- is caused by
-
MNG-6705 Speep up Artifact version check and Parent interpolation
- Closed
- is related to
-
MNG-7780 DefaultArtifact.equals throws NullPointerException if o.version is null
- Closed
-
MNG-8205 Deprecate o.a.m.artifact
- Open
- links to