Hello Developers
I am with the following situation, I have project working with multi-modules based on Gradle
in module-domain
I have the following:
@Entity
@Table(name="person")
@DateDeath(groups={PersonDeathCheck.class})
public class Person implements Serializable {
See that Person
class uses or depends on DateDeath
annotation
Now, in the module-validation
I have
@Target({TYPE})
@Retention(RUNTIME)
@Constraint(validatedBy=DateDeathValidator.class)
public @interface DateDeath {
Here DateDeath
depends on DateDeathValidator
class, where DateDeathValidator
is:
public class DateDeathValidator implements ConstraintValidator<DateDeath, Person>{
Therefore observe DateDeathValidator
depends or uses:
-
DateDeath
class and it is located in the same module:module-validation
-
Person
class and it is located in a different module:module-domain
Here we have circular reference between these projects.
project(':web-27-domain') {
description 'domain'
dependencies {
compile project(':web-27-validation')
}
}
project(':web-27-validation') {
description 'Validation'
dependencies {
compile project(':web-27-domain')
}
}
Exists a way to break in someway this circular reference? I want avoid merge the code from web-27-validation
into web-27-domain
(it is my worst scenario)
Thanks in advance.