-
Type:
Bug
-
Status: Open
-
Resolution: Unresolved
-
Affects Version/s: 6.12.1
-
Fix Version/s: None
-
Component/s: Maven
-
Labels:
-
Severity:Medium
When an artifact with a SNAPSHOT version is deployed in combination with properties then the Maven metadata is broken in that it swallows the SNAPSHOT. Steps to reproduce:
- Deploy a SNAPSHOT artifact.
- Get maven-metadata.xml for that artifact:
<metadata> <groupId>com.knime.enterprise</groupId> <artifactId>feature-branch-test.source</artifactId> <versioning> <latest>0.0.1-SNAPSHOT</latest> <versions> <version>0.0.1-SNAPSHOT</version> </versions> <lastUpdated>20190904145943</lastUpdated> </versioning> </metadata>
- Deploy the same SNAPSHOT artifacts using a property by adding ";property=value" to the deployment URL.
- Get maven-metadata.xml for that artifact again:
<metadata> <groupId>com.knime.enterprise</groupId> <artifactId>feature-branch-test.source</artifactId> <versioning> <latest>0.0.1</latest> <release>0.0.1</release> <versions> <version>0.0.1</version> <version>0.0.1-SNAPSHOT</version> </versions> <lastUpdated>20190904150406</lastUpdated> </versioning> </metadata>
As you can see the metadata is clearly wrong because it suddenly lists a non-SNAPSHOT version that doesn't exist. This breaks Maven dependency resolution, especially when using version ranges because 0.0.1 is greater than 0.0.1-SNAPSHOT and will thus be preferred.