java – Error generating build in multi module project using gradle and spring boot

I have an issue when I do the goal build in Gradle. When I do “gradle run” it works good, but in the build it doesn’t work. I’m using shadowJar plugin, spring boot 1.5.5.RELEASE, gradle 6.8.2. This is a multi module project. I’ve tried for many ways but I haven’t got it. This is my error:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorizationFilter': Injection of persistence dependencies fail
ed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resourc
e [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.boot.ar
chive.spi.ArchiveException: Could not build ClassFile
        at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:357) ~[
bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) ~[bpop-digital-s
alaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[bpop-digital-sa
laryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[bpop-digital-sala
ryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSH
OT]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[bpop-digital-salaryloans-co
re.jar:1.0.2-SNAPSHOT]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT
]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:234) ~[bpop-digital-salary
loans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAsRegistrationBean(ServletContextInitializerBeans.java:182) ~[bpop-digital-salary
loans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAsRegistrationBean(ServletContextInitializerBeans.java:177) ~[bpop-digital-salary
loans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAdaptableBeans(ServletContextInitializerBeans.java:159) ~[bpop-digital-salaryloan
s-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:80) ~[bpop-digital-salaryloans-core.jar:1
.0.2-SNAPSHOT]
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getServletContextInitializerBeans(EmbeddedWebApplicationContext.java:241) ~[bpop
-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.selfInitialize(EmbeddedWebApplicationContext.java:228) ~[bpop-digital-salaryloan
s-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.access$000(EmbeddedWebApplicationContext.java:89) ~[bpop-digital-salaryloans-cor
e.jar:1.0.2-SNAPSHOT]
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext$1.onStartup(EmbeddedWebApplicationContext.java:213) ~[bpop-digital-salaryloans-c
ore.jar:1.0.2-SNAPSHOT]
        at org.springframework.boot.context.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:55) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5196) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_301]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_301]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_301]
        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_301]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/spring
framework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.boot.archive.spi.Arc
hiveException: Could not build ClassFile
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628) ~[bpop-digital
-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[bpop-digital-sa
laryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[bpop-digital-sala
ryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSH
OT]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[bpop-digital-salaryloans-co
re.jar:1.0.2-SNAPSHOT]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT
]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:220) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1018) ~[bpop-digital-salaryloans-c
ore.jar:1.0.2-SNAPSHOT]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:988) ~[bpop-digital-salaryloans-co
re.jar:1.0.2-SNAPSHOT]
        at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:5
79) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:546) ~[b
pop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcesso
r.java:707) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor
.java:680) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:169) ~[bpop-digital-salaryloans-core.jar:1.
0.2-SNAPSHOT]
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:354) ~[
bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        ... 25 common frames omitted
Caused by: org.hibernate.boot.archive.spi.ArchiveException: Could not build ClassFile
        at org.hibernate.boot.archive.scan.spi.ClassFileArchiveEntryHandler.toClassFile(ClassFileArchiveEntryHandler.java:64) ~[bpop-digital-salaryloans-core.jar:1
.0.2-SNAPSHOT]
        at org.hibernate.boot.archive.scan.spi.ClassFileArchiveEntryHandler.handleEntry(ClassFileArchiveEntryHandler.java:47) ~[bpop-digital-salaryloans-core.jar:1
.0.2-SNAPSHOT]
        at org.hibernate.boot.archive.internal.JarFileBasedArchiveDescriptor.visitArchive(JarFileBasedArchiveDescriptor.java:152) ~[bpop-digital-salaryloans-core.j
ar:1.0.2-SNAPSHOT]
        at org.hibernate.boot.archive.scan.spi.AbstractScannerImpl.scan(AbstractScannerImpl.java:47) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.hibernate.boot.model.process.internal.ScanningCoordinator.coordinateScan(ScanningCoordinator.java:75) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAP
SHOT]
        at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.prepare(MetadataBuildingProcess.java:98) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT
]
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:199) ~[bpop-digital-salaryloans-core.jar:1.0
.2-SNAPSHOT]
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:149) ~[bpop-digital-salaryloans-core.jar:1.0
.2-SNAPSHOT]
        at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:
