Skip to content

Commit

Permalink
feat: replace semver4j with maven-artifact (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
olenagerasimova committed May 16, 2023
1 parent c53e239 commit f521d6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ SOFTWARE.
<version>0.23.1</version>
</dependency>
<dependency>
<groupId>com.vdurmont</groupId>
<artifactId>semver4j</artifactId>
<version>3.1.0</version>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>3.9.1</version>
</dependency>
</dependencies>
<build>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/artipie/rpm/meta/CrCompareDependency.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*/
package com.artipie.rpm.meta;

import com.vdurmont.semver4j.Semver;
import java.util.Comparator;
import org.apache.maven.artifact.versioning.ComparableVersion;

/**
* Compare two dependencies by name.
Expand Down Expand Up @@ -73,8 +73,8 @@ public int compare(final String depa, final String depb) {
} else {
vera = depa.substring(vera.length() - 1, verea.length() - 1);
verb = depb.substring(verb.length() - 1, vereb.length() - 1);
result = new Semver(vera, Semver.SemverType.LOOSE).compareTo(
new Semver(verb, Semver.SemverType.LOOSE)
result = new ComparableVersion(vera).compareTo(
new ComparableVersion(verb)
);
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/test/java/com/artipie/rpm/files/TestBundle.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.io.BufferedInputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.nio.file.Path;
import org.cactoos.io.InputOf;
Expand Down Expand Up @@ -122,11 +123,11 @@ public int count() {
*/
URL url() {
try {
return new URL(
return URI.create(
String.format(
"https://artipie.s3.amazonaws.com/rpm-test/%s.tar.gz", this.filename()
)
);
).toURL();
} catch (final MalformedURLException ex) {
throw new IllegalArgumentException("Invalid url", ex);
}
Expand Down

0 comments on commit f521d6b

Please sign in to comment.