GithubHelp home page GithubHelp logo

jitpack / jitpack.io Goto Github PK

View Code? Open in Web Editor NEW
2.5K 66.0 172.0 781 KB

Documentation and issues of https://jitpack.io

License: MIT License

gradle maven sbt leiningen publish libraries android jitpack

jitpack.io's Introduction

JitPack.io

JitPack is a novel package repository for JVM and Android projects. It builds Git projects on demand and provides you with ready-to-use artifacts (jar, aar).

If you want your library to be available to the world, there is no need to go through project build and upload steps. All you need to do is push your project to GitHub and JitPack will take care of the rest. That’s really it!

In case your project is already on GitHub, JitPack makes sure it can be built by anyone. Want to use a GitHub library in your project? Follow the simple steps explained in the ‘Building with JitPack’ section.

For issues and enhancements, please use the JitPack GitHub repository. The repository contains this documentation and contributions are welcome there as well.

If you'd like some help with setting up repositories please use the Support button on the web site.

Building with JitPack

If you are using Gradle to get a GitHub project into your build, you will need to:

Step 1. Add the JitPack maven repository

    maven { url "https://jitpack.io"  }

Note: when using multiple repositories in build.gradle it is recommended to add JitPack at the end. Gradle will go through all repositories in order until it finds a dependency.

Step 2. Add the dependency information:

  • Group: com.github.Username
  • Artifact: Repository Name
  • Version: Release tag, commit hash or master-SNAPSHOT

That's it! The first time you request a project JitPack checks out the code, builds it and sends the Jar files back to you.

To see an example head to jitpack.io and 'Look Up' a GitHub repository by url.

Gradle example in settings.gradle file:

    dependencyResolutionManagement {
        repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
        repositories {
            mavenCentral()
            maven { url 'https://jitpack.io' }
        }
    }
    dependencies {
        implementation 'com.github.User:Repo:Version'
    }

Note: For security and performance reasons it is recommended to exclude the dependency search from other repositories using filtering.

      maven { 
        url "https://jitpack.io" 
        content { includeGroup "com.github.username" }
      }
      maven {
        url "https://other repository"
        content { excludeGroupByRegex "com\\.github.username.*" }
      }

Snapshots

A snapshot is a version that has not been released. The difference between a real version and a snapshot is that snapshot might still get updates. Snapshot versions are useful during development process and JitPack provides two ways to get them. You can specify a version for your dependency as:

  • commit hash

  • branch-SNAPSHOT (replace 'branch' with any branch name, e.g. master)

For example:

    // dependency on the latest commit in the master branch
    implementation 'com.github.jitpack:gradle-simple:master-SNAPSHOT'

Adding -SNAPSHOT will build the latest commit on the master branch.

Gradle can cache the SNAPSHOT builds. You could add the following configuration in your build.gradle file in order to ensure Gradle always picks up the 'freshest' version of the build:

