Skip to content

Commit

Permalink
Merge pull request #351 from AppDirect/MSFT-3743
Browse files Browse the repository at this point in the history
MSFT-3743 Migrate library into spring 6 + boot 3 + Java 17
  • Loading branch information
wilsonchingg authored Jun 13, 2024
2 parents 0c58c86 + c1b8899 commit b9ad6db
Show file tree
Hide file tree
Showing 85 changed files with 1,143 additions and 689 deletions.
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
48 changes: 24 additions & 24 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import org.json.JSONObject

def version
pipeline {
agent {
docker {
image "docker.appdirect.tools/appdirect/build-jdk8:latest"
args "-v /var/run/docker.sock:/var/run/docker.sock "
reuseNode true
}
}

options { disableConcurrentBuilds() }

agent {
docker {
image "docker.appdirect.tools/appdirect/build-jdk17:latest"
args "-v /var/run/docker.sock:/var/run/docker.sock "
reuseNode true
}
}

options { disableConcurrentBuilds() }
environment {
GITHUB_REPO_NAME = 'service-integration-sdk'
GITHUB_REPO_OWNER = 'AppDirect'
Expand All @@ -32,7 +32,7 @@ pipeline {
stage('PR approval') {
steps {
script {
if (BRANCH_NAME != 'master' || BRANCH_NAME != 'release-v1') {
if (BRANCH_NAME != 'master' || BRANCH_NAME != 'release-v1' || BRANCH_NAME != 'release-v3') {
timeout(time: 15, unit: "MINUTES") {
input message: 'Do you want to approve the PR build?', ok: 'Yes'
}
Expand All @@ -41,8 +41,8 @@ pipeline {
}
}
stage('Checkout') {
steps {
steps {

echo 'Checking out from repository...'
checkout scm: [
$class : 'GitSCM',
Expand All @@ -54,8 +54,8 @@ pipeline {
]
]
script {
if (env.BRANCH_NAME == "release-v1") {
version = getSemver('release-v1', '', env.BRANCH_NAME != 'release-v1' ? '-SNAPSHOT' : '')
if (env.BRANCH_NAME == "release-v1" || env.BRANCH_NAME == "release-v3") {
version = getSemver(env.BRANCH_NAME, '', '')
} else {
version = getSemver('master', '', env.BRANCH_NAME != 'master' ? '-SNAPSHOT' : '')
}
Expand All @@ -64,10 +64,10 @@ pipeline {
}

stage('Setup') {
when {
expression { BRANCH_NAME ==~ /(release-v1|master)/ }
when {
expression { BRANCH_NAME ==~ /(release-v1|release-v3|master)/ }
}

steps {
echo 'Prepare Maven properties'
configFileProvider(
Expand Down Expand Up @@ -95,20 +95,20 @@ pipeline {
steps {

echo 'Building project...'
withCredentials([file(credentialsId: 'gpg-private-key', variable: 'GPG_KEY')]) {
withCredentials([file(credentialsId: 'gpg-private-key', variable: 'GPG_KEY')]) {

withPullRequestBranch {
sh '''
./mvnw install source:jar-no-fork
'''
}
script {
if (BRANCH_NAME == 'master' || BRANCH_NAME == 'release-v1') {

if (BRANCH_NAME == 'master' || BRANCH_NAME == 'release-v1' || BRANCH_NAME == 'release-v3') {
sh "gpg2 --batch --no-tty --import $GPG_KEY || /bin/true"
sh '''
./mvnw deploy source:jar-no-fork -Prelease -U -s settings.xml
'''
'''
}
}
}
Expand All @@ -123,7 +123,7 @@ pipeline {

stage('Release scope') {
when {
expression { BRANCH_NAME ==~ /(release-v1|master)/ }
expression { BRANCH_NAME ==~ /(release-v1|release-v3|master)/ }
}
steps {
pushGitTag version
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ Integrate your application with the AppDirect platform. Create a connector using
For more details see [GitHub wiki](https://github.com/AppDirect/service-integration-sdk/wiki).

## Prerequisites
* Java 8 or higher
* Build your connector using [Spring Boot 2.0](https://projects.spring.io/spring-boot/)
* Java 17 or higher
* Build your connector using [Spring Boot 3.0](https://projects.spring.io/spring-boot/)

## Features
* Automatic parsing of incoming AppDirect distribution API calls
* Automatic OAuth authentication for all API events to and from the AppDirect platform
* Provides handlers for your events
* Allows you to use AppMarket as an IdP to sign in to your connector

## Sample client application
AppDirect developed the Chatty Pie connector as an example of a connector that can be implemented with the SDK. It is a lightweight chat room application. The chatty pie connector was built to handle all AppDirect Distribution API events including creating new customers, developer accounts, assignments, and changes to a subscription.
To build and run your own connector based on Chatty Pie see [Chatty pie](https://github.com/AppDirect/chatty-pie-connector).

## Getting Started
To incorporate the SDK into your application see [Getting Started](https://github.com/AppDirect/service-integration-sdk/wiki/Getting-Started).
Expand Down
36 changes: 21 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
<groupId>com.appdirect</groupId>
<artifactId>service-integration-sdk</artifactId>
<packaging>jar</packaging>
<version>2.0.7-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<name>SDK for service integration</name>

<properties>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<java.version>17</java.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<com.google.guava.version>28.1-jre</com.google.guava.version>
</properties>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.12</version>
<version>3.3.0</version>
</parent>

<dependencies>
Expand All @@ -50,21 +50,21 @@
<dependency>
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
<version>1.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth</artifactId>
<version>2.5.1.RELEASE</version>
<version>2.5.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.5.1.RELEASE</version>
<version>2.5.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-openid</artifactId>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>5.3.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -76,9 +76,9 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -149,7 +149,7 @@
<dependency>
<groupId>com.icegreen</groupId>
<artifactId>greenmail</artifactId>
<version>1.5.3</version>
<version>2.1.0-rc-1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -230,7 +230,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.7.201606060606</version>
<version>0.8.8</version>
<executions>
<execution>
<id>pre-unit-test</id>
Expand Down Expand Up @@ -285,6 +285,12 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<argLine>
--add-exports java.base/sun.net.www.protocol.http=ALL-UNNAMED
--add-exports java.base/sun.net.www.protocol.https=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.POST;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import java.util.HashMap;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import lombok.extern.slf4j.Slf4j;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

package com.appdirect.sdk.appmarket.events;

import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;

import lombok.extern.slf4j.Slf4j;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
package com.appdirect.sdk.appmarket.saml;

import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.NotNull;

import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

import java.io.IOException;

import javax.mail.MessagingException;
import javax.mail.internet.InternetAddress;
import jakarta.mail.MessagingException;
import jakarta.mail.internet.InternetAddress;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;

import javax.annotation.PostConstruct;
import jakarta.annotation.PostConstruct;
import java.util.List;
import java.util.Map;

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit b9ad6db

Please sign in to comment.