-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
At this line:
Line 85 in 4a16c79
| versions[1]=$(echo $metadata | xmllint --xpath "/metadata/versioning/snapshotVersions/snapshotVersion[extension='$packaging']/value/text()" - 2>/dev/null) |
The version returned is mangled when there is a sources or Javadoc jar. For example, assume this is metadata.xml:
<metadata modelVersion="1.1.0">
<groupId>com.example</groupId>
<artifactId>theArtifact</artifactId>
<version>0.0.2-SNAPSHOT</version>
<versioning>
<snapshot>
<timestamp>20181129.175944</timestamp>
<buildNumber>1</buildNumber>
</snapshot>
<lastUpdated>20181129175945</lastUpdated>
<snapshotVersions>
<snapshotVersion>
<classifier>sources</classifier>
<extension>jar</extension>
<value>0.0.2-20181129.175944-1</value>
<updated>20181129175944</updated>
</snapshotVersion>
<snapshotVersion>
<extension>jar</extension>
<value>0.0.2-20181129.175944-1</value>
<updated>20181129175944</updated>
</snapshotVersion>
<snapshotVersion>
<extension>pom</extension>
<value>0.0.2-20181129.175944-1</value>
<updated>20181129175944</updated>
</snapshotVersion>
</snapshotVersions>
</versioning>
</metadata>
The code will execute this command with the above as input:
xmllint --xpath "/metadata/versioning/snapshotVersions/snapshotVersion[extension='jar']/value/text()" -
And the returned value is incorrect:
0.0.2-20181129.175944-10.0.2-20181129.175944-1
The correct command to run might be this one (for example):
xmllint --xpath "/metadata/versioning/snapshotVersions/snapshotVersion[extension='jar' and count(*)=3]/value/text()" -
And the correct version is calculated:
0.0.2-20181129.175944-1
Metadata
Metadata
Assignees
Labels
No labels