Coder Social home page Coder Social logo

gradle-git-repo's Introduction

git-repo

A gradle plugin that facilitates using a git repository as your maven repo, useful when you want to host private, internal maven artifacts, but a full blown repository manager is more than you nee.

Usage

Creating a repo

Create a git repo to house your artifacts. If you'd like, the snapshots and releases repositories can be different, or they can be subdirectories of the same repo.

You are welcome to use your git repository's built in access controls, but note that the git-repo plugin only works with ssh urls.

Note: git-repo won't work with private repos until Gradle pull request 386 is merged.

Deploying

Add the plugin as a buildscript dependency, then apply the plugin.

buildscript {
	repositories {
		mavenCentral()
	}
	dependencies {
		classpath 'com.ryanharter.gradle-git-repo:gradle-plugin:1.0.1'
	}
}

apply plugin: 'git-repo'

Then you simply configure the maven uploadArchives as you normally would, but provide a git url for the repositories.

uploadArchives {
	repositories {
		mavenDeployer {
			repository(url: '[email protected]:rharter/maven-repo.git/releases')
			snapshotRepository(url: '[email protected]/rharter/maven-repo.git/snapshots')

            // standard pom settings
		}
	}
}

Now when you run ./gradlew uploadArchives your artifacts will be added to your git repository and pushed.

Consuming

In the project in which you want to consume archives from your github repo, simply add the repo as a repository in your dependencies section.

dependencies {
    repositories {
        mavenCentral()
        maven { url "https://raw.githubusercontent.com/rharter/maven-repo/master/releases" }
        maven { url "https://raw.githubusercontent.com/rharter/maven-repo/master/snapshots" }
    }
    ...
}

Customizing

Gradle Repo Directory

By default, gradle-git-repo will clone repositories into ~/.git-repo. This can be changed using the GIT_REPO_CLONE_DIR environment variable.

License

Copyright 2014 Ryan Harter

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

gradle-git-repo's People

Contributors

rharter avatar

Stargazers

Melo Chale avatar Yingxin Wu avatar Oleksandr Stefanovskyi avatar Gautam Jain avatar Arunkumar avatar Jorge Garrido avatar Minkyu Cho avatar Wade avatar Khoi avatar Yegor Koldov avatar Rajesh Batth avatar Yossi Elkrief avatar Diego Lima avatar  avatar Pranav Lathigara avatar Andrew Chen avatar trietbui85 avatar  avatar Amine Laadhari avatar Piotr Wittchen avatar Jaewe Heo avatar Ravindra Kumar avatar zhoubing avatar Vignesh avatar Dimitry avatar Michal Skrabacz avatar Leocadio Tiné avatar ziem avatar Juan Andrés avatar  avatar Fabio Collini avatar Eric Palle avatar Stephane Faucher avatar Scott Weber avatar Mike Stetsenko avatar  avatar Andrew Jackson avatar Antonenko Viacheslav avatar

Watchers

 avatar Scott Weber avatar  avatar

gradle-git-repo's Issues

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.