How to publish source into local maven repository with Gradle?

后端 未结 3 1039
-上瘾入骨i
-上瘾入骨i 2020-12-18 04:35

I am developing two related project. One of which is \"helper\" one and another is \"main\" one. I am constantly updating \"main\", but from time to time I am also updating

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-18 05:26

    I believe a cleaner and more concise solution for this is to use the maven-plugin, it provides the install task which matches Maven's install task. Update your build.gradle to include the following:

    apply plugin: 'maven'
    

    Then to publish (e.g. install) to Maven local repository, run: gradle install or ./gradlew install. See also this solution: Gradle alternate to mvn install

    Note: the current Gradle docs (as of v4.9) says the maven-plugin is the "Old Maven Plugin" (but it is not deprecated). https://docs.gradle.org/current/userguide/maven_plugin.html

    I think this is the simplest solution to this question at this time.

提交回复
热议问题