Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when validating Model submodule, using custom BOM. #280

Closed
gabheadz opened this issue Jul 25, 2022 · 0 comments · Fixed by #296
Closed

Error when validating Model submodule, using custom BOM. #280

gabheadz opened this issue Jul 25, 2022 · 0 comments · Fixed by #296

Comments

@gabheadz
Copy link
Contributor

gabheadz commented Jul 25, 2022

Is your feature request related to a problem? Please describe.

There seems to be a compatibility issue with the plugin when using a custom BOM in our projects, as the ValidateStructureTask fails to complete successfully when validating the Model submodule throwing the following: CleanException("Model module is invalid")

After reviewing the code, I noticed that the policy for the Model, that asses no dependencies other than reactor-extra, reactor-core, spring-boot-dependencies, and a dependency called 'bom' is the one failing the verification.

public class ValidateStructureTask extends DefaultTask {
  
  // ...
  
  private boolean filterExcludedDependencies(Dependency dependency) {
    return !Arrays.asList(REACTOR_EXTRA, REACTOR_CORE, SPRING_DEPENDENCIES, AWS_BOM)
        .contains(dependency.getName());
  }

  // ...

}

This is due to our custom BOM, adding a dependency project-wide called "core-bom" to all submodules.

The purpose of this BOM is to govern a set of dependencies and it's allowed versions, in several microservices in different layers of our architecture.

Typically our developers would declare the BOM this way:

main.gradle

dependencies {
  // ...
  
  implementation(platform("my.bom.coordinates:core-bom:<version>"))
  annotationProcessor(platform("my.bom.coordinates:core-bom:<version>"))
  testAnnotationProcessor(platform("my.bom.coordinates:core-bom:<version>"))

  // ...
}

and the build.gradle for the model submodule still remains dependency free:

domain\model\build.gradle

dependencies {
  // empty
}

Describe the solution you'd like

For the Model validation, maybe provide a way to set/add a list of additional dependencies configurable, so users of the plugin can choose which dependencies whitelist in the validation step for the Model submodule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant