Skip to content
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
20 changes: 20 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: publish maven package

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 11
java-package: jdk
- run: ./gradlew clean :client:publishClientPublicationToRegulaforensicsRepository
env:
ORG_GRADLE_PROJECT_version: ${{ github.event.release.name }}
ORG_GRADLE_PROJECT_regulaforensicsMavenUser: ${{secrets.MAVEN_PUBLISH_USER}}
ORG_GRADLE_PROJECT_regulaforensicsMavenPassword: ${{secrets.MAVEN_PUBLISH_PASSWORD}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.gradle
.idea
build
gradle.properties
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@ You are invited to contribute [new features, fixes, or updates](https://github.c


## Install package
tbd maven deploy
Add __Regula Forensics, Inc.__ maven repository to repositories section in your `build.gradle`,
and declare client as regular dependency.

```gradle
repositories {
maven {
url = uri("https://maven.regulaforensics.com/RegulaDocumentReaderWebClient")
}
}

dependencies {
implementation("com.regula.documentreader:webclient:5.2.0")
}
```

## Example
Performing request:
Expand Down
3 changes: 1 addition & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ plugins {
}

allprojects {
group = "com.regulaforensics.docreader"
version = "5.1.0"
group = "com.regula.documentreader"

repositories {
jcenter()
Expand Down
37 changes: 37 additions & 0 deletions client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
plugins {
java
id("com.github.sherter.google-java-format") version "0.9"
id("maven-publish")
}

java {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
withSourcesJar()
}

sourceSets.main {
Expand All @@ -22,3 +24,38 @@ dependencies {
implementation("javax.annotation:javax.annotation-api:1.3.2")
implementation("com.google.code.findbugs:jsr305:3.0.2")
}

/* ----------- Publishing config ------------------- */
// supressed for local development
// if you need to publish from local machine, create `gradle.properties` file in a project root and add 3 vairables:
// - version
// - regulaforensicsMavenUser
// - regulaforensicsMavenPassword
if (project.hasProperty("regulaforensicsMavenUser")) {

val regulaforensicsMavenPassword: String by project
val regulaforensicsMavenUser: String by project

publishing {
publications {
create<MavenPublication>("client") {
artifactId = "webclient"
from(components["java"])
}
}
repositories {
maven {

val releasesRepoUrl = uri("sftp://maven.regulaforensics.com:22/RegulaDocumentReaderWebClient")
val betaRepoUrl = uri("sftp://maven.regulaforensics.com:22/RegulaDocumentReaderWebClient/Beta")

name = "regulaforensics"
url = if (version.toString().contains("beta")) betaRepoUrl else releasesRepoUrl
credentials {
username = regulaforensicsMavenUser
password = regulaforensicsMavenPassword
}
}
}
}
}