54) ~[bpop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:360) ~[b
pop-digital-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:382) ~[bpop-digital-s
alaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:371) ~[bpop-digital-salaryloans-co
re.jar:1.0.2-SNAPSHOT]
        at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:336) ~[bpop-digital-sa
laryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687) ~[bpop-digi
tal-salaryloans-core.jar:1.0.2-SNAPSHOT]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624) ~[bpop-digital
-salaryloans-core.jar:1.0.2-SNAPSHOT]
        ... 40 common frames omitted

This is mi build.gradle:

apply from: "https://gradle.avaldigitallabs.com/resources/java-ms-project.gradle"
apply from: "https://gradle.avaldigitallabs.com/resources/static-code-analysis/spotless.gradle"


buildscript {
    ext {
        springBootVersion = '1.5.10.RELEASE'
    }
    repositories {
        jcenter()
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }

    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        classpath "io.franzbecker:gradle-lombok:${gradleLombokVersion}"
        classpath "io.spring.gradle:dependency-management-plugin:${springBootMangmentPluginVersion}"
        classpath "com.github.jengelman.gradle.plugins:shadow:6.1.0"
    }
}

gradle.startParameter.excludedTaskNames += "licenseMain"
gradle.startParameter.excludedTaskNames += "licenseTest"

apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "java"
apply plugin: "org.springframework.boot"
apply plugin: "io.spring.dependency-management"
apply plugin: "io.franzbecker.gradle-lombok"


allprojects {
    dependencies {
    }
}


