Giter Club home page Giter Club logo

gradle-maven-plugin's Introduction

Gradle Maven Plugin

This is a small "plugin" to simplify the use of maven-publish Gradle plugin. You can use this plugin for Java Library and Android Library.

Index

In order to use GradleMavenizer you have to add the line

apply from: 'https://raw.githubusercontent.com/sky-uk/gradle-maven-plugin/master/gradle-mavenizer.gradle'

at the very bottom of the build.gradle file. Alternatively, to use a specific release version, add this property to the project (see Releases at the top of the Github page for released versions):

mavPluginVersion = '1.0.3'

and add this line to the very bottom of the build.gradle file:

apply from: "https://raw.githubusercontent.com/sky-uk/gradle-maven-plugin/${project.mavPluginVersion}/gradle-mavenizer.gradle"`

GradleMavenizer is highly customizable.

You can customize it adding some properties to the root project build.gradle or to the module build.gradle file.

Attention: If you add the same property to the root project file and to the module file, in order of priority, the module file property will override the root project property.

  • mavProjectName -> String property -> Identify the project name (can be different from the artifactId)
  • mavLibraryDescription -> String property -> A simple description for the library
  • mavDevelopers -> Map property -> A map with the ids and the developer name of the library
  • mavLibraryLicenses -> Map property -> A map with the name and the urls of the library licenses
  • mavSiteUrl -> String property -> Identify the url of the project website
  • mavGitUrl -> String property ->Identify the url of the project github page
  • Remote repository:

    • mavPublishToRemoteRepo -> Boolean property -> Allow the script to load your library to a remote repo
    • mavRemoteRepoUser -> String property -> Username to grant access to the remote repo
    • mavRemoteRepoPassword -> String property -> Password to grant access to the remote repo
    • mavRepoRemoteUrl -> String property -> Identify the url of the remote repo
  • Internal repository:

    • mavPublishToInternalRepo -> Boolean property -> Allow the script to load your library to an internal repo
    • mavRepoInternalUrl -> String property -> Identify the url of the internal repo
  • MavenLocal repository:

    • mavPublishToMavenLocal -> Boolean property -> Allow the script to load your library to MavenLocal folder

Attention: If you won't set any repository automatically the script will use MavenLocal as default repo

project.ext {
    mavDevelopers = ["Fe":"Federico"]
    mavSiteUrl = "https://github.com/sky-uk/gradle-maven-plugin"
    mavGitUrl = mavSiteUrl + '.git'
    mavProjectName = 'GradleMavenizer'
    mavPublishToInternalRepo = true
    mavRepoInternalUrl = "path/to/internal/repo"
    mavLibraryLicenses = ["Apache-2.0":'http://www.apache.org/licenses/LICENSE-2.0.txt']
    mavLibraryDescription = "A simple description of the project"
}

To finally publish you library you can use the command ./gradlew publish directly from your project root folder.

You can also pass some properties directly from command line using the command -P (every property must have -P before), for example: ./gradlew publish -PmavPublishToMavenLocal=true

If you want to generate the POM file without publish your library you can use the command ./gradlew generatePomFileForMavenPublishPublication directly from your project root folder.

To generate the POM file only for one module of your library you can use the command ./gradlew your-module-name:generatePomFileForMavenPublishPublication where you have to replace your-module-name with the name you chose for your module.

Note: POM file will be saved in build/publications/mavenPublish/ as pom-default.xml

gradle-maven-plugin's People

Contributors

gotev avatar skymontif avatar sdiawara avatar cypherdare avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.