jeudi 13 août 2020

Include only certain classes from another module for tests in springboot - gradle multimodule project

I have the following multimodule structure:

ProjectRoot
   ProjectA
      src/main/java
      src/test/java
   ProjectB
      src/main/java
                   com/xyz/
                      services
                      entities/AbcEntity.java
                              /... 
      src/test/java

In ProjectA, ONLY for testing, I need *Entity files from ProjectB. How do I do that in Gradle dependency build.gradle?

The current build.gradle

     dependencies {
         testCompile(
           project(path: ':ProjectB')
         )
      }

Not the right one, I guess. Because, I will have to include all configs from ProjectB in ProjectA.

I just need *Entity.java files from ProjectB available for @SpringBootTest file in ProjectA

Aucun commentaire:

Enregistrer un commentaire