subprojects {
    configurations {
        all*.exclude group: 'javassist', module: 'javassist'
        all*.exclude group: "co.adl.commons", module: "commons-logging"
    }
    dependencies {
        implementation 'com.amazonaws:aws-java-sdk-ssm:1.11.509'

        implementation  enforcedPlatform("org.springframework.cloud:spring-cloud-dependencies:Dalston.SR4")
        implementation  enforcedPlatform("org.springframework.boot:spring-boot-dependencies:1.5.10.RELEASE")
        implementation "org.springframework.boot:spring-boot-starter-tomcat"
        implementation "org.jacoco:org.jacoco.core:0.6.2.201302030002"
        implementation "org.springframework.cloud:spring-cloud-starter-config"
        implementation "org.springframework.boot:spring-boot-starter-actuator"

        implementation("org.springframework.boot:spring-boot-starter-web"){
            exclude module: "hibernate-validator"
        }
        implementation "org.springframework.boot:spring-boot-starter-security"
        implementation "org.springframework.boot:spring-boot-starter-data-jpa"
        implementation "mysql:mysql-connector-java:5.1.45"
        implementation "org.springframework.cloud:spring-cloud-starter-aws:2.1.1.RELEASE"
        implementation "org.springframework.cloud:spring-cloud-aws-autoconfigure:2.1.1.RELEASE"
        implementation "org.springframework.cloud:spring-cloud-aws-messaging:2.1.1.RELEASE"
        implementation "co.com.bancopopular.busicapa:bpop-digital-bc-common:0.1.447"
        implementation "co.com.bancopopular.busicapa:bpop-digital-bc-customers-api:0.1.447"
        implementation "co.com.bancopopular.busicapa:bpop-digital-bc-salary-loans-api:0.1.447"
        implementation "co.com.bancopopular.busicapa:bpop-digital-bc-ath-api:0.1.447"
        implementation "co.com.bancopopular.busicapa:bpop-digital-bc-experian-api:0.1.447"
        implementation "co.com.bancopopular.busicapa:bpop-digital-bc-cache:0.1.447"
        implementation "co.com.adl.busicapa:adl-digital-bc-inquiries-api:0.0.14"
        implementation "co.com.bancopopular.busicapa:bpop-digital-bc-offices-api:0.1.447"
        implementation "co.com.bancopopular.busicapa:bpop-digital-bc-payroll-checks-api:0.1.447"
        implementation "co.com.bancopopular.busicapa:bpop-digital-bc-notifications-api:0.1.447"
        implementation "co.com.bancopopular.busicapa:bpop-digital-bc-notifications-api:0.1.447"
        implementation "co.com.bancopopular:bpop-digital-risk-management-api:6.1.0"
        implementation "co.com.bancopopular:bpop-salaryloans-lib-risk-api:1.0.2"
        implementation "co.com.bancopopular:bpop-digital-payroll-payer-api:1.11.6"
        implementation "co.com.bancopopular:bpop-salaryloans-lib-payroll-payer-java-api:1.0.1"
        implementation "co.com.bancopopular:bpop-salaryloans-onbase-submittal-sdk:1.2.5"
        implementation "co.com.bpop.commons:bpop-commons-aml-risk-validate-api:1.1.10-RELEASE"
        implementation "co.com.bpop.commons:bpop-commons-aml-risk-validate-model:1.1.10-RELEASE"
        implementation "co.adl.commons:commons-client:${commonsVersion}"
        implementation "co.adl.commons:commons-transient-data:${commonsVersion}"
        implementation "co.com.adl.pb.commons:adl-pb-cipher-sdk:2.1.1"
        implementation "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
        implementation "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
        implementation "org.hamcrest:hamcrest-core:1.3"
        implementation "org.mockito:mockito-all:1.10.19"
        implementation "org.springframework:spring-test:4.3.8.RELEASE"
        implementation "org.apache.commons:commons-lang3:3.7"
        implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}"
        implementation "com.fasterxml.jackson.datatype:jackson-datatype-hibernate5:${jacksonVersion}"
        implementation "com.fasterxml.jackson.module:jackson-module-mrbean:${jacksonVersion}"
        implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
        implementation "com.fasterxml.jackson.core:jackson-databind:2.9.10.8"
        implementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
        implementation "org.springframework:spring-context:${springframeworkVersion}"
        implementation "org.springframework.integration:spring-integration-ftp:${springframeworkVersion}"
        implementation "com.squareup.okhttp3:mockwebserver:3.10.0"
        implementation "com.squareup.okhttp3:okhttp:3.10.0"
        implementation "com.squareup.okhttp3:logging-interceptor:3.8.0"
        implementation "co.com.bancopopular:bpop-digital-bank-insurances-api:1.2.0"
        implementation "org.functionaljava:functionaljava:4.7"
        implementation "com.github.tomakehurst:wiremock-standalone:2.14.0"
        implementation "joda-time:joda-time:2.9.9"
        implementation "com.google.code.gson:gson:2.8.2"
        implementation "com.squareup.retrofit2:retrofit:2.5.0"
        implementation "com.squareup.retrofit2:converter-gson:2.5.0"
        implementation "commons-beanutils:commons-beanutils:1.9.3"
        implementation "de.siegmar:fastcsv:1.0.2"
        implementation "org.apache.pdfbox:pdfbox:2.0.9"
        implementation "net.sf.jasperreports:jasperreports:6.6.0"
        implementation "net.sourceforge.barbecue:barbecue:1.5-beta1"
        implementation "com.lowagie:itext:2.1.7"
        implementation "co.com.bancopopular:bpop-digital-brms-api:1.1.1"
        implementation "co.com.bancopopular:bpop-salaryloans-lib-business-rules-api:1.1.3"
        implementation "co.com.bancopopular:bpop-digital-security-manager-api:2.6.7"
        implementation "co.adl:parameter-store-manager:1.1.0"
        implementation "com.amazonaws:aws-java-sdk-sqs:1.11.508"
        implementation "com.amazonaws:aws-java-sdk-lambda:1.11.771"
        implementation "com.amazonaws:aws-lambda-java-core:1.2.0"
        implementation ("com.amazonaws:aws-java-sdk-core:1.11.509"){
            force = true
        }
        implementation "com.amazonaws:aws-java-sdk-dynamodb:1.11.821"
        implementation "co.com.bancopopular:bpop-digital-audit-manager-api:1.1.22"
        implementation "io.opentracing:opentracing-api:0.31.0"
        implementation "io.opentracing:opentracing-util:0.31.0"
        implementation "com.datadoghq:dd-trace-ot:0.31.0"
        implementation "co.com.bpop.commons:bpop-commons-customer-retrieve-api:2.1.1-RELEASE"
        implementation "co.com.bpop.commons:bpop-commons-customer-retrieve-model:2.1.1-RELEASE"
        implementation "co.com.bpop.commons:bpop-commons-retrofit:2.0.4-RELEASE"
        implementation "org.codehaus.sonar.plugins:sonar-jacoco-plugin:3.2.1"
        implementation "com.zaxxer:HikariCP:2.6.3"
        implementation ("co.com.bpop.commons:bpop-commons-catalogs-api:0.0.11-RELEASE"){
            exclude group: "mysql", module: "mysql-connector-java"
        }
        implementation "co.com.bpop.commons:bpop-commons-catalogs-model:0.0.11-RELEASE"
        implementation "co.com.bpop.commons:bpop-commons-customer-save-api:1.0.14-SNAPSHOT"
        implementation "co.com.bpop.commons:bpop-commons-customer-save-model:1.0.14-SNAPSHOT"
        implementation "co.com.bpop.commons:bpop-commons-exceptions:1.0.4-RELEASE"
        implementation "co.com.bpop.commons:bpop-commons-email-api:1.0.0-RELEASE"
        implementation "co.com.bpop.commons:bpop-commons-email-model:1.0.0-RELEASE"
        implementation "org.springframework.cloud:spring-cloud-starter-openfeign:1.4.7.RELEASE"
        implementation "io.github.openfeign.form:feign-form:3.4.1"
        implementation "com.google.code.bean-matchers:bean-matchers:0.13"
        implementation "com.avaldigitallabs.lib:bpop-salaryloans-lib-simulators-api-client:1.0.3"
        compileOnly("org.projectlombok:lombok:${lombokVersion}"){
            force= true
        }
        annotationProcessor("org.projectlombok:lombok:${lombokVersion}"){
            force= true
        }
        implementation ('org.mapstruct:mapstruct-jdk8:1.2.0.Final'){
                force = true
        }
        annotationProcessor 'org.mapstruct:mapstruct-processor:1.2.0.Final'

        testCompileOnly 'org.projectlombok:lombok:1.18.24'
        testAnnotationProcessor 'org.projectlombok:lombok:1.18.24'
        implementation "org.togglz:togglz-servlet:2.6.1.Final"
        implementation 'org.apache.maven.plugins:maven-shade-plugin:3.2.1'

        implementation "org.togglz:togglz-spring-boot-starter:2.6.1.Final"
        implementation "org.togglz:togglz-spring-web:2.6.1.Final"
        implementation "org.togglz:togglz-console:2.6.1.Final"
        implementation "io.springfox:springfox-swagger2:2.5.0"
        implementation "io.springfox:springfox-swagger-ui:2.5.0"
        testImplementation "org.springframework.boot:spring-boot-starter-test"
        testImplementation "org.mockito:mockito-core:2.0.5-beta"
        testImplementation "org.powermock:powermock-api-mockito:1.6.2"
        testImplementation "org.powermock:powermock-module-junit4:1.6.2"
        testCompile("junit:junit:$junitVersion")
        testImplementation 'junit:junit:4.12'

        compile group: "org.togglz", name: "togglz-core", version: "2.6.1.Final"

    }

    spotless {
        java {
            target project.fileTree(project.rootDir) {
                include '**/*.java'
                exclude '**/build/generated/**/*.*'
            }
        }
    }
}

