Skip to content

Improve documentation when to add the Spring Modulith Core artifact in compile scope #943

@hyeonseokhan

Description

@hyeonseokhan

I want to implement ApplicationModuleDetectionStrategy to change the base package. However, I am encountering a compilation error as shown below and am looking for a solution.

image

and gradle setting

plugins {
    id 'java'
    id 'org.springframework.boot' version '3.3.5'
    id 'io.spring.dependency-management' version '1.1.6'
}

group = 'com.toyproject'
version = '0.0.1'

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(17)
    }
}

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

ext {
    set('springModulithVersion', "1.2.4")
}


dependencies {
    implementation fileTree(dir: "./libs", includes: ["*.jar"])
    implementation 'com.google.code.gson:gson:2.11.0'
    implementation 'commons-codec:commons-codec:1.17.1'

    // Spring Web
    implementation 'org.springframework.boot:spring-boot-starter-web'

    implementation 'org.springframework.boot:spring-boot-starter-aop'

    annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'

    implementation 'org.springframework.boot:spring-boot-starter-validation'

    // Spring Modulith
    implementation 'org.springframework.modulith:spring-modulith-starter-core'

    implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'

    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.projectlombok:lombok'

    implementation 'com.zaxxer:HikariCP:5.0.1'
    implementation 'com.h2database:h2:2.2.220'

    implementation 'org.web3j:core:4.12.1'

    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'org.springframework.modulith:spring-modulith-starter-test'
    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

dependencyManagement {
    imports {
        mavenBom "org.springframework.modulith:spring-modulith-bom:${springModulithVersion}"
    }
}

tasks.named('test') {
    useJUnitPlatform()
}

image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions