Skip to content

Instantly share code, notes, and snippets.

View jitpack-io's full-sized avatar

JitPack.io jitpack-io

View GitHub Profile
@jitpack-io
jitpack-io / init.gradle
Last active March 18, 2023 13:38
init.gradle script to print Maven repositories. Copy to ~/.gradle/
# copy script to ~/.gradle/init.gradle
gradle.projectsEvaluated {
allprojects { project ->
task printRepos() {
println("Project repositories: ${project.name}")
repositories {
all { ArtifactRepository repo ->
@jitpack-io
jitpack-io / jitpack.yml
Last active December 31, 2022 15:07
Publish an existing jar file to jitpack
install:
- FILE="-Dfile=jars/my-library.jar"
- mvn install:install-file $FILE -DgroupId=com.github.user -DartifactId=repo -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true
@jitpack-io
jitpack-io / init.gradle
Created December 7, 2015 13:29
JitPack repository in 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) {
@jitpack-io
jitpack-io / build.gradle
Created March 14, 2019 13:33
Publish Android sources jar on Gradle 5+
apply plugin: 'digital.wup.android-maven-publish'
group = 'com.github.User'
version = '0.1'
task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier "sources"
}
@jitpack-io
jitpack-io / gist:87cc559e3a71459758eb
Last active September 16, 2015 08:09 — forked from reiz/gist:6203767
Creating a MavenProject from an ArtifactInfo inside a maven plugin.
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) );
plugins {
id 'pl.allegro.tech.build.axion-release' version '1.2.3'
id 'java'
id 'maven'
}
scmVersion {
tag {
prefix = ''
serialize = {config, version -> "$version-RELEASE"}