diff --git a/pom.xml b/pom.xml
index 8410f415..5d219b4e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -75,6 +75,12 @@
guice
6.0.0
+
+
+ javax.ws.rs
+ javax.ws.rs-api
+ 2.1.1
+
org.apache.maven
maven-plugin-api
diff --git a/src/main/java/ch/ivyteam/ivy/maven/compile/ValidateProjectMojo.java b/src/main/java/ch/ivyteam/ivy/maven/compile/ValidateProjectMojo.java
index 6bf65053..941a06b9 100644
--- a/src/main/java/ch/ivyteam/ivy/maven/compile/ValidateProjectMojo.java
+++ b/src/main/java/ch/ivyteam/ivy/maven/compile/ValidateProjectMojo.java
@@ -17,8 +17,10 @@
import ch.ivyteam.ivy.project.validation.ProjectValidator;
import ch.ivyteam.ivy.project.validation.ProjectValidatorContext;
import ch.ivyteam.ivy.project.validation.ProjectValidatorResult.Message;
+import ch.ivyteam.ivy.rest.client.config.impl.RestClientProjectValidator;
import ch.ivyteam.ivy.role.impl.RoleProjectValidator;
import ch.ivyteam.ivy.user.impl.UserProjectValidator;
+import ch.ivyteam.ivy.vars.impl.VariableProjectValidator;
import ch.ivyteam.ivy.webservice.datamodel.impl.WebServiceClientProjectValidator;
/**
@@ -67,7 +69,9 @@ private List validators() {
return List.of(
new UserProjectValidator(),
new RoleProjectValidator(),
- new WebServiceClientProjectValidator());
+ new WebServiceClientProjectValidator(),
+ new VariableProjectValidator(),
+ new RestClientProjectValidator());
}
private void log(Message message) {
@@ -93,7 +97,7 @@ private ContextBuilder(MavenProject project, MavenSession session) {
}
private ProjectValidatorContext build() {
- return ProjectValidatorContext.create(toProject(), toAllProjects());
+ return ProjectValidatorContext.create().project(toProject()).allProjects(toAllProjects()).toContext();
}
private Project toProject() {
diff --git a/src/test/java/ch/ivyteam/ivy/maven/compile/TestValidateProjectMojo.java b/src/test/java/ch/ivyteam/ivy/maven/compile/TestValidateProjectMojo.java
index 1cd2e58a..d866c559 100644
--- a/src/test/java/ch/ivyteam/ivy/maven/compile/TestValidateProjectMojo.java
+++ b/src/test/java/ch/ivyteam/ivy/maven/compile/TestValidateProjectMojo.java
@@ -60,14 +60,34 @@ void validate() throws IOException {
""";
Files.writeString(file, content);
+ file = dir.resolve("rest-clients.yaml");
+ content = """
+ RestClients:
+ test name:
+ Name: Test
+ test.name:
+ Name: Another
+ """;
+ Files.writeString(file, content);
+
+ file = dir.resolve("variables.yaml");
+ content = """
+ Variables:
+ Test: Something
+ Test: Something else
+ """;
+ Files.writeString(file, content);
var log = new LogCollector();
mojo.setLog(log);
mojo.execute();
assertThat(log.getWarnings().toString())
.contains("config/users.yaml: User 'Alex' is configured to have role 'Gangster' which is not defined.")
.contains("config/webservice-clients.yaml: The web service client key 'test.name' should be sanitized to 'testname' to avoid potential issues. Use the name for a better readability.")
- .contains("config/webservice-clients.yaml: The web service client key 'test name' should be sanitized to 'test-name' to avoid potential issues. Use the name for a better readability.");
+ .contains("config/webservice-clients.yaml: The web service client key 'test name' should be sanitized to 'test-name' to avoid potential issues. Use the name for a better readability.")
+ .contains("config/rest-clients.yaml: The rest client key 'test.name' should be sanitized to 'testname' to avoid potential issues. Use the name for a better readability.")
+ .contains("config/rest-clients.yaml: The rest client key 'test name' should be sanitized to 'test-name' to avoid potential issues. Use the name for a better readability.");
assertThat(log.getErrors().toString())
- .contains("config/roles.yaml: Role 'HR Manager' has an unknown parent 'Manager'.");
+ .contains("config/roles.yaml: Role 'HR Manager' has an unknown parent 'Manager'.")
+ .contains("config/variables.yaml: Variable 'Test' is defined multiple times in variables.yaml.");
}
}