dependencies {
    compile project(path: ":bpop-digital-sl-starter")
}

jar {
    enabled false
}

import com.github.jengelman.gradle.plugins.shadow.transformers.*

build.dependsOn(shadowJar);

shadowJar {

    archiveName = "${project.name}.jar"
    classifier="deploy"
    zip64 true
    mergeServiceFiles()
    exclude "META-INF/*.SF"
    exclude "META-INF/*.DSA"
    exclude "META-INF/*.RSA"
    exclude "META-INF/LICENSE"
    transform(PropertiesFileTransformer) {
        paths = ['META-INF/spring.factories' ]
        mergeStrategy = "append"
    }
    //transform(Log4j2PluginsCacheFileTransformer)

    manifest {
        attributes(
                'Main-Class': "com.bpop.digital.sl.starter.App"
        )
    }

}


processResources {
    with copySpec {
        from "LICENSE.txt"
    }
}

jacocoTestCoverageVerification {
    violationRules {
        rule {
            element = "CLASS"
            limit {
                counter = "LINE"
                value = "COVEREDRATIO"
                minimum = 0.0
            }
            excludes = [
                    "com.avaldigitallabs.ms.models.*",
            ]
        }
    }
}

dependencyManagement {
    imports {
        mavenBom("org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}")
    }
}

