Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APP-2813/APP-2812 - BDK2.0 modules setup #166

Merged
merged 5 commits into from
Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
# Symphony SDK for Java
# Symphony Java BDK [![CircleCI](https://circleci.com/gh/SymphonyPlatformSolutions/symphony-api-client-java.svg?style=shield)](https://circleci.com/gh/SymphonyPlatformSolutions/symphony-api-client-java) [![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)](https://opensource.org/licenses/MIT) [![Email](https://img.shields.io/static/v1?label=contact&message=email&color=darkgoldenrod)](mailto:platformsolutions@symphony.com?subject=Java%20SDK)

[![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)](https://opensource.org/licenses/MIT) [![Email](https://img.shields.io/static/v1?label=contact&message=email&color=darkgoldenrod)](mailto:platformsolutions@symphony.com?subject=Java%20SDK)
The Symphony Java BDK helps you to create Bots and Applications on top of the [Symphony REST APIs](https://developers.symphony.com/restapi/reference).

Documentation about BDK features and usage is available under [docs](./docs/index.md) folder.

## How to Build

As this project contains modules for the legacy SDK/BDK as well as for the 2.0 ones, some
Maven are defined to make the build faster depending on which version you are working on.

The BDK can be built and published to your local Maven cache using the [Maven Wrapper](https://github.com/takari/maven-wrapper).

**Build Legacy Modules**

The `legacy` profile is activated by default so there is no specific argument to define to have
it part of the build. However, it is also possible to skip legacy modules to be built using argument `-P -legacy`:

```shell script
# build the legacy modules
./mvnw clean install

# skip building legacy modules
./mvnw clean install -P -legacy
```

**Build BDK 2.0 Modules**

Still in construction, the 2.0 modules are deactivated by default but can be activated through the Maven profile `2.0` :

```shell script
# build the 2.0 modules only, skip the legacy ones
./mvnw clean install -P2.0,-legacy
```

This repository aggregates these java libraries:
* [legacy](legacy/README.md)
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Symphony BDK Reference Documentation
18 changes: 18 additions & 0 deletions docs/internal/bdk-architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# BDK Project Architecture

The BDK project is composed in a set of different Maven modules. The approach consists in having one module per BDK
"layer".

## The layers

The BDK is divided in 3 different layers:
- `core` that contains the minimal set of classes to configure, authenticate and use
the main APIs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how will we decide if something is main or advanced?

- `advanced` that contains additional features on top of the core module such as the
command API, the template API or even an NLP integration
- `framework` that provides connectors (or starters) for the main Java frameworks
such as [SpringBoot](https://spring.io/projects/spring-boot),
[MicroProfile](https://projects.eclipse.org/projects/technology.microprofile),
[Micronaut](https://micronaut.io/) or [Quarkus](https://quarkus.io/)

### Core
208 changes: 158 additions & 50 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,31 @@
<artifactId>symphony-api-client-java-parent</artifactId>
<version>1.2.0-SNAPSHOT</version>
<name>Symphony Java BDK Project</name>
<url>https://github.com/SymphonyPlatformSolutions/symphony-api-client-java</url>
<description>Symphony Java BDK Parent</description>
<url>https://github.com/SymphonyPlatformSolutions/symphony-api-client-java</url>
<packaging>pom</packaging>

<modules>
<module>symphony-bdk-legacy</module>
</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<!-- Alphabetical order -->
<apiguardian-api.version>1.1.0</apiguardian-api.version>
<commons-io.version>2.6</commons-io.version>
<commons-lang3.version>3.9</commons-lang3.version>
<lombok.version>1.18.12</lombok.version>
<migbase64.version>2.2</migbase64.version>
<slf4j.version>1.7.30</slf4j.version>

<!-- Test dependencies -->
<junit.version>RELEASE</junit.version>
<logback.version>1.2.3</logback.version>
<mockito.version>3.4.6</mockito.version>
<mockserver.version>5.11.1</mockserver.version>

<!-- Build Configuration -->
<skipTests>false</skipTests>

</properties>

<licenses>
Expand All @@ -42,6 +56,77 @@
<url>https://github.com/SymphonyPlatformSolutions/symphony-api-client-java</url>
</scm>

<dependencyManagement>
<dependencies>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>

<!-- API Guardian -->
<dependency>
<groupId>org.apiguardian</groupId>
<artifactId>apiguardian-api</artifactId>
<version>${apiguardian-api.version}</version>
</dependency>

<!-- Apache commons -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>

<!-- migbase64 -->
<dependency>
<groupId>com.brsanthu</groupId>
<artifactId>migbase64</artifactId>
<version>${migbase64.version}</version>
</dependency>

<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
<scope>runtime</scope>
</dependency>

<!-- Testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mock-server</groupId>
<artifactId>mockserver-netty</artifactId>
<version>${mockserver.version}</version>
<scope>test</scope>
</dependency>

</dependencies>
</dependencyManagement>

<build>
<pluginManagement>
<plugins>
Expand All @@ -54,39 +139,15 @@
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<version>2.22.2</version>
<configuration>
<skipTests>false</skipTests>
<skipTests>${skipTests}</skipTests>
<useSystemClassLoader>false</useSystemClassLoader>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
<printSummary>true</printSummary>
</configuration>
</plugin>
<plugin>
Expand All @@ -110,7 +171,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.5</version>
<executions>
<execution>
<goals>
Expand All @@ -136,13 +197,33 @@
</build>

<profiles>
<!-- Skip gpg sign on Windows where people get the source code and build locally -->

<profile>
<id>legacy</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<modules>
<module>symphony-bdk-legacy</module>
</modules>
</profile>

<profile>
<id>2.0</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<modules>
<module>symphony-bdk-core</module>
<module>symphony-bdk-core-invokers</module>
<module>symphony-bdk-examples</module>
</modules>
</profile>

<profile>
<id>skipStepsOnWindows</id>
<id>release</id>
<activation>
<os>
<family>!windows</family>
</os>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
Expand All @@ -160,19 +241,46 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

</profile>
</profiles>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>
22 changes: 22 additions & 0 deletions symphony-bdk-core-invokers/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>symphony-api-client-java-parent</artifactId>
<groupId>com.symphony.platformsolutions</groupId>
<version>1.2.0-SNAPSHOT</version>
</parent>

<artifactId>symphony-bdk-core-invokers</artifactId>
<name>Symphony Java BDK Core Invokers</name>
<description>Symphony Java BDK Core Invokers Module</description>
<packaging>pom</packaging>

<modules>
<module>symphony-bdk-core-invoker-api</module>
<module>symphony-bdk-core-invoker-jersey2</module>
</modules>

</project>
41 changes: 41 additions & 0 deletions symphony-bdk-core-invokers/symphony-bdk-core-invoker-api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>symphony-bdk-core-invokers</artifactId>
<groupId>com.symphony.platformsolutions</groupId>
<version>1.2.0-SNAPSHOT</version>
</parent>

<artifactId>symphony-bdk-core-invoker-api</artifactId>
<name>Symphony Java BDK Core Invoker API</name>
<description>Symphony Java BDK Core Invoker API Module</description>

<properties>
<jersey.version>2.29.1</jersey.version>
</properties>

<dependencies>
<!-- FIXME: the invoker API should not depend on any HTTP library, the solution here is to fix the OpenAPI generator -->
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>${jersey.version}</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apiguardian</groupId>
<artifactId>apiguardian-api</artifactId>
</dependency>

</dependencies>

</project>
Loading