From a12ff8eab6391609e72cad4d52b9b245ff3863af Mon Sep 17 00:00:00 2001 From: Ted Spence Date: Wed, 25 Oct 2023 17:11:10 -0700 Subject: [PATCH 1/3] Let's try central publishing tutorial Looks like there's a new strategy for publishing java to maven. Let's try following this. --- pom.xml | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/pom.xml b/pom.xml index 3496687..550691f 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ ProjectManagerSDK Software development kit for the ProjectManager.com API. for Java - + https://developer.projectmanager.com/ @@ -61,33 +61,21 @@ - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.8 - true - - ossrh - https://s01.oss.sonatype.org/ - true - - - - release + + org.sonatype.central + central-publishing-maven-plugin + 0.1.2 + true + + central + true + + org.apache.maven.plugins maven-source-plugin From 25684d40c283c0275a5150c32c7ff84a9402dbbf Mon Sep 17 00:00:00 2001 From: Ted Spence Date: Wed, 25 Oct 2023 17:28:10 -0700 Subject: [PATCH 2/3] POM file seems to work now Needed sources and javadocs - wouldn't upload without them. --- .github/workflows/publish.yml | 18 ++++++++++--- pom.xml | 48 +++++++++++++---------------------- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 22dedb5..4da83af 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,14 +34,24 @@ jobs: - name: Verify with Maven if: github.event_name == 'pull_request' - run: mvn -B clean verify + run: mvn -B -Prelease clean verify - - name: Build with Maven - run: mvn -B compile --file pom.xml + - name: Verify javadoc + if: github.event_name == 'pull_request' + run: mvn -B -Prelease javadoc:test-javadoc + + - name: Compile + run: mvn -B -Prelease compile + + - name: Javadoc + run: mvn -B -Prelease javadoc:jar + + - name: Source + run: mvn -B -Prelease source:jar - name: Publish to Apache Maven Central if: github.ref == 'refs/heads/main' && github.event_name == 'push' - run: mvn -X -Pbuild-extras,release deploy + run: mvn -B -Prelease deploy env: OSSRH_USERNAME: ${{ secrets.MAVEN_USERNAME }} OSSRH_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN }} diff --git a/pom.xml b/pom.xml index 550691f..27f3064 100644 --- a/pom.xml +++ b/pom.xml @@ -79,10 +79,26 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.0 attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.6.0 + + + attach-javadocs + + jar + @@ -110,35 +126,5 @@ - - build-extras - - true - - - - - org.apache.maven.plugins - maven-source-plugin - 2.4 - - - attach-sources - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.3 - - - attach-javadocs - - - - - - \ No newline at end of file From 044a674b17feaf5d54026166dcde4932e6250a5b Mon Sep 17 00:00:00 2001 From: Ted Spence Date: Thu, 26 Oct 2023 09:20:01 -0700 Subject: [PATCH 3/3] Better documentation Add a more comprehensive readme. Also let's tinker with the GitHub action and see if we can get it to avoid testing GPG signatures on every PR. --- .github/workflows/publish.yml | 2 +- README.md | 63 +++++++++++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4da83af..5198f13 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,7 +34,7 @@ jobs: - name: Verify with Maven if: github.event_name == 'pull_request' - run: mvn -B -Prelease clean verify + run: mvn -B clean verify - name: Verify javadoc if: github.event_name == 'pull_request' diff --git a/README.md b/README.md index 63cd0bb..045673f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,61 @@ -# projectmanager-sdk-java -ProjectManager.com SDK for Java +[![Maven Central](https://img.shields.io/maven-central/v/com.projectmanager/projectmanagersdk?style=plastic)](https://central.sonatype.com/artifact/com.projectmanager/projectmanagersdk) + +# ProjectManager.com SDK for API v4 + +This software development kit contains all API definitions for the [ProjectManager.com](https://www.projectmanager.com) REST API v4. + +# Why use the SDK? + +The ProjectManager API v4 is available as a REST definition in OpenAPI format. You can read the documentation online at [developer.projectmanager.com](https://developer.projectmanager.com/). + +This SDK provides a few capabilities that developers may find more useful than hand-writing REST API code: +* Documentation is available in your editor via autocomplete and hover docblocks +* Patch notes are available detailing changes +* Automated updates whenever new API endpoints are added + +# Using this SDK + +Here's how to add this SDK to create a project. + +First, you must add a reference in your `pom.xml` file. Check [the SonaType central page](https://central.sonatype.com/artifact/com.projectmanager/projectmanagersdk/overview) for the latest version number: + +```xml + + com.projectmanager + projectmanagersdk + 97.0.2178 + +``` + +Next, run `mvn install`. + +To create an API client for ProjectManager within Java, you must specify: +* Your API key, and +* Your environment URL. + +For the ProjectManager production environment, the environment URL is `https://api.projectmanager.com`. + +To [obtain a ProjectManager.com API key](https://developer.projectmanager.com/reference/api-keys): +* Log on to ProjectManager.com +* Click your name in the bottom left hand corner +* Select Account, then API +* Follow the instructions on the page to create a new API key + +```java +import com.projectmanager.ProjectManagerClient; + +public class JavaExample +{ + public static ProjectManagerClient GetProjectManagerClient(String apiKey, String env) + { + return ProjectManagerClient + .withEnvironment(env) + .withBearerToken(apiKey) + .WithAppName("MyApplicationName"); + } +} +``` + + + +