How do you set the maven artifact ID of a gradle project?

后端 未结 7 714
甜味超标
甜味超标 2021-01-30 03:48

From the gradle maven-publish plugin\'s documentation, it\'s clear that you set the groupId and version of the project directly in build.gradle

7条回答
  •  没有蜡笔的小新
    2021-01-30 04:31

    Related to the root settings.gradle file, you can change the name of the root project with:

    rootProject.name = 'myproject'
    

    But if you want to change the name of a sub-project (for example, the default "app" sub-project of an AndroidStudio project), you can do something like this, still in the root settings.gradle file:

    rootProject.children.each {
        it.name = ('app' == it.name ? 'MyAppName' : it.name)
    }
    

提交回复
热议问题