springBoot {
    mainClass = "${mainClass}"
}

sonarqube {
    properties {
        property "sonar.projectName", "$project.name"
        property "sonar.projectKey", "$project.name"
        property "sonar.host.url", System.getenv("SONAR_URL")
        property "sonar.login", System.getenv("SONAR_TOKEN")
        property "sonar.exclusions", "src/main/java/co/com/bancopopular/datatransferobjects/**/*," +
                "src/main/java/co/com/bancopopular/domain/**/*," +
                "**/*DTO.java," +
                "**/*Request.java," +
                "**/*Response.java," +
                "**/*Enum.java," +
                "src/main/java/com/bpop/digital/sl/starter/config/**/*," +
                "src/main/java/co/com/bancopopular/client/jersey/**/*," +
                "**/*Exception.java," +
                "src/main/java/com/bpop/digital/sl/starter/datasource/**/*" +
                "src/main/java/co/com/bancopopular/starter/**/*"
    }
}

And this is my gradle.properties:

group=com.avaldigitallabs.ms
version=1.0.2-SNAPSHOT
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondeman=true
org.gradle.jvmargs=-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError
org.gradle.caching=true
mainClass=com.bpop.digital.sl.starter.App
#----------------JAVA PROPERTIES--------------------------------------
javaVersion=1.8
#------------------Dependencies version ----------------------------------
springBootVersion=1.5.10.RELEASE
springBootMangmentPluginVersion=1.0.4.RELEASE

lombokVersion=1.18.14
gradleLombokVersion=3.2.0
jacksonVersion=2.12.1
tomcatEmbedCoreVersion=10.0.2
assertjCoreVersion=3.19.0
junitVersion=4.12
#------------------Plugins Version ------------------------------------
cpdPlugin=1.2
spotlessPlugin=3.23.0
sonarPlugin=2.7.1
#------------------
# CHECKSTYLE PROPERTIES --------------------------------------------
#Change version checkstyle tool, the value by default is : 8.20
#checkstyleVersion=8.20
#Change max cout erros for checkstyle tool, the value by default is : 50
#checkstyle.maxErrors=50
#Change ignoreFailures properties for checkstyle tool, the value by default is : true
#checkstyle.ignoreFailures=true
#Change showViolations properties for checkstyle tool, the value by default is : true
#checkstyle.showViolations=true
#Enable checkstyle run with build task, by default is : false
#checkstyle.build.enable=false
#checkstyle.ruleset=/pmdTest/google_checks.xml
#------------------ PMD PROPERTIES ---------------------------------------------------
#pmdVersion=6.14.0
#pmd.ignoreFailures=true
#pmd.build.enable=false
#pmd.ruleset=pmdTest/pmd.xml
#------------------ FINDBUGS PROPERTIES ----------------------------------------------
#findbugsVersion=3.0.1
#findbugs.reportLevel=medium
#findbugs.ignoreFailures=true
#findbugs.showProgress=true
#findbugs.effort=max
#findbugs.build.enable=false
#findbugs.ruleset
#------------------ CPD PROPERTIES ----------------------------------------------
#cpd.ignoreFailures=
#cpd.minimumTokenCount
#cpd.ignoreAnnotations
#------------------ Jacoco PROPERTIES ----------------------------------------------
#jacoco.package.excluide=com.avaldigitallabs.ms.models.*,com.avaldigitallabs.ms.config.*
#jacocoVersion
jacoco.limit.coverage=0.1
spring.bootVersion=1.5.10.RELEASE
#jacksonVersion=2.9.10
springframeworkVersion=4.3.12.RELEASE
maven.jar.pluginVersion=3.0.2
springCloudVersion=Dalston.SR4
business-capabilitiesVersion=0.1.447
adl.business-capabilitiesVersion=0.0.14
commonsVersion=0.0.37

Leave a Comment