Skip to content

This repository contains example how to publish and depends on maven artifacts using github.

Notifications You must be signed in to change notification settings

daggerok/publish-to-github-example

Repository files navigation

publish-to-github-example Build Status

gradle flow

1 build and deploy (publish) gradle-producer library to github (user: daggerok, repo: publish-to-github-example, branch: mvn-repo)
bash ./gradlew clean deploy -b gradle-producer/build.gradle
2 build dependant project using gradle-consumer from Github
bash ./gradlew clean build -b gradle-consumer/build.gradle
java -jar ./gradle-consumer/build/libs/*-all.jar

maven flow

1 build and deploy (publish) maven-producer library to github (user: daggerok, repo: publish-to-github-example, branch: mvn-repo)
# using custom settings.xml
bash mvnw clean deploy -U -f maven-producer/pom.xml -s maven-producer/settings.xml

# or after modifiyng ~/.m2/settings.xml
cp maven-producer/settings.xml ~/.m2/
bash mvnw clean deploy -f maven-producer/pom.xml -P publish-to-github-example-deployment-profile
2 build dependant project using maven-producer as a dependency from Github
bash ./mvnw clean package -U -f maven-consumer/pom.xml
java -jar maven-consumer/target/*-all.jar