j

    Joe

    3 years ago
    I'm build a kotlin library and when I run build with
    ./gradlew build
    , it creates the jar file, but not when I use
    Build Project
    or
    Build Module
    in Intellij. How do I get those commands to have the same output?
    v

    Vladyslav Sitalo

    3 years ago
    you can approach this from multiple directions. some options would be : • run the gradle build/jar task via intellij instead of doing
    Build Project
    • configure the
    Build project
    target to have the jar output artifacts (see intellij build/run settings) • delegate building of the project from intellij to gradle, and make the default target build jar • or if you don’t care about jar and only care about sameness - you can change your build.gradle to not produce jar by default
    j

    Joe

    3 years ago
    Option three is the one I think I want, but how do I do that? I've checked that box in Settings | Build... | Build tools | Gradle | Runner, but unfortunately that doesn't seem to have done the job. 😞
    Oh wait, maybe it's the "make the default target build jar" that I'm missing. Where do I set that?
    gildor

    gildor

    3 years ago
    Did you enable “Delegate IDE build/run actions to Gradle”?
    j

    Joe

    3 years ago
    I did