Skip to content

Add gradle to documentation #58

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

Merged
merged 1 commit into from
May 5, 2019
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
68 changes: 40 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,37 @@ It encourages to adapt to existing implementations instead the other way around.
# Frameworks
## Setup
### Maven
First define the version to be used and set it as a property

```xml
<properties>
<myndocs.oauth.version>0.5.0</myndocs.oauth.version>
</properties>
```

Include the following repository in order to download the artifacts
```xml
<dependencies>
<dependency>
<groupId>nl.myndocs</groupId>
<artifactId>oauth2-server-core</artifactId>
<version>${myndocs.oauth.version}</version>
</dependency>

<!-- In memory dependencies -->
<dependency>
<groupId>nl.myndocs</groupId>
<artifactId>oauth2-server-client-inmemory</artifactId>
<version>${myndocs.oauth.version}</version>
</dependency>
<dependency>
<groupId>nl.myndocs</groupId>
<artifactId>oauth2-server-identity-inmemory</artifactId>
<version>${myndocs.oauth.version}</version>
</dependency>
<dependency>
<groupId>nl.myndocs</groupId>
<artifactId>oauth2-server-token-store-inmemory</artifactId>
<version>${myndocs.oauth.version}</version>
</dependency>
</dependencies>

<repositories>
<repository>
<id>myndocs-oauth2</id>
Expand All @@ -25,32 +47,22 @@ Include the following repository in order to download the artifacts
</repositories>
```

For the frameworks examples we need at least the following dependencies:
```xml
<dependency>
<groupId>nl.myndocs</groupId>
<artifactId>oauth2-server-core</artifactId>
<version>${myndocs.oauth.version}</version>
</dependency>

<!-- In memory dependencies -->
<dependency>
<groupId>nl.myndocs</groupId>
<artifactId>oauth2-server-client-inmemory</artifactId>
<version>${myndocs.oauth.version}</version>
</dependency>
<dependency>
<groupId>nl.myndocs</groupId>
<artifactId>oauth2-server-identity-inmemory</artifactId>
<version>${myndocs.oauth.version}</version>
</dependency>
<dependency>
<groupId>nl.myndocs</groupId>
<artifactId>oauth2-server-token-store-inmemory</artifactId>
<version>${myndocs.oauth.version}</version>
</dependency>
### Gradle
```groovy
repositories {
maven { url 'https://dl.bintray.com/adhesivee/oauth2-server' }
}

dependencies {
compile "nl.myndocs:oauth2-server-core:$myndocs_oauth_version"
// In memory dependencies
compile "nl.myndocs:oauth2-server-client-inmemory:$myndocs_oauth_version"
compile "nl.myndocs:oauth2-server-identity-inmemory:$myndocs_oauth_version"
compile "nl.myndocs:oauth2-server-token-store-inmemory:$myndocs_oauth_version"
}
```


### Framework implementation
The following frameworks are supported:
- [Ktor](docs/ktor.md)
Expand Down
8 changes: 8 additions & 0 deletions docs/http4k.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# http4k

## Dependencies

### Maven
```xml
<dependency>
<groupId>nl.myndocs</groupId>
Expand All @@ -9,6 +11,12 @@
</dependency>
```

### Gradle
```groovy
compile "nl.myndocs:oauth2-server-http4k:$myndocs_oauth_version"
```


## Implementation
```kotlin
val app: HttpHandler = routes(
Expand Down
7 changes: 7 additions & 0 deletions docs/javalin.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Javalin

## Dependencies

### Maven
```xml
<dependency>
<groupId>nl.myndocs</groupId>
Expand All @@ -9,6 +11,11 @@
</dependency>
```

### Gradle
```groovy
compile "nl.myndocs:oauth2-server-javalin:$myndocs_oauth_version"
```

## Implementation
```kotlin
Javalin.create().apply {
Expand Down
6 changes: 6 additions & 0 deletions docs/ktor.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Dependencies

### Maven
```xml
<dependency>
<groupId>nl.myndocs</groupId>
Expand All @@ -10,6 +11,11 @@
</dependency>
```

### Gradle
```groovy
compile "nl.myndocs:oauth2-server-ktor:$myndocs_oauth_version"
```

## Implementation
```kotlin
embeddedServer(Netty, 8080) {
Expand Down
7 changes: 7 additions & 0 deletions docs/sparkjava.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Spark java

## Dependencies

### Maven
```xml
<dependency>
<groupId>nl.myndocs</groupId>
Expand All @@ -9,6 +11,11 @@
</dependency>
```

### Gradle
```groovy
compile "nl.myndocs:oauth2-server-sparkjava:$myndocs_oauth_version"
```

## Implementation
```kotlin
Oauth2Server.configureOauth2Server {
Expand Down