Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Andy Wilkinson
    @wilkinsona
    The commit changed the plugin so that it ignored classifier-specific dependency management as there was a bug where it overrode the dependency management for the same dependency without a classifier
    As the plugin can't see the classifier during dependency resolution when it's setting the version, dependency management for io.netty:netty-tcnative will be applied to both a normal dependency and a classified dependency.
    Oleh Dokuka
    @OlegDokuka
    So, the question then, can I specify classifier at a place where the dependency is used without respecifying the version?
    Andy Wilkinson
    @wilkinsona
    Yes, I think so. Just omit the version
    Oleh Dokuka
    @OlegDokuka
    like io.netty:netty-tcnative::linux-x86_64
    Right?
    Andy Wilkinson
    @wilkinsona
    Yep
    Oleh Dokuka
    @OlegDokuka
    Sounds good
    let me check
    Oleh Dokuka
    @OlegDokuka
    yup
    it woks
    Thanks!
    I owe you!
    Andy Wilkinson
    @wilkinsona
    Great :D
    Behrang
    @behrangsa

    Had asked this on the Spring Boot channel -- I think this is the more appropriate channel to ask:

    Why do projects generated using https://start.spring.io/ contain both legacy and new styles of enabling plugins in build.gradle:

    plugins {
        id 'org.springframework.boot' version '2.1.6.RELEASE'
        id 'java'
    }
    
    apply plugin: 'io.spring.dependency-management'

    Is using the apply syntax for the io.spring.dependency-management plugin intentional?

    Andy Wilkinson
    @wilkinsona
    @behrangsa I've just answered in the Boot channel. https://gitter.im/spring-io/initializr would have been the ideal place to ask.
    Gradle 5 is supported, it's missing from the docs. Thanks for pointing it out.
    ndharrao
    @ndharrao
    do I have to follow certain sequence of repositories, apply plugin .. etc? Am receiving error Plugin with id 'org.springframework.boot' not found. This is how my apply plugin: 'org.springframework.boot' is.
    Andy Wilkinson
    @wilkinsona
    I don't see the connection between your question and the dependency management plugin, but the Gradle plugin portal has some examples of how to apply Boot's plugin: https://plugins.gradle.org/plugin/org.springframework.boot. You can find similar in Boot's docs or in a project generated from https://start.spring.io as well
    Grzegorz Gurgul
    @kboom
    Hi, I have two gradle projects A and B. Both have spring dependency management defined. I include B into A. Then it won't build at dependency management from B seems to be disregarded? How to fix that?
    Andy Wilkinson
    @wilkinsona
    @kboom I've answered on Stack Overflow. In short, it a Gradle limitation so you'll have to choose between using composite builds with Gradle's native bom support or using the dependency management plugin
    Grzegorz Gurgul
    @kboom
    Thank you for prompt reply! Tried this with java-platform and had some success though it still is not working as expected. I don't think it works if the included build is a multi-module project where one of them defines the dependencies (is gradle java-platform). While the included build works just fine when gradle is executed on it directly it fails to resolve some dependencies if a task is run on the project which includes this build.
    Grzegorz Gurgul
    @kboom
    Getting
    Could not resolve all dependencies for configuration ':infrastructure:compileClasspath'.
    Problems reading data from Binary store in /private/var/folders/c6/c153tzb94qg0f3ngg122rx400000gn/T/gradle7293996306659992196.bin offset 155234 exists? true
    Corrupt serialized resolution result. Cannot find selected module (128) for constraint apiElements -> x.y.z.libs:lib-logging-vertx:0.1.0-SNAPSHOT
    Gradle 6.4.1
    Grzegorz Gurgul
    @kboom
    Ok found it, don't use this plugin: https://github.com/jponge/vertx-gradle-plugin
    Doing naughty things - it's own dependency management plugin.
    Alper Kanat
    @tunix
    Hi! Is there a way to overwrite spring dependencies when it's used as a platform inside a java-platform? I'm unable to overwrite hazelcast with the following:
    apply plugin: "java-platform"
    
    javaPlatform {
        allowDependencies()
    }
    
    ext {
        elkVersion = "6.8.1"
        kafkaVersion = "2.2.0"
    }
    
    ext["commons-codec.version"] = "1.12"
    ext["hazelcast.version"] = "3.12.3"
    ext["spring-kafka.version"] = "1.3.6.RELEASE"
    ext["elasticsearch.version"] = "6.8.1"
    ext["janino.version"] = "3.0.8"
    ext["feign.version"] = "10.0.1"
    
    dependencies {
        constraints {
            api "commons-io:commons-io:2.6"
    
            api "org.apache.commons:commons-collections4:4.2"
            api "org.apache.commons:commons-csv:1.4"
            api "org.apache.commons:commons-lang3:3.4"
            api "org.apache.commons:commons-text:1.3"
            api "org.apache.commons:commons-configuration2:2.6"
    
            api "org.apache.kafka:kafka-streams:$kafkaVersion"
            api "org.apache.kafka:kafka-clients:$kafkaVersion"
    
            // all other 3rd party dependencies
            api "org.modelmapper:modelmapper:1.1.3"
            api "org.subethamail:subethasmtp:3.1.7"
            api "org.elasticsearch.client:elasticsearch-rest-high-level-client:$elkVersion"
        }
    
        api platform("org.springframework.boot:spring-boot-dependencies:1.5.21.RELEASE")
        api platform("org.springframework.cloud:spring-cloud-dependencies:Edgware.SR3")
    }
    Andy Wilkinson
    @wilkinsona
    Yes, it’s possible, but not by setting a version property as you have done above. That’s a feature of the dependency management plugin and there’s no direct equivalent in Gradle.
    adding some constraints for hazelcast’s modules, as you’ve done above for apache commons etc, should override the constraints in spring-boot-dependencies.
    Alper Kanat
    @tunix

    @wilkinsona - i got away with your suggestion, thanks! Now, I came across this: https://github.com/spring-projects/spring-boot/issues/3164#issuecomment-272240000

    I'm currently stuck with Spring Boot 1.5.x and cannot upgrade atm. I'm including above java-platform into this Spring Boot app. The java-platform BOM includes elasticsearch:6.8.1, spring-kafka:1.3.6 and some others. The problem is, the dependency management plugin overwrites those definitions. It includes elasticsearch:2.4.6 and spring-kafka:1.1.8 (i both see spring-kafka:1.1.8 and 1.3.6)

    I'm trying to achieve what you wrote in that github comment. Included the plugin with apply false and now I'm trying to understand how I should change build.gradle file to create an executable jar the boot plugin would automatically do
    Alper Kanat
    @tunix
    When I look the 2.3.0 docs, I see that the plugin has the same version with the corresponding boot version. Does that mean an incompatibility with Spring Boot 1.5.x (when dependencies are ignored)?
    Andy Wilkinson
    @wilkinsona
    Unfortunately, it won’t be straightforward to configure Boot 1.5’s tasks yourself rather than applying the plugin so it does it for you. 1.5’s end-of-life so it’s questionable that it’s worth spending the time to do it.
    Deep Hathi
    @deephathi
    Hi @wilkinsona ,
    I have gone through the documentation of this spring dependency management plugin. Found that there is bomProperties to override the properties of imported maven bom. However, I did not find anything which I can use to export properties section in the created maven pom from plugin.
    If you could guide me on how to export, properties block of maven bom from this plugin, then it will be of great help.
    What have tried mainly till now? I have used pom.withXml method to modify the bom, but does not seem to be working.
    Andy Wilkinson
    @wilkinsona
    @deephathi Sorry, I don't think I understand what you're trying to do. The plugin doesn't create a bom. It will add dependency management to the pom that's generate for a project using the plugin, but that's a regular pom rather than a bom.
    Deep Hathi
    @deephathi
    Thank you @wilkinsona for the clarification.
    TJ
    @tarunjain01
    There is a known issue of gradle6.2+ with spring boot where the publish task fails in sanity check. There are some solution available over the net but somehow none of them are working for bootWar task. Are we planning any fix for the same?
    1 reply
    nicu marasoiu
    @nmarasoiu
    Hi, for gradle 5, java 8, which version of the https://github.com/spring-gradle-plugins/dependency-management-plugin.git is the best to use? thank you
    1 reply
    Michael Lawrence
    @tonomonic
    Is there a way to disable applying dependency management for a specific configuration? I have a custom configuration to fetch a gzipped tar from a remote repository. I've configured it as an IvyRepository (even though it isn't and there is no associated metadata), and this seems to be causing issues with dependency management (NullPointerException in MavenPomResolver).
    2 replies
    Jesse
    @J-L-C

    Hello,

    I am running into an issue when building any project with -Dproject.version=1.101.0 as an argument and with spring dependency management included in the build.gradle file.

    build.gradle

    plugins {
        id 'org.springframework.boot' version '2.4.5'
        id 'io.spring.dependency-management' version '1.0.11.RELEASE'
        id 'java'
    }
    
    group = 'com.example'
    version = '0.0.1-SNAPSHOT'
    sourceCompatibility = '1.8'
    
    repositories {
        mavenCentral()
    }
    
    dependencies {
        implementation 'org.springframework.boot:spring-boot-starter-web'
        developmentOnly 'org.springframework.boot:spring-boot-devtools'
        testImplementation 'org.springframework.boot:spring-boot-starter-test'
    }
    
    //dependencyManagement {
    //    imports {
    //        mavenBom 'org.apache.logging.log4j:log4j-api'
    //    }
    //}
    
    test {
        useJUnitPlatform()
    }

    Build Command

    ./gradlew -Dproject.version=1.101.0 -Dorg.gradle.daemon=false clean build --refresh-dependencies --info

    This build fails with this exception.

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':compileJava'.
    > Could not resolve all files for configuration ':compileClasspath'.
       > Could not find org.apache.logging.log4j:log4j-api:1.101.0.
         Required by:
             project : > org.springframework.boot:spring-boot-starter-web:2.4.5 > org.springframework.boot:spring-boot-starter:2.4.5 > org.springframework.boot:spring-boot-starter-logging:2.4.5 > org.apache.logging.log4j:log4j-to-slf4j:2.13.3

    It looks like when resolving dependencies it is substituting project version in for log4j-api.

    Could not find org.apache.logging.log4j:log4j-api:1.101.0

    Is this expected behavior when using -Dproject.version as an argument? Is there a work around to override this behavior in order to complete the build?
    2 replies
    Thank you!
    ronipolus
    @ronipolus
    Hello! I am stuck trying to get gradle to mirror my nexus repository. Although when it tries to download kotlin-dsl it still looks in the Gradle Central Plugin Repository instead of the nexus repo I defined in the settings.gradle.kts.pluginManagement
    // settings.gradle.kts
    pluginManagement {
        repositories {
            maven { url = uri("https://localhost:8080/nexus/content/repositories/gradle-plugins/") }
        }
    }
    rootProject.name = "project"
    Any help would be appreciated. Thank you!
    Andy Wilkinson
    @wilkinsona
    @ronipolus What's the connection between your question and https://github.com/spring-gradle-plugins/dependency-management-plugin?
    ronipolus
    @ronipolus
    Sorry I posted it in the wrong chat. Apologies!