how-to-publish-jar-lib

使用gradle 发布 java 类库

  • 使用 maven 插件
1
apply plugin: 'maven'
  • 上传nexus地址

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    uploadArchives {
    repositories {
    mavenDeployer {
    repository(url: "http://{ip:port}/repository/maven-snapshots/") {
    authentication(userName: "user", password: "password")
    }
    pom.version = version
    pom.artifactId = project.name
    pom.groupId = 'com.ziggle.test'
    }
    }
    }
  • 运行 gradle uploadArchives

注意

jar包的命名影响上传的仓库