This message was deleted.
# dependency-management
s
This message was deleted.
👍 4
2
🤷 2
g
It seems that it generates convention plugins but doesn't apply them, at least in multi-module java-library project. Also 8.1-rc-1 asks for java version but doesn't use it (i.e. for selecting toolchain)
Also 8.1-rc-1 asks for java version but doesn't use it (i.e. for selecting toolchain)
True for generated convention plugin but not for a build without it. Generated with
gradle init --dsl kotlin --type java-library --test-framework junit-jupiter --package org.acme --project-name t --split-project --incubating
Copy code
➜ cat lib/build.gradle.kts 
/*
 * This file was generated by the Gradle 'init' task.
 *
 * This project uses @Incubating APIs which are subject to change.
 */

plugins {
    // Apply the java-library plugin for API and implementation separation.
    `java-library`
}

dependencies {
    // This dependency is exported to consumers, that is to say found on their compile classpath.
    api("org.apache.commons:commons-math3:3.6.1")

    // This dependency is used internally, and not exposed to consumers on their own compile classpath.
    implementation("com.google.guava:guava:31.1-jre")
}
Copy code
➜ cat build-logic/src/main/kotlin/org.acme.java-common-conventions.gradle.kts 
/*
 * This file was generated by the Gradle 'init' task.
 *
 * This project uses @Incubating APIs which are subject to change.
 */

plugins {
    // Apply the java Plugin to add support for Java.
    java
}

repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
}

dependencies {
    constraints {
        // Define dependency versions as constraints
        implementation("org.apache.commons:commons-text:1.10.0")
    }
}

testing {
    suites {
        // Configure the built-in test suite
        val test by getting(JvmTestSuite::class) {
            // Use JUnit Jupiter test framework
            useJUnitJupiter("5.9.1")
        }
    }
}
k
generates convention plugins but doesn't apply them
That's weird... mine clearly applied them. I got the linkedlist template where it created a utilities and list module....it never generated a lib module like yours did. Maybe a bug in the 8.1 template?
g
8.0.2 generates very similar project, just without selecting a toolchain. Maybe you use different dsl or project type?
Tried just that, with
--type java-application
it applies convention plugins
👍 1
k
I used kotlin dsl...ahh..and also an application. It looks like you chose java-library so there might be a bug in that template.
g
Hope it will land somewhere in the future https://github.com/gradle/gradle/issues/14599#issuecomment-1484160633 (link to couple of PRs to fix the issues above)
thank you 1
🎉 1