Gradle alternate to mvn install

后端 未结 4 1979
野趣味
野趣味 2020-11-29 17:33

I have 2 different project build on mvn. I am trying to replace to Gradle.

Project 1 is an SDK, and project 2 is using that sdk (example).

In the time of maven

4条回答
  •  没有蜡笔的小新
    2020-11-29 17:39

    You need to publish your own library to your local repository. You can do that in the following way:

    1. Add maven-publish plugin:

      plugins {
          // your other plugins come here...
          id 'maven-publish'
      }
      
    2. Add the publishing section to your build file:

      publishing {
          publications {
              myCoolLibrary(MavenPublication) {
                  from components.java
              }
          }
      }
      
    3. Run gradle build publishToMavenLocal

      Find more details in the documentation.

提交回复
热议问题