1 编写构建gradle脚本代码
1.1 配置publication和repository
在指定moudle目录下新建名为"maven-publish.gradle"文件,其声明的publication和repository如下所示:
apply plugin: 'maven-publish'
// This creates a task called publishReleaseToMyRepoRepository that
// consists of the name of the publication and the name of the repository.
publishing {
publications {
release(MavenPublication) {
groupId =