diff --git a/README.md b/README.md
index 896c95ad1..0c6942c5f 100644
--- a/README.md
+++ b/README.md
@@ -18,6 +18,9 @@ The project is very much Work In Progress and will be published on maven central
# Release Notes
BOAT is still under development and subject to change.
+## 0.15.1
+* *Maven Plugin*
+ * Made `boat:radio` goal properties w.r.t boat-bay server unique.
## 0.15.0
* *Maven Plugin*
* Added new goal `boat:radio`; see the description in the [plugin documentation](boat-maven-plugin/README.md#boatradio).
diff --git a/boat-engine/pom.xml b/boat-engine/pom.xml
index cb7e24272..cced368fe 100644
--- a/boat-engine/pom.xml
+++ b/boat-engine/pom.xml
@@ -5,7 +5,7 @@
com.backbase.oss
backbase-openapi-tools
- 0.15.0
+ 0.15.1-SNAPSHOT
boat-engine
jar
diff --git a/boat-maven-plugin/README.md b/boat-maven-plugin/README.md
index a9a88130d..f8d287957 100644
--- a/boat-maven-plugin/README.md
+++ b/boat-maven-plugin/README.md
@@ -265,32 +265,38 @@ Available parameters:
User property: artifactId
Project ArtifactId in Boat-Bay. Defaults to ${project.artifactId}
+ boatBayPassword
+ User property: boat.bay.password
+ Defines the password of the username which can access the Boat-Bay upload
+ API. Required if boat-bay APIs are protected.
+
boatBayUrl
Required: true
- User property: boatBayUrl
+ User property: boat.bay.url
Boat-Bay domain. eg. https://boatbay.mycompany.eu
+ boatBayUsername
+ User property: boat.bay.username
+ Defines the username which can access Boat-Bay upload API. Required if
+ boat-bay APIs are protected.
+
+ failOnBoatBayErrorResponse (Default: false)
+ User property: failOnBoatBayErrorResponse
+ Fail the build if boatbay server returns an error
+
failOnBreakingChange (Default: false)
User property: failOnBreakingChange
Fail the build for breaking changes in specs
failOnLintViolation (Default: false)
User property: failOnLintViolation
- Fail the build if the spec has lint violation (Violation with Severity.MUST)
-
- failOnBoatBayErrorResponse (Default: true)
- User property: failOnBoatBayErrorResponse
- Fail the build if boatbay server returns an error
+ Fail the build if the spec has lint violation (Violation with
+ Severity.MUST)
groupId (Default: ${project.groupId})
User property: groupId
Project GroupId in Boat-Bay. Defaults to ${project.groupId}
- password
- User property: password
- Defines the password of the username which can access the Boat-Bay upload
- API. Required if boat-bay APIs are protected.
-
portalKey
Required: true
User property: portalKey
@@ -323,16 +329,12 @@ Available parameters:
way. For instance, if the actual file is my-service-api-v3.1.4.yaml the
expression could be my-service-api-v*.yaml.
- username
- User property: username
- Defines the username which can access Boat-Bay upload API. Required if
- boat-bay APIs are protected.
-
version (Default: ${project.version})
User property: version
Project Version in Boat-Bay. Defaults to ${project.version}
+
Configuration example:
```$xml
diff --git a/boat-maven-plugin/pom.xml b/boat-maven-plugin/pom.xml
index 9ceee791b..349e6c1f6 100644
--- a/boat-maven-plugin/pom.xml
+++ b/boat-maven-plugin/pom.xml
@@ -5,7 +5,7 @@
com.backbase.oss
backbase-openapi-tools
- 0.15.0
+ 0.15.1-SNAPSHOT
boat-maven-plugin
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/BundleMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/BundleMojo.java
index 6345c8a33..3671d6781 100644
--- a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/BundleMojo.java
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/BundleMojo.java
@@ -144,8 +144,13 @@ String versionFileName(String originalFileName, OpenAPI openAPI) throws MojoExec
if (openApiVersion == null) {
throw new MojoExecutionException("Configured to use version in filename, but no version set.");
}
- String majorFromFileName = originalFileName.replaceAll("^(.*api-v)([0-9]+)(\\.yaml$)", "$2");
+ if (!openApiVersion.matches("^\\d\\..*")) {
+ throw new MojoExecutionException(
+ "Version should be semver (or at least have a recognisable major version), but found '" + openApiVersion
+ + "' (string starts with number and dot: 2.0.0, 2.blabla, 2.3.4.5.6.234234)");
+ }
String majorFromVersion = openApiVersion.substring(0, openApiVersion.indexOf("."));
+ String majorFromFileName = originalFileName.replaceAll("^(.*api-v)([0-9]+)(\\.yaml$)", "$2");
if (!majorFromFileName.equals(majorFromVersion)) {
throw new MojoExecutionException("Invalid version " + openApiVersion + " in file " + originalFileName);
}
diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/radio/RadioMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/radio/RadioMojo.java
index 3ec98cea8..75ffde6f9 100644
--- a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/radio/RadioMojo.java
+++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/radio/RadioMojo.java
@@ -19,6 +19,7 @@
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
@@ -58,7 +59,7 @@ public class RadioMojo extends AbstractMojo {
/**
* Boat-Bay domain. eg. https://boatbay.mycompany.eu
*/
- @Parameter(property = "boatBayUrl", required = true)
+ @Parameter(property = "boat.bay.url", required = true)
private String boatBayUrl;
/**
@@ -76,8 +77,8 @@ public class RadioMojo extends AbstractMojo {
/**
* Fail the build if boatbay server returns an error
*/
- @Parameter(property = "failOnBoatBayErrorResponse", defaultValue="true")
- private boolean failOnBoatBayErrorResponse =true;
+ @Parameter(property = "failOnBoatBayErrorResponse", defaultValue="false")
+ private boolean failOnBoatBayErrorResponse;
/**
* Project portal Identifier in Boat-Bay.
@@ -94,14 +95,14 @@ public class RadioMojo extends AbstractMojo {
/**
* Defines the username which can access Boat-Bay upload API. Required if boat-bay APIs are protected.
*/
- @Parameter(property = "username")
- private String username;
+ @Parameter(property = "boat.bay.username")
+ private String boatBayUsername;
/**
* Defines the password of the username which can access the Boat-Bay upload API. Required if boat-bay APIs are protected.
*/
- @Parameter(property = "password")
- private String password;
+ @Parameter(property = "boat.bay.password")
+ private String boatBayPassword;
/**
*
@@ -142,9 +143,9 @@ public void execute() throws MojoExecutionException, MojoFailureException {
ObjectMapper objectMapper = new ObjectMapper();
- if (username != null && !username.isEmpty() && password != null && !password.isEmpty()) {
- getLog().info("Basic Authentication set for username " + username);
- basicAuthRequestInterceptor = new BasicAuthRequestInterceptor(username, password);
+ if (StringUtils.isNotEmpty(boatBayUsername) && StringUtils.isNotEmpty(boatBayPassword)) {
+ getLog().info("Basic Authentication set for username " + boatBayUsername);
+ basicAuthRequestInterceptor = new BasicAuthRequestInterceptor(boatBayUsername, boatBayPassword);
} else {
getLog().info("No Authentication set");
}
diff --git a/boat-maven-plugin/src/test/java/com/backbase/oss/boat/BundleMojoTest.java b/boat-maven-plugin/src/test/java/com/backbase/oss/boat/BundleMojoTest.java
index 1d14699de..5ab40c1a8 100644
--- a/boat-maven-plugin/src/test/java/com/backbase/oss/boat/BundleMojoTest.java
+++ b/boat-maven-plugin/src/test/java/com/backbase/oss/boat/BundleMojoTest.java
@@ -12,6 +12,7 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.function.Executable;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -110,10 +111,23 @@ void testInvalidVersionInApi() {
OpenAPI openAPI = new OpenAPI();
openAPI.setInfo(new Info());
- assertThrows(MojoExecutionException.class, () ->
- mojo.versionFileName("payment-order-client-api-v2.yaml", createOpenApiWithVersion("3.0.0")));
+ assertThrowsMojoExecutionExceptionWithMessage(
+ () -> mojo.versionFileName("payment-order-client-api-v2.yaml", createOpenApiWithVersion("3.0.0")),
+ "Invalid version 3.0.0 in file payment-order-client-api-v2.yaml");
+ assertThrowsMojoExecutionExceptionWithMessage(
+ () -> mojo.versionFileName("payment-order-client-api-v2.yaml", createOpenApiWithVersion("v2.0")),
+ "Version should be semver (or at least have a recognisable major version), but found 'v2.0'");
+ assertThrowsMojoExecutionExceptionWithMessage(
+ () -> mojo.versionFileName("payment-order-client-api-v2.yaml", createOpenApiWithVersion("2dada")),
+ "Version should be semver (or at least have a recognisable major version), but found '2dada'");
+
}
+ private void assertThrowsMojoExecutionExceptionWithMessage(Executable executable, String message) {
+ MojoExecutionException thrown = assertThrows(MojoExecutionException.class, executable);
+ assertTrue(thrown.getMessage().startsWith(message), "Expected message '" + message + "' but got '"
+ + thrown.getMessage() + "'");
+ }
private OpenAPI createOpenApiWithVersion(String version) {
OpenAPI openAPI = new OpenAPI();
diff --git a/boat-maven-plugin/src/test/java/com/backbase/oss/boat/radio/RadioMojoTests.java b/boat-maven-plugin/src/test/java/com/backbase/oss/boat/radio/RadioMojoTests.java
index ba1f95291..110aa35cb 100644
--- a/boat-maven-plugin/src/test/java/com/backbase/oss/boat/radio/RadioMojoTests.java
+++ b/boat-maven-plugin/src/test/java/com/backbase/oss/boat/radio/RadioMojoTests.java
@@ -379,8 +379,8 @@ void test_auth() {
mojo.setVersion(version);
mojo.setPortalKey(portalKey);
mojo.setSourceKey(sourceKey);
- mojo.setUsername(username);
- mojo.setPassword(password);
+ mojo.setBoatBayUsername(username);
+ mojo.setBoatBayPassword(password);
mojo.setSpecs(new SpecConfig[]{specConfig});
mojo.setBoatBayUrl(String.format("http://localhost:%s", mockBackEnd.getPort()));
@@ -521,7 +521,7 @@ public MockResponse dispatch(RecordedRequest request) {
@SneakyThrows
@Test
- void test_when_boat_bay_is_unavailable() {
+ void test_when_boat_bay_is_unavailable_and_failOnBoatBayError_is_true() {
final String portalKey = "example";
final String sourceKey = "pet-store-bom";
@@ -542,6 +542,7 @@ void test_when_boat_bay_is_unavailable() {
mojo.setVersion(version);
mojo.setPortalKey(portalKey);
mojo.setSourceKey(sourceKey);
+ mojo.setFailOnBoatBayErrorResponse(true);
mojo.setSpecs(new SpecConfig[]{specConfig});
//Set invalid domain
mojo.setBoatBayUrl(String.format("http://invalid-domain:%s", mockBackEnd.getPort()));
diff --git a/boat-quay/boat-quay-lint/pom.xml b/boat-quay/boat-quay-lint/pom.xml
index 057bd0859..5bdcbd90b 100644
--- a/boat-quay/boat-quay-lint/pom.xml
+++ b/boat-quay/boat-quay-lint/pom.xml
@@ -5,7 +5,7 @@
com.backbase.oss
boat-quay
- 0.15.0
+ 0.15.1-SNAPSHOT
boat-quay-lint
jar
diff --git a/boat-quay/boat-quay-rules/pom.xml b/boat-quay/boat-quay-rules/pom.xml
index f012789d8..c4b218516 100644
--- a/boat-quay/boat-quay-rules/pom.xml
+++ b/boat-quay/boat-quay-rules/pom.xml
@@ -5,7 +5,7 @@
com.backbase.oss
boat-quay
- 0.15.0
+ 0.15.1-SNAPSHOT
boat-quay-rules
jar
diff --git a/boat-quay/pom.xml b/boat-quay/pom.xml
index 2b41adcb0..b6837e318 100644
--- a/boat-quay/pom.xml
+++ b/boat-quay/pom.xml
@@ -5,7 +5,7 @@
com.backbase.oss
backbase-openapi-tools
- 0.15.0
+ 0.15.1-SNAPSHOT
diff --git a/boat-scaffold/pom.xml b/boat-scaffold/pom.xml
index 3dfbe4007..0cd8120a5 100644
--- a/boat-scaffold/pom.xml
+++ b/boat-scaffold/pom.xml
@@ -5,7 +5,7 @@
com.backbase.oss
backbase-openapi-tools
- 0.15.0
+ 0.15.1-SNAPSHOT
boat-scaffold
@@ -86,7 +86,7 @@
com.backbase.oss
boat-trail-resources
- 0.15.0
+ 0.15.1-SNAPSHOT
test
diff --git a/boat-terminal/pom.xml b/boat-terminal/pom.xml
index 1c9e078c2..c72d42230 100644
--- a/boat-terminal/pom.xml
+++ b/boat-terminal/pom.xml
@@ -5,7 +5,7 @@
com.backbase.oss
backbase-openapi-tools
- 0.15.0
+ 0.15.1-SNAPSHOT
boat-terminal
diff --git a/boat-trail-resources/pom.xml b/boat-trail-resources/pom.xml
index ee82e04c5..5df6f372e 100644
--- a/boat-trail-resources/pom.xml
+++ b/boat-trail-resources/pom.xml
@@ -5,7 +5,7 @@
com.backbase.oss
backbase-openapi-tools
- 0.15.0
+ 0.15.1-SNAPSHOT
boat-trail-resources
diff --git a/pom.xml b/pom.xml
index fa9ccb8ff..7d35b9598 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
com.backbase.oss
backbase-openapi-tools
- 0.15.0
+ 0.15.1-SNAPSHOT
pom
Backbase Open Api Tools will help you converting RAML to OpenAPI plus many more
diff --git a/tests/pom.xml b/tests/pom.xml
index 56a147a55..a0b226d35 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -5,7 +5,7 @@
com.backbase.oss
backbase-openapi-tools
- 0.15.0
+ 0.15.1-SNAPSHOT
tests