15:21:02 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.0:compile (default-compile) on project hsm-service: Compilation failure: Compilation failure:
15:21:02 [ERROR] /dcifent/JenkinsSlaves/ci1_Slave/workspace/DACA_MAIN/DACA_MAIN_Openshift_Build/src/main/java/com/dbs/dtip/hsm/controller/HsmController.java:[22,24] package javax.validation does not exist
Assistant
The error message:
code
User
Ok here is the next error.
15:33:47 [ERROR] /dcifent/JenkinsSlaves/ci1_Slave/workspace/DACA_MAIN/DACA_MAIN_Openshift_Build/src/main/java/com/dbs/dtip/hsm/entity/AddressMapping.java:[12,2] cannot find symbol
15:33:47 symbol: class Entity
15:33:47 [ERROR] /dcifent/JenkinsSlaves/ci1_Slave/workspace/DACA_MAIN/DACA_MAIN_Openshift_Build/src/main/java/com/dbs/dtip/hsm/entity/AddressMapping.java:[13,2] cannot find symbol
15:33:47 symbol: class Table
Assistant
The errors:
code
cannot find symbol
symbol: class Entity
cannot find symbol
symbol: class Table
mean that the compiler cannot locate the @Entity and @Table annotations. These annotations come from the Java Persistence API (JPA), typically:
[ERROR] /dcifent/JenkinsSlaves/ci1_Slave/workspace/DACA_MAIN/DACA_MAIN_Openshift_Build/src/main/java/com/dbs/dtip/hsm/controller/HsmController.java:[22,24] package javax.validation does not exist
indicates that the Java compiler cannot find the javax.validation package during compilation.
What this means:
Your code uses the javax.validation API (probably annotations like @Valid, @NotNull, etc.)
The compiler cannot find these validation classes in the classpath.
This typically happens if the dependency for the validation API is missing or not correctly configured.
How to fix
Add the validation API dependency
If you are using Maven, your pom.xml needs to include the Java Validation API as a dependency.
javax.validation is NOT part of JDK by default. It's part of Java EE or Jakarta EE.
If you use JDK 9+, javax.validation might not be included, and you need explicit dependencies.
Check if you use modules
If you are compiling with Java modules (module-info.java), make sure you have requires for the validation API module.
Force Maven to update
Sometimes Maven's cache is corrupted.
bash
mvn clean install -U
Summary
Add the validation-api dependency (and an implementation like Hibernate Validator) to your Maven project to resolve the missing javax.validation package reference at compile time.
If you want, I can help you add a minimal Maven dependency and configuration to fix this. Just ask!
(or if you are using Jakarta packages, it might be jakarta.persistence.Entity and jakarta.persistence.Table)
What this means
Your project is missing the JPA API dependency on the classpath. Without it, the compiler cannot resolve Entity and Table.
Adding only the API dependency usually suffices for compilation.
During runtime, you need an implementation such as Hibernate EntityManager or EclipseLink to actually persist entities. But for compilation, just the API is enough.
Summary steps
Add the JPA API dependency (javax.persistence-api or jakarta.persistence-api) to your pom.xml