Gradle doesn't see Kotlin dependency from mavenLocal

Multi tool use
Multi tool use












1















I'm trying to extract a part of my Kotlin Gradle project to a separate repository. It's a Kotlin multiplatform project (https://github.com/krzema12/fsynth) and I want to extract whatever sits in 'plotassert' package.



I followed https://kotlinlang.org/docs/tutorials/multiplatform-library.html. To test it locally, I published the newly extracted project to the local Maven repository by executing publishToMavenLocal Gradle's task, and then put mavenLocal() in the main project's repositories section (here, as the first item). In core project's dependencies (here) I put



compile "it.krzeminski.plotassert:PlotAssert:0.0.1"


The problem is that IntelliJ/Gradle don't see this dependency, also when trying to use some class from the code:



not visible



If I deliberately use some wrong dependency name, Gradle notices it:



wrong name



so it means that it somehow sees that the dependency exists in the local repo. I also see in ~/.m2/repository that the local publication produced some files:



:~/.m2/repository$ tree
.
└── it
└── krzeminski
└── plotassert
├── PlotAssert
│   ├── 0.0.1
│   │   ├── PlotAssert-0.0.1.module
│   │   └── PlotAssert-0.0.1.pom
│   └── maven-metadata-local.xml
├── PlotAssert-js
│   ├── 0.0.1
│   │   ├── PlotAssert-js-0.0.1.jar
│   │   ├── PlotAssert-js-0.0.1.module
│   │   ├── PlotAssert-js-0.0.1.pom
│   │   └── PlotAssert-js-0.0.1-sources.jar
│   └── maven-metadata-local.xml
├── PlotAssert-jvm
│   ├── 0.0.1
│   │   ├── PlotAssert-jvm-0.0.1.jar
│   │   ├── PlotAssert-jvm-0.0.1.module
│   │   ├── PlotAssert-jvm-0.0.1.pom
│   │   └── PlotAssert-jvm-0.0.1-sources.jar
│   └── maven-metadata-local.xml
├── PlotAssert-linux
│   ├── 0.0.1
│   │   ├── PlotAssert-linux-0.0.1.klib
│   │   ├── PlotAssert-linux-0.0.1.module
│   │   ├── PlotAssert-linux-0.0.1.pom
│   │   └── PlotAssert-linux-0.0.1-sources.jar
│   └── maven-metadata-local.xml
└── PlotAssert-metadata
├── 0.0.1
│   ├── PlotAssert-metadata-0.0.1.jar
│   ├── PlotAssert-metadata-0.0.1.module
│   ├── PlotAssert-metadata-0.0.1.pom
│   └── PlotAssert-metadata-0.0.1-sources.jar
└── maven-metadata-local.xml


Isn't this behavior of Gradle or IntelliJ incorrect? My understanding is that it should list this dependency under "Source Sets", like it did in case of the incorrect name.



I haven't tried yet to publish the newly extracted project to some online repo because I'd like to have a chance to iterate locally instead of publishing each change.



Could you give me a pointer what I'm missing here?










share|improve this question



























    1















    I'm trying to extract a part of my Kotlin Gradle project to a separate repository. It's a Kotlin multiplatform project (https://github.com/krzema12/fsynth) and I want to extract whatever sits in 'plotassert' package.



    I followed https://kotlinlang.org/docs/tutorials/multiplatform-library.html. To test it locally, I published the newly extracted project to the local Maven repository by executing publishToMavenLocal Gradle's task, and then put mavenLocal() in the main project's repositories section (here, as the first item). In core project's dependencies (here) I put



    compile "it.krzeminski.plotassert:PlotAssert:0.0.1"


    The problem is that IntelliJ/Gradle don't see this dependency, also when trying to use some class from the code:



    not visible



    If I deliberately use some wrong dependency name, Gradle notices it:



    wrong name



    so it means that it somehow sees that the dependency exists in the local repo. I also see in ~/.m2/repository that the local publication produced some files:



    :~/.m2/repository$ tree
    .
    └── it
    └── krzeminski
    └── plotassert
    ├── PlotAssert
    │   ├── 0.0.1
    │   │   ├── PlotAssert-0.0.1.module
    │   │   └── PlotAssert-0.0.1.pom
    │   └── maven-metadata-local.xml
    ├── PlotAssert-js
    │   ├── 0.0.1
    │   │   ├── PlotAssert-js-0.0.1.jar
    │   │   ├── PlotAssert-js-0.0.1.module
    │   │   ├── PlotAssert-js-0.0.1.pom
    │   │   └── PlotAssert-js-0.0.1-sources.jar
    │   └── maven-metadata-local.xml
    ├── PlotAssert-jvm
    │   ├── 0.0.1
    │   │   ├── PlotAssert-jvm-0.0.1.jar
    │   │   ├── PlotAssert-jvm-0.0.1.module
    │   │   ├── PlotAssert-jvm-0.0.1.pom
    │   │   └── PlotAssert-jvm-0.0.1-sources.jar
    │   └── maven-metadata-local.xml
    ├── PlotAssert-linux
    │   ├── 0.0.1
    │   │   ├── PlotAssert-linux-0.0.1.klib
    │   │   ├── PlotAssert-linux-0.0.1.module
    │   │   ├── PlotAssert-linux-0.0.1.pom
    │   │   └── PlotAssert-linux-0.0.1-sources.jar
    │   └── maven-metadata-local.xml
    └── PlotAssert-metadata
    ├── 0.0.1
    │   ├── PlotAssert-metadata-0.0.1.jar
    │   ├── PlotAssert-metadata-0.0.1.module
    │   ├── PlotAssert-metadata-0.0.1.pom
    │   └── PlotAssert-metadata-0.0.1-sources.jar
    └── maven-metadata-local.xml


    Isn't this behavior of Gradle or IntelliJ incorrect? My understanding is that it should list this dependency under "Source Sets", like it did in case of the incorrect name.



    I haven't tried yet to publish the newly extracted project to some online repo because I'd like to have a chance to iterate locally instead of publishing each change.



    Could you give me a pointer what I'm missing here?










    share|improve this question

























      1












      1








      1


      1






      I'm trying to extract a part of my Kotlin Gradle project to a separate repository. It's a Kotlin multiplatform project (https://github.com/krzema12/fsynth) and I want to extract whatever sits in 'plotassert' package.



      I followed https://kotlinlang.org/docs/tutorials/multiplatform-library.html. To test it locally, I published the newly extracted project to the local Maven repository by executing publishToMavenLocal Gradle's task, and then put mavenLocal() in the main project's repositories section (here, as the first item). In core project's dependencies (here) I put



      compile "it.krzeminski.plotassert:PlotAssert:0.0.1"


      The problem is that IntelliJ/Gradle don't see this dependency, also when trying to use some class from the code:



      not visible



      If I deliberately use some wrong dependency name, Gradle notices it:



      wrong name



      so it means that it somehow sees that the dependency exists in the local repo. I also see in ~/.m2/repository that the local publication produced some files:



      :~/.m2/repository$ tree
      .
      └── it
      └── krzeminski
      └── plotassert
      ├── PlotAssert
      │   ├── 0.0.1
      │   │   ├── PlotAssert-0.0.1.module
      │   │   └── PlotAssert-0.0.1.pom
      │   └── maven-metadata-local.xml
      ├── PlotAssert-js
      │   ├── 0.0.1
      │   │   ├── PlotAssert-js-0.0.1.jar
      │   │   ├── PlotAssert-js-0.0.1.module
      │   │   ├── PlotAssert-js-0.0.1.pom
      │   │   └── PlotAssert-js-0.0.1-sources.jar
      │   └── maven-metadata-local.xml
      ├── PlotAssert-jvm
      │   ├── 0.0.1
      │   │   ├── PlotAssert-jvm-0.0.1.jar
      │   │   ├── PlotAssert-jvm-0.0.1.module
      │   │   ├── PlotAssert-jvm-0.0.1.pom
      │   │   └── PlotAssert-jvm-0.0.1-sources.jar
      │   └── maven-metadata-local.xml
      ├── PlotAssert-linux
      │   ├── 0.0.1
      │   │   ├── PlotAssert-linux-0.0.1.klib
      │   │   ├── PlotAssert-linux-0.0.1.module
      │   │   ├── PlotAssert-linux-0.0.1.pom
      │   │   └── PlotAssert-linux-0.0.1-sources.jar
      │   └── maven-metadata-local.xml
      └── PlotAssert-metadata
      ├── 0.0.1
      │   ├── PlotAssert-metadata-0.0.1.jar
      │   ├── PlotAssert-metadata-0.0.1.module
      │   ├── PlotAssert-metadata-0.0.1.pom
      │   └── PlotAssert-metadata-0.0.1-sources.jar
      └── maven-metadata-local.xml


      Isn't this behavior of Gradle or IntelliJ incorrect? My understanding is that it should list this dependency under "Source Sets", like it did in case of the incorrect name.



      I haven't tried yet to publish the newly extracted project to some online repo because I'd like to have a chance to iterate locally instead of publishing each change.



      Could you give me a pointer what I'm missing here?










      share|improve this question














      I'm trying to extract a part of my Kotlin Gradle project to a separate repository. It's a Kotlin multiplatform project (https://github.com/krzema12/fsynth) and I want to extract whatever sits in 'plotassert' package.



      I followed https://kotlinlang.org/docs/tutorials/multiplatform-library.html. To test it locally, I published the newly extracted project to the local Maven repository by executing publishToMavenLocal Gradle's task, and then put mavenLocal() in the main project's repositories section (here, as the first item). In core project's dependencies (here) I put



      compile "it.krzeminski.plotassert:PlotAssert:0.0.1"


      The problem is that IntelliJ/Gradle don't see this dependency, also when trying to use some class from the code:



      not visible



      If I deliberately use some wrong dependency name, Gradle notices it:



      wrong name



      so it means that it somehow sees that the dependency exists in the local repo. I also see in ~/.m2/repository that the local publication produced some files:



      :~/.m2/repository$ tree
      .
      └── it
      └── krzeminski
      └── plotassert
      ├── PlotAssert
      │   ├── 0.0.1
      │   │   ├── PlotAssert-0.0.1.module
      │   │   └── PlotAssert-0.0.1.pom
      │   └── maven-metadata-local.xml
      ├── PlotAssert-js
      │   ├── 0.0.1
      │   │   ├── PlotAssert-js-0.0.1.jar
      │   │   ├── PlotAssert-js-0.0.1.module
      │   │   ├── PlotAssert-js-0.0.1.pom
      │   │   └── PlotAssert-js-0.0.1-sources.jar
      │   └── maven-metadata-local.xml
      ├── PlotAssert-jvm
      │   ├── 0.0.1
      │   │   ├── PlotAssert-jvm-0.0.1.jar
      │   │   ├── PlotAssert-jvm-0.0.1.module
      │   │   ├── PlotAssert-jvm-0.0.1.pom
      │   │   └── PlotAssert-jvm-0.0.1-sources.jar
      │   └── maven-metadata-local.xml
      ├── PlotAssert-linux
      │   ├── 0.0.1
      │   │   ├── PlotAssert-linux-0.0.1.klib
      │   │   ├── PlotAssert-linux-0.0.1.module
      │   │   ├── PlotAssert-linux-0.0.1.pom
      │   │   └── PlotAssert-linux-0.0.1-sources.jar
      │   └── maven-metadata-local.xml
      └── PlotAssert-metadata
      ├── 0.0.1
      │   ├── PlotAssert-metadata-0.0.1.jar
      │   ├── PlotAssert-metadata-0.0.1.module
      │   ├── PlotAssert-metadata-0.0.1.pom
      │   └── PlotAssert-metadata-0.0.1-sources.jar
      └── maven-metadata-local.xml


      Isn't this behavior of Gradle or IntelliJ incorrect? My understanding is that it should list this dependency under "Source Sets", like it did in case of the incorrect name.



      I haven't tried yet to publish the newly extracted project to some online repo because I'd like to have a chance to iterate locally instead of publishing each change.



      Could you give me a pointer what I'm missing here?







      maven gradle intellij-idea kotlin multiplatform






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 29 '18 at 21:11









      PiotrKPiotrK

      888825




      888825
























          1 Answer
          1






          active

          oldest

          votes


















          0














          It turned out that I had



          enableFeaturePreview('GRADLE_METADATA')


          in the library project, but didn't have it in the consumer project. Adding it and bumping Gradle wrapper version to 4.9 solved the issue.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53973367%2fgradle-doesnt-see-kotlin-dependency-from-mavenlocal%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            It turned out that I had



            enableFeaturePreview('GRADLE_METADATA')


            in the library project, but didn't have it in the consumer project. Adding it and bumping Gradle wrapper version to 4.9 solved the issue.






            share|improve this answer




























              0














              It turned out that I had



              enableFeaturePreview('GRADLE_METADATA')


              in the library project, but didn't have it in the consumer project. Adding it and bumping Gradle wrapper version to 4.9 solved the issue.






              share|improve this answer


























                0












                0








                0







                It turned out that I had



                enableFeaturePreview('GRADLE_METADATA')


                in the library project, but didn't have it in the consumer project. Adding it and bumping Gradle wrapper version to 4.9 solved the issue.






                share|improve this answer













                It turned out that I had



                enableFeaturePreview('GRADLE_METADATA')


                in the library project, but didn't have it in the consumer project. Adding it and bumping Gradle wrapper version to 4.9 solved the issue.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered yesterday









                PiotrKPiotrK

                888825




                888825






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53973367%2fgradle-doesnt-see-kotlin-dependency-from-mavenlocal%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    YRtRLXpbfheCaXpV8oShMU01Tfd,53iVsM8jQ4Vb 7f4 Nz 0qWLwyKoXWQB,ftjmL6,Oi7
                    RFY19u

                    Popular posts from this blog

                    Monofisismo

                    Angular Downloading a file using contenturl with Basic Authentication

                    Olmecas