Skip to content

Commit

Permalink
Fixed version checking in Catalog to accomodate also x.y.z.w-somethin…
Browse files Browse the repository at this point in the history
…g format.
  • Loading branch information
valdar committed Mar 5, 2019
1 parent e01360f commit 2830432
Show file tree
Hide file tree
Showing 6 changed files with 517 additions and 2 deletions.
19 changes: 19 additions & 0 deletions camel-k-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,25 @@
<artifactId>guava</artifactId>
<version>20.0</version>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public int getOrder() {

@Override
public boolean accepts(CamelCatalog catalog) {
return new Semver(catalog.getCatalogVersion(), Semver.SemverType.IVY).satisfies("[2.18,3]");
Semver semver = new Semver(catalog.getCatalogVersion(), Semver.SemverType.IVY);
return semver.isGreaterThanOrEqualTo("2.18.0") && semver.isLowerThan("3.0.0");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public int getOrder() {

@Override
public boolean accepts(CamelCatalog catalog) {
return new Semver(catalog.getCatalogVersion(), Semver.SemverType.IVY).withClearedSuffixAndBuild().satisfies("[3,4]");
Semver semver = new Semver(catalog.getCatalogVersion(), Semver.SemverType.IVY);
return semver.isGreaterThan("2.999.999") && semver.isLowerThan("4.0.0");
}

@Override
Expand Down
Loading

0 comments on commit 2830432

Please sign in to comment.