Skip to content

Commit f521d6b

Browse files
feat: replace semver4j with maven-artifact (#548)
1 parent c53e239 commit f521d6b

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@ SOFTWARE.
242242
<version>0.23.1</version>
243243
</dependency>
244244
<dependency>
245-
<groupId>com.vdurmont</groupId>
246-
<artifactId>semver4j</artifactId>
247-
<version>3.1.0</version>
245+
<groupId>org.apache.maven</groupId>
246+
<artifactId>maven-artifact</artifactId>
247+
<version>3.9.1</version>
248248
</dependency>
249249
</dependencies>
250250
<build>

src/main/java/com/artipie/rpm/meta/CrCompareDependency.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*/
55
package com.artipie.rpm.meta;
66

7-
import com.vdurmont.semver4j.Semver;
87
import java.util.Comparator;
8+
import org.apache.maven.artifact.versioning.ComparableVersion;
99

1010
/**
1111
* Compare two dependencies by name.
@@ -73,8 +73,8 @@ public int compare(final String depa, final String depb) {
7373
} else {
7474
vera = depa.substring(vera.length() - 1, verea.length() - 1);
7575
verb = depb.substring(verb.length() - 1, vereb.length() - 1);
76-
result = new Semver(vera, Semver.SemverType.LOOSE).compareTo(
77-
new Semver(verb, Semver.SemverType.LOOSE)
76+
result = new ComparableVersion(vera).compareTo(
77+
new ComparableVersion(verb)
7878
);
7979
}
8080
}

src/test/java/com/artipie/rpm/files/TestBundle.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.io.BufferedInputStream;
99
import java.io.IOException;
1010
import java.net.MalformedURLException;
11+
import java.net.URI;
1112
import java.net.URL;
1213
import java.nio.file.Path;
1314
import org.cactoos.io.InputOf;
@@ -122,11 +123,11 @@ public int count() {
122123
*/
123124
URL url() {
124125
try {
125-
return new URL(
126+
return URI.create(
126127
String.format(
127128
"https://artipie.s3.amazonaws.com/rpm-test/%s.tar.gz", this.filename()
128129
)
129-
);
130+
).toURL();
130131
} catch (final MalformedURLException ex) {
131132
throw new IllegalArgumentException("Invalid url", ex);
132133
}

0 commit comments

Comments
 (0)