-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from cyberark/6-maven-central-publishing
6 Support for Maven Central Publishing
- Loading branch information
Showing
33 changed files
with
418 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Upgrading Conjur Java API | ||
|
||
This guide describes how to upgrade your project to use Conjur Java API. | ||
|
||
The main scenario covered in this document is migrating a project with a Conjur-Java-API | ||
to v3.0.0. | ||
|
||
For more details about using the Conjur API, or contributing to development, please | ||
refer to the [Conjur Java API](https://github.com/cyberark/conjur-api-java). | ||
|
||
For further assistance installing and configuring the Conjur Java API, | ||
please refer to the [Setup](README.md#Setup) section of | ||
the Conjur Java API [README.md](README.md) file. | ||
|
||
## Migrating to 3.0.0 | ||
|
||
With the update to v.3.0.0, the Conjur Java API now makes use of the `com.cyberark` | ||
project namespace. This allows us to publish artifacts to this namespace, which are | ||
immediately available to use in project. As such, your project can make use of the | ||
Conjur Java API without needing to build the Jarfile locally. | ||
|
||
### Changes to your code base | ||
Due to the change to the project namespace, we have modified the package name from | ||
`net.conjur.api` to `com.cyberark.conjur.api`. As such, all import statements must be | ||
updated to reflect this. | ||
|
||
### Example | ||
Before: | ||
```java | ||
import net.conjur.api.AuthnProvider | ||
``` | ||
|
||
After: | ||
```java | ||
import com.cyberark.conjur.api.AuthnProvider | ||
``` | ||
|
||
### Changes to your `pom.xml` | ||
Due to the change to the project namespace, we have modified the package name from | ||
`net.conjur.api` to `com.cyberark.conjur.api`. As such, your dependency configuration | ||
must be updated to reflect this. | ||
|
||
### Example | ||
Before: | ||
```xml | ||
<dependency> | ||
<groupId>net.conjur.api</groupId> | ||
<artifactId>conjur-api</artifactId> | ||
<version>2.2.0</version> | ||
<dependency> | ||
``` | ||
|
||
After: | ||
```xml | ||
<dependency> | ||
<groupId>com.cyberark.conjur.api</groupId> | ||
<artifactId>conjur-api</artifactId> | ||
<version>3.0.0</version> | ||
<dependency> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
#!/usr/bin/env bash | ||
set -eo pipefail | ||
|
||
|
||
#TODO - add rest of steps needed to build the package | ||
|
||
docker run --rm -v "$PWD:/conjurinc/api-java" -w /conjurinc/api-java maven:3-jdk-8 /bin/bash -c \ | ||
"mvn -X -e clean package -Dmaven.test.skip=true" | ||
docker run --rm \ | ||
-v "$PWD:/cyberark/conjur-java-api" \ | ||
-w /cyberark/conjur-java-api maven:3-jdk-8 \ | ||
/bin/bash -ec "mvn -X -e clean package -Dmaven.test.skip=true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -exo pipefail | ||
|
||
# Strip the 'v' from the Tag Name | ||
export TAG=${TAG_NAME//"v"} | ||
|
||
# Deploy release to Sonatype OSSRH (OSS Repository Hosting) | ||
# Setup: Import our GPG key and passphrase | ||
# 1. Set the version in the POM to the Tagged Version | ||
# 2. Sign our build and deploy to OSSRH | ||
# 3. Release our staged deployment | ||
# | ||
# Note: The autoReleaseAfterClose for the nexus-staging-maven-plugin should be | ||
# set to "false" if we do not want releases published automatically | ||
docker run --rm \ | ||
-e OSSRH_USERNAME \ | ||
-e OSSRH_PASSWORD \ | ||
-v "$PWD:/cyberark/conjur-java-api" \ | ||
-v "$GPG_PASSWORD:/gpg_password" \ | ||
-v "$GPG_PRIVATE_KEY:/gpg_key" \ | ||
-w /cyberark/conjur-java-api maven:3-jdk-8 \ | ||
/bin/bash -ec "gpg --batch --passphrase-file /gpg_password --trust-model always --import /gpg_key | ||
mvn versions:set -DnewVersion=${TAG} | ||
mvn --settings settings.xml clean deploy -Dmaven.test.skip=true -P ossrh,sign | ||
mvn nexus-staging:release" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
set -exo pipefail | ||
|
||
# Deploy snapshot to Sonatype OSSRH (OSS Repository Hosting) | ||
# Setup: Import our GPG key and passphrase | ||
# 1. Deploy to snapshot repository of OSSRH | ||
# | ||
# Note: Snapshot releases do not need to meet Maven central requirements, | ||
# but it is best to do so whenever possible | ||
docker run --rm \ | ||
-e OSSRH_USERNAME \ | ||
-e OSSRH_PASSWORD \ | ||
-v "$PWD:/cyberark/conjur-java-api" \ | ||
-v "$GPG_PASSWORD:/gpg_password" \ | ||
-v "$GPG_PRIVATE_KEY:/gpg_key" \ | ||
-w /cyberark/conjur-java-api maven:3-jdk-8 \ | ||
/bin/bash -ec "gpg --batch --passphrase-file /gpg_password --trust-model always --import /gpg_key | ||
mvn --settings settings.xml clean deploy -Dmaven.test.skip=true -P ossrh,sign" |
Oops, something went wrong.