configurations.all {
    resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

Building a new snapshot may take some time so it might be necessary to increase Gradle timeouts (FAQ).

Or you could also run Gradle from the command line with the --refresh-dependencies flag. See the Gradle documentation for more information on how to configure caching for changing dependencies.

Note If using Android Studio, don't forget to press File->Synchronize after updating to a newer snapshot.

Also see the Guide to building for more details and instructions on building multi-module projects.

If the project doesn't have any GitHub Releases, you can get the latest snapshot build. In this case, use the short commit id as the version. You can also place tags on other branches and then build using those tags.

Tip: You can also automate GitHub releases with Gradle release & version management plugin

Pull Requests

In addition to snapshot builds JitPack supports building Pull Requests. Simply use PR<NR>-SNAPSHOT as the version.

For example:

    // dependency for Pull Request 4
    implementation 'com.github.jitpack:gradle-simple:PR4-SNAPSHOT'

Publishing on JitPack

Publishing your library on JitPack is very simple:

As long as there's a build file in your repository and it can install your library in the local Maven repository, it is sufficient for JitPack. See the Guide to building on how to publish JVM libraries and Guide to Android on how to publish Android libraries.

Tip: You can try out your code before a release by using the commit hash as the version.

Some extras to consider

Add dependency information in your README. Tell the world where to get your library:

   repositories {
        mavenCentral()
        maven { url "https://jitpack.io" }
   }
   dependencies {
         implementation 'com.github.jitpack:gradle-simple:1.0'
   }
  • Add sources jar. Creating the sources jar makes it easier for others to use your code and contribute.

Features

Javadoc publishing

  • For a single module project, if it produces a javadoc.jar then you can browse the javadoc files directly at:

    • https://jitpack.io/com/github/USER/REPO/VERSION/javadoc/ or
    • https://jitpack.io/com/github/USER/REPO/latest/javadoc/ (latest release tag)
  • For a multi module project, the artifacts are published under com.github.USER.REPO:MODULE:VERSION, where MODULE is the artifact id of the module (not necessarily the same as the directory it lives in)

  • Javadocs for a multi-module project follow the same convention, i.e.

    • https://jitpack.io/com/github/USER/REPO/MODULE/VERSION/javadoc/
  • Aggregated javadocs for a multi-module project may be available if the top level aggregates them into a jar and publishes it. The module name in this case is the artifact id of the top level module.

  • See the example projects on how to configure your build file (Android example).

Other features

  • Private repositories
  • Dynamic versions. You can use Gradle's dynamic version '1.+' and Maven's version ranges for releases. They resolve to releases that have already been built. JitPack periodically checks for new releases and builds them ahead-of-time.
  • Build by tag, commit id, or anyBranch-SNAPSHOT.
  • You can also use your own domain name for group

Immutable artifacts

Public repository artifacts on JitPack are immutable after 7 days of publishing. You will see an indicator in the list of versions when a build becomes frozen (snowflake icon). Within the first 7 days they can be re-built to fix any release issues. Even then we recommend creating a patch release instead.

JitPack will also keep hosting artifacts after the originating git repository is deleted. To delete a build you need to have git push permissions to your git repository.

Other Git hosts

JitPack also works with other Git hosting providers. The only difference is the groupId of your artifacts:

  • BitBucket: org.bitbucket.Username:Repo:Tag

  • GitLab: com.gitlab.Username:Repo:Tag

  • Gitee: com.gitee.Username:Repo:Tag

  • Azure: com.azure.Project:Repo:Tag

To see an example, head to https://jitpack.io and 'Look Up' a Git repository by url.

Self-hosted Git servers like GitLab are also supported. You can register your server on your user page.

Custom domain name

If you want to use your own domain name as the groupId instead of com.github.yourcompany, you can. We support mapping your domain name to your GitHub organization. Then, instead of 'com.github.yourcompany' groupId, you can use 'com.yourcompany' while the name of the project and version remains the same.

To enable your own domain name:

  1. Add a DNS TXT record that maps git.yourcompany.com to https://github.com/yourcompany. This needs to be configured at your domain name provider such as GoDaddy. For example see How to add a TXT record.

  2. Go to https://jitpack.io/#com.yourcompany/yourrepo and click Look up. If DNS resolution worked then you should see a list of versions.

  3. Select the version you want and click 'Get it' to see Maven/Gradle instructions.

Example: https://jitpack.io/#io.jitpack/gradle-simple

To check that the DNS TXT record was added, run the command dig txt git.yourcompany.com. For example:

~$ dig txt git.jitpack.io
...
;; ANSWER SECTION:
git.jitpack.io.		600	IN	TXT	"https://github.com/jitpack"

Badges

Add this line to your README.md to show a status badge with the latest release:

[![Release](https://jitpack.io/v/User/Repo.svg)]
(https://jitpack.io/#User/Repo)

Release

If you are using a custom domain or BitBucket, use:

[![Release](https://jitpack.io/v/com.example/Repo.svg)]
(https://jitpack.io/#com.example/Repo)


[![Release](https://jitpack.io/v/org.bitbucket.User/Repo.svg)]
(https://jitpack.io/#org.bitbucket.User/Repo)

Or, if you prefer the flat-squared style:

https://jitpack.io/v/User/Repo.svg?style=flat-square

Release

Continuous Integration (CI)

In addition to publishing artifacts, JitPack can run your whole build pipeline. JitCI is an all-in-one solution to publish high quality libraries with ease. It provides the following features:

  • Running tests
  • Code Coverage
  • Dependency Audit
  • License Checks
  • Vulnerability Reports
  • Publishing to JitPack

You can enable the CI from project settings or simply sign-in on jitci.com and add your repository.

FAQ

See the FAQ page

jitpack.io's People

Contributors

ajermakovics avatar atilacamurca avatar david-allison avatar gitter-badger avatar jawnnypoo avatar jitpack-io avatar kaikeru avatar kojofosu avatar larsgrefer avatar leif81 avatar marcono1234 avatar martinbonnin avatar mkrnr avatar mohamedwael avatar paulvi avatar sebbylaw avatar sschuberth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jitpack.io's Issues

Plugin for Intellij

Will be good to have a plugin to warning when the library have a update or structure change. Look like a log.

Module build error.

this build ok

https://jitpack.io/com/github/NanoHttpd/nanohttpd/Release-2.1.0/build.log

require url format is

Expecting: /com/github/user/repo[/module]/version/repo-version.pom

But in pom, the coordinate is

<groupId>fi.iki.elonen</groupId>
    <artifactId>nanohttpd-project</artifactId>
    <version>2.1.0</version>
    <packaging>pom</packaging>

So, how can I get the pom with jitpack way ?

I can not open this url

https://jitpack.io/com/github/NanoHttpd/core/nanohttpd/Release-2.1.0/nanohttpd-Release-2.1.0.pom

even if I can , then how to put the core module in dependency ?

<dependency>
            <groupId>com.github.NanoHttpd</groupId>
            <artifactId>nanohttpd</artifactId>
            <version>Release-2.1.0</version>
        </dependency>

Where to tell jitpack I need core ?

Support Android builds

Maven and gradle can build android projects. It should be possible to build them on jitpack

Sbt support

We can use 'sbt publishM2' to install in the local maven repository

  • update documentation

"Failed to resolve" for Android multi-module project

Hi, I've been playing around with JitPack for awhile now but still can't seem to get it to work unfortunately.

Here's my GitHub repo. The setup for testing JitPack is two modules. One is the library with maven plugin setup. The other module strictly doesn't have a local dependency on that library, instead it has dependency on the "com.github..." and tries to use JitPack.

Here's a quick checklist of the things that I have gone through so far (and haven't worked):

  • For the project ("app") trying to use the library:
    • https://jitpack.io is in the buildscript repositories closure
    • I've tried the regular dependency from jitpack homepage
    • I've tried the Repo.Module dependency pattern as mentioned in the gradle-modular example
  • For the library project ("globaloverlay"):

Any ideas?

Build error in Gradle project

When I try to include a gradle project (https://github.com/cypressious/MaterialEditText) in my app, I get the following error:

Error:Could not GET 'https://jitpack.io/com/github/cypressious/MaterialEditText/1.8.2/MaterialEditText-1.8.2.pom'. Received status code 500 from server: Not found
<a href="toggle.offline.mode">Enable Gradle 'offline mode' and sync project</a>

On your webpage it also says "Build error" for the corresponding version and the log says:

Running: gradle --daemon -Pgroup=com.github.cypressious -Pversion=1.8.2.1 install
RELEASE BUILD

FAILURE: Build failed with an exception.

* What went wrong:
Task 'install' is ambiguous in root project 'build'. Candidates are: 'installDebug', 'installDebugTest'.

* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Leiningen support

Build and install Leiningen projects into the local maven repository.

lein do clean, install

Can't find android.support in jitpack.io

I think support package should store in sdk folder, but the gradle try to find it in jitpack. I've no idea to walk around this issue.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not resolve com.android.support:appcompat-v7:22+.
     Required by:
         letsgo-android:app:unspecified
      > Failed to list versions for com.android.support:appcompat-v7.
         > Unable to load Maven meta-data from https://jitpack.io/com/android/support/appcompat-v7/maven-metadata.xml.
            > Could not GET 'https://jitpack.io/com/android/support/appcompat-v7/maven-metadata.xml'. Received status code 400 from server: Expecting: /com/github/user/repo[/module]/version/repo-version.pom

401 from jitpack server for my github public build

Hi,

I've created this release form my fix to Spring Data Cassandra:
https://jitpack.io/#walec51/spring-data-cassandra/DATACASS-182-fix

copy-pasted the right gradle code, but when I try to build I get:

:order-service:compileJava

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':order-service:compile'.
> Could not resolve com.github.walec51:spring-data-commons:DATACASS-182-fix.
  Required by:
      pl.allegro.transaction.order:order-service:0.7.2-SNAPSHOT > com.github.walec51:spring-data-cassandra:DATACASS-182-fix
   > Could not GET 'https://jitpack.io/com/github/walec51/spring-data-commons/DATACASS-182-fix/spring-data-commons-DATACASS-182-fix.pom'. Received status code 401 from server: Repository not found or requires authentication

Publish javadocs

If the project builds a javadoc jar, unzip and host the javadocs on jitpack.io

cannot pick up the compile function

// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'maven'
buildscript {
    repositories {
        jcenter()
        maven {
            url "https://jitpack.io"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'
        //classpath 'com.android.tools.build:gradle:1.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://jitpack.io"
        }
    }
}
dependencies {
   // compile 'com.github.jjhesk:expandableWidget:v0.2'
    compile 'com.github.neopixl:PixlUI:v1.0.5'
}

and i got this from the compile time.

Error:(28, 0) Gradle DSL method not found: 'compile()'
Possible causes:<ul><li>The project 'test' may be using a version of Gradle that does not contain the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>

anyone have this problem?

Skip tests while building something

In readme it is said that jitpack will execute build like "mvn install"

I think that it will execute tests automatically. It would be very nice if these tests could be skipped.

Install latest build.tools

Docker needs to be updated with latest build tools:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':library'.
> failed to find Build Tools revision 22.0.1

Bitbucket support

Bitbucket allows you to have an unlimited number of private repositories (as long as you have less than 5 users) for free. GitHub doesn't allow you to create private repositories for free.

If Jitpack.io supported Bitbucket, we would have a free, cloud-based build system.

nested libraries

I have just touched the issue on these line:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find com.github.jjhesk:expandableWidget:v0.21.
     Searched in the following locations:
         https://jcenter.bintray.com/com/github/jjhesk/expandableWidget/v0.21/expandableWidget-v0.21.pom
         https://jcenter.bintray.com/com/github/jjhesk/expandableWidget/v0.21/expandableWidget-v0.21.jar
         file:/Users/hesk/Library/Android/sdk/extras/android/m2repository/com/github/jjhesk/expandableWidget/v0.21/expandableWidget-v0.21.pom
         file:/Users/hesk/Library/Android/sdk/extras/android/m2repository/com/github/jjhesk/expandableWidget/v0.21/expandableWidget-v0.21.jar
         file:/Users/hesk/Library/Android/sdk/extras/google/m2repository/com/github/jjhesk/expandableWidget/v0.21/expandableWidget-v0.21.pom
         file:/Users/hesk/Library/Android/sdk/extras/google/m2repository/com/github/jjhesk/expandableWidget/v0.21/expandableWidget-v0.21.jar
     Required by:
         DropDownBoxUi:app:unspecified > DropDownBoxUi:lib:unspecified

failure to build with jitpack but builds fine on computer

https://jitpack.io/com/github/fakemongo/fongo/66a66f19c8b4d68f9c1a725d5ee10b029b372180/build.log

here is a comment about the failure on the specified repository:
fakemongo/fongo#101 (comment)

It builds fine locally on a MacOSX 10.10.3

specifically build failure is missing the java Path class

[ERROR] /build/src/test/java/com/github/fakemongo/impl/index/IndexTest.java:[60,4] cannot access java.nio.file.Path
class file for java.nio.file.Path not found
    assertThat(resultObject).isEqualTo(sourceObject);

Path did not exist till the 1.7 jdk could this be causing the issue?

First fetch can hang for numerous minutes

Don't know if this is just a backed up build queue or something, but the first request for a repo can take anywhere from 5-10 minutes. Anything that can be done about this?

15:04:53.023 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Sending request: GET /com/github/Levelmoney/ObserveFragment/0.5/ObserveFragment-0.5.pom HTTP/1.1
15:04:53.024 [DEBUG] [org.apache.http.headers] >> GET /com/github/Levelmoney/ObserveFragment/0.5/ObserveFragment-0.5.pom HTTP/1.1
15:04:53.024 [DEBUG] [org.apache.http.headers] >> Accept-Encoding: gzip,deflate
15:04:53.025 [DEBUG] [org.apache.http.headers] >> Host: jcenter.bintray.com
15:04:53.025 [DEBUG] [org.apache.http.headers] >> Connection: Keep-Alive
15:04:53.025 [DEBUG] [org.apache.http.headers] >> User-Agent: Gradle/2.2.1 (Mac OS X;10.10.2;x86_64) (Oracle Corporation;1.8.0_25;25.25-b02)

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.