Java/Gradle demo project to show how to use private artifacts from a remote Maven Repository.
To see how to publish private artifacts on a remote Maven Repository see svaponi/gradle-demo-artifact.
Build and test project:
gradle clean build
If you get an error, see Local configuration for remote Maven Repository.
Package:
gradle clean test jar
Run application:
java -jar build/libs/*-1.0.jar
Show all Gradle tasks available on this project:
gradle tasks --all
To connect to our remote Maven repository we need to define some variable used by Gradle.
In order to make variables visible to our Gradle scripts, you need to define them in ~/.gradle/gradle.properties
.
echo '
remote_repository_baseurl=YOUR_REMOTE_REPOSITORY_URL
remote_repository_username=YOUR_REMOTE_REPOSITORY_USERNAME
remote_repository_password=YOUR_REMOTE_REPOSITORY_ENCRYPTED_PASSWORD
' >> ~/.gradle/gradle.properties
ATTENTION: the property names are not standard. They are only used within this repository, see
build.gradle
.
If you use Artifatory, see JFrog documentation.