Commit d380fb3d authored by Maxym Borodenko's avatar Maxym Borodenko Committed by Matija Obreza
Browse files

[maven-release-plugin] prepare release genesys-client-api-2.0

parent 92b1cbaf
Pipeline #16366 passed with stage
in 56 seconds
variables:
# This will suppress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
# As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
# when running from the command line.
# `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
stages:
- compile
- deploy
......@@ -6,7 +15,7 @@ run tests in branches:
stage: compile
image: maven:3-jdk-8
script:
- MAVEN_OPTS="${MAVEN_OPTS} -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" mvn test -B
- mvn $MAVEN_CLI_OPTS test -B
except:
- master
- /^genesys\-client\-api\-/
......@@ -18,7 +27,7 @@ publish snapshot artifacts:
- echo "${GPG_KEY_SECRET}" | gpg --batch --import
- gpg --list-keys
script:
- mvn clean deploy --settings .ci-maven-settings.xml -B -U
- mvn $MAVEN_CLI_OPTS clean deploy --settings .ci-maven-settings.xml -B -U
only:
- master
......@@ -29,6 +38,6 @@ publish artifacts on central:
- echo "${GPG_KEY_SECRET}" | gpg --batch --import
- gpg --list-keys
script:
- mvn -e -X -P release clean deploy --settings .ci-maven-settings.xml -B -U
- mvn $MAVEN_CLI_OPTS -e -P release clean deploy --settings .ci-maven-settings.xml -B -U
only:
- /^genesys\-client\-api\-/
# Genesys Client API changelog
## Release 2.0
January 2021, the last version of the library with Java 8.
- b87ea2c Added new constant for Data provider ID
- 1f9151e Added constant for New WIEWS code
- ef6d3fc Added aegis to AccessionJson
- e75f511 Updated unit tests for "taxonomy" object
- c12b604 Field names changed
- ed48f4a Code cleanup
- 034bbb7 added taxonomy constants, fixed auth endpoint name
- b573448 Use API v1 endpoints
## Release 1.4
April 2019
......
......@@ -6,7 +6,8 @@
```java
// Set server URL
String baseUrl = "https://www.genesys-pgr.org";
String baseUrl = "https://api.sandbox.genesys-pgr.org";
// String baseUrl = "https://api.genesys-pgr.org";
String clientId = "theClientId@genesys";
String clientSecret = "thesecret";
String callbackUrl = "oob";
......@@ -14,6 +15,22 @@ String scope = "write"; // write scope is required to manage data on Genesys
GenesysClient genesysClient = new GenesysClient(baseUrl, clientId, clientSecret, callbackUrl, scope);
```
### System-to-system authentication
For Genesys API clients that support **OAuth client credentials**:
```java
// Use client_id and secret to authenticate
genesysClient.authenticate();
// Test it with /me
genesysClient.me();
// Tokens are now accessible. The refreshToken must be **safely** stored for future use.
// genesysClient.getTokens().getAccessToken();
// genesysClient.getTokens().getRefreshToken();
```
### Authentication: Authorization code
For Genesys API clients that support `authorization_code` grant (such as websites, unsafe clients).
......@@ -36,7 +53,7 @@ genesysClient.me();
### Authentication: Username and password
For Genesys API clients that support `password` grant (safe clients).
For Genesys API clients that support **OAuth password grant** (safe clients).
```java
// Obtain username and password
......@@ -92,7 +109,7 @@ try {
<dependency>
<groupId>org.genesys-pgr</groupId>
<artifactId>genesys-client-api</artifactId>
<version>1.4</version>
<version>2.0</version>
</dependency>
```
......@@ -102,7 +119,7 @@ Or for the development version:
<dependency>
<groupId>org.genesys-pgr</groupId>
<artifactId>genesys-client-api</artifactId>
<version>2.0-SNAPSHOT</version>
<version>3.0-SNAPSHOT</version>
</dependency>
```
......
......@@ -3,10 +3,10 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.genesys-pgr</groupId>
<artifactId>genesys-client-api</artifactId>
<version>2.0-SNAPSHOT</version>
<version>2.0</version>
<name>Genesys API client library</name>
<packaging>jar</packaging>
<url>https://bitbucket.org/genesys2/genesys-client-api</url>
<url>https://gitlab.croptrust.org/genesys-pgr/genesys-client-api</url>
<description>Java client for Genesys PGR Server APIs</description>
<licenses>
......@@ -17,10 +17,10 @@
</licenses>
<scm>
<connection>https://bitbucket.org/genesys2/genesys-client-api.git</connection>
<developerConnection>scm:git:git@bitbucket.org:genesys2/genesys-client-api.git</developerConnection>
<url>git@bitbucket.org:genesys2/genesys-client-api.git</url>
<tag>HEAD</tag>
<connection>https://gitlab.croptrust.org/genesys-pgr/genesys-client-api.git</connection>
<developerConnection>scm:git:git@gitlab.croptrust.org:genesys-pgr/genesys-client-api.git</developerConnection>
<url>git@gitlab.croptrust.org:genesys-pgr/genesys-client-api.git</url>
<tag>genesys-client-api-2.0</tag>
</scm>
<developers>
......@@ -39,7 +39,7 @@
<maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<slf4j.version>1.7.21</slf4j.version>
<slf4j.version>1.7.21</slf4j.version>
<show.deprecations>true</show.deprecations>
</properties>
......@@ -93,11 +93,11 @@
<artifactId>scribejava-core</artifactId>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment