了解一下:一款好用的 Maven Library 发布插件

简介: > GitHub: [gradle-publish-plugin](https://github.com/81813780/gradle-publish-plugin) ### Gradle Publish Plugin A flex gradle plugin for publish your library to maven repository become easy. !

GitHub: gradle-publish-plugin

Gradle Publish Plugin

A flex gradle plugin for publish your library to maven repository become easy.

gradle-publish-plugin.png

Feature

  • support publish multi-library, such as Java、Android、Kotlin
  • support for api / implementation dependencies in new Gradle
  • supports also @aar and transitive: false.
  • generate Kotlin doc with dokka
  • support upload sources Jar (configurable, default true)
  • sign a library including sources, Javadoc, and a customized POM (configurable, default false, and require Gradle Version >= 4.8)

Usage

for Gradle version >= 2.1:

    plugins {
      id "com.whl.gradle-publish-plugin" version "0.1.16-SNAPSHOT"
    }

for Gradle version < 2.1 or where dynamic configuration is required:

    buildscript {
      repositories {
        maven {
          url "https://plugins.gradle.org/m2/"
        }
      }
      dependencies {
        classpath "com.whl:gradle-publish-plugin:0.1.16-SNAPSHOT"
      }
    }

    apply plugin: "com.whl.gradle-publish-plugin"

Also see it in Gradle plugins

"com.whl.gradle-publish-plugin" should be after apply "java-library" or "com.android.library"

then, configuration in your build.gradle,such as:

simple example:

    group 'com.example'
    version '1.0-SNAPSHOT'

    gradlePublish {

        releaseRepository {
            url = "http://your repository.com/nexus/content/repositories/releases"
            userName = "your release account"
            password = "your release account"
        }

    }

complete example:

    group 'com.example'
    version '1.0-SNAPSHOT'

    gradlePublish {

        sourceJarEnabled = true
        javaDocEnabled = true
        signEnabled = false

        releaseRepository {
            url = "http://your repository.com/nexus/content/repositories/releases"
            userName = "your release account"
            password = "your release account"
        }

        snapshotRepository {
            url = "http://your repository.com/nexus/content/repositories/snapshots"
            userName = "your snapshot account"
            password = "your snapshot account"
        }

    }

last, execute ./gradlew publish task to publish your library to specified maven repository

目录
相关文章
|
7月前
|
Java 应用服务中间件 Apache
Maven程序 tomcat插件安装与web工程启动
Maven程序 tomcat插件安装与web工程启动
82 0
|
26天前
|
缓存 Java Maven
【简单四步教你解决♥十分有效】Maven依赖报错、依赖或插件导入失败的万能解决办法
【简单四步教你解决♥十分有效】Maven依赖报错、依赖或插件导入失败的万能解决办法!在处理Maven项目问题时,首先检查Maven配置是否正确。接着通过“File--Invalidata Caches”清除IDEA缓存并重启。使用Maven命令`mvn dependency:purge-local-repository`和`mvn dependency:resolve`清除本地依赖缓存。最后,在Terminal中输入`mvn clean install`完成构建。
【简单四步教你解决♥十分有效】Maven依赖报错、依赖或插件导入失败的万能解决办法
|
25天前
|
存储 Java Linux
【Maven】——基础入门,插件安装、配置和简单使用,Maven如何设置国内源
Maven插件安装,Maven项目构建,依赖管理,Haven Help插件,Maven仓库,Maven如何设置国内源
|
6月前
|
XML Java Maven
maven总结三: 常用插件
maven总结三: 常用插件
67 3
|
6月前
|
Java 测试技术 Maven
Maven 插件
Maven包含clean、default(build)、site三大生命周期,分别处理项目清理、部署和文档创建。每个生命周期由多个阶段组成,充当标准化接口,实际工作由插件执行。例如,`mvn clean`调用的是clean生命周期的clean阶段,其实现由maven-clean-plugin插件完成。Maven是一个依赖插件的框架,插件负责任务如生成jar/war、编译、测试、文档和报告。通过`mvn plugin-name:goal-name`命令执行插件目标。
|
3月前
|
Java 编译器 测试技术
全面理解Maven Compiler Plugin-Maven编译插件
【10月更文挑战第16天】
670 1
|
5月前
|
Java Maven Spring
Maven重打包问题之maven-shade-plugin插件对于重复的class文件会如何处理
Maven重打包问题之maven-shade-plugin插件对于重复的class文件会如何处理
117 2
|
6月前
|
Java Maven
idea安装并使用maven依赖分析插件:Maven Helper
idea安装并使用maven依赖分析插件:Maven Helper
2776 7
|
5月前
|
Java jenkins 持续交付
jenkins学习笔记之十七:使用插件及maven上传制品到nexus
jenkins学习笔记之十七:使用插件及maven上传制品到nexus
|
6月前
|
数据可视化 Java 程序员
IDEA插件-Maven Helper
Maven Helper是一个用于Apache Maven项目的IntelliJ IDEA插件,它提供了一些有用的功能来帮助开发人员更好地管理和调试Maven项目。
860 0