Instantly share code, notes, and snippets.

View init.gradle
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.dsl.RepositoryHandler
apply plugin:JitPackRepositoryPlugin
class JitPackRepositoryPlugin implements Plugin<Gradle> {
void apply(Gradle gradle) {
View gist:87cc559e3a71459758eb
protected MavenProject buildProjectModel(ArtifactInfo artifactInfo) throws Exception {
try {
ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
configuration.setLocalRepository( localRepository );
configuration.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL );
configuration.setProcessPlugins( false );
configuration.setRepositoryMerging( ProjectBuildingRequest.RepositoryMerging.REQUEST_DOMINANT );
Properties properties = new Properties( );
for ( String key : session.getSystemProperties( ).keySet() ){
properties.put( key, session.getSystemProperties().get(key) );
View axion-release configuration for publishing github releases as X.X.X-RELEASE
plugins {
id 'pl.allegro.tech.build.axion-release' version '1.2.3'
id 'java'
id 'maven'
}
scmVersion {
tag {
prefix = ''
serialize = {config, version -> "$version-RELEASE"}
View gist:5bd698d35303b2c370a0
<!-- Put the Maven coordinates in your HTML: -->
<pre class="prettyprint">&lt;dependency&gt;
&lt;groupId&gt;com.github.jitpack&lt;/groupId&gt;
&lt;artifactId&gt;android-example&lt;/artifactId&gt;
&lt;version&gt;<span id="latest_release">1.0</span>&lt;/version&gt;
&lt;/dependency&gt; </pre>
<!-- Add this script to update "latest_release" span to latest version -->
<script>
var user = 'jitpack'; // Replace with your user/repo