Skip to content

Commit f25a5fe

Browse files
author
Narine C
authored
Merge pull request #21 from csync/maven-publish
Maven publish
2 parents 2bf9e05 + ee0232f commit f25a5fe

File tree

2 files changed

+60
-16
lines changed

2 files changed

+60
-16
lines changed

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,19 @@ The ACL for a key is set when the key is created by the first write performed to
7272
# Getting Started
7373

7474
Adding the java SDK to your java project:
75-
76-
1. Build the csync-java SDK either in an IDE or from the command line using the command `gradle build`. This will generate the CSync .jar file in your `build/libs` directory.
77-
2. From your java project, navigate to `File -> Project Structure` as shown in the screenshot below:
78-
79-
<img src="images/projectStructure.png" width="300">
80-
81-
3. Click on `Libraries`
82-
4. Click the `+` sign and select `Java`
83-
5. Navigate to the directory that contains the jar file for CSync.
84-
85-
Note: if you are using a gradle project, add the CSync SDK as a dependency in your `build.gradle` file like this:
86-
`compile files('/Users/narinecholakyan/Documents/csync-java/build/libs/csync-1.0-SNAPSHOT.jar')`
75+
76+
Maven:
77+
```
78+
<dependency>
79+
<groupId>com.ibm.csync</groupId>
80+
<artifactId>csync-java</artifactId>
81+
<version>1.4.0</version>
82+
</dependency>
83+
```
84+
Gradle:
85+
```
86+
compile 'com.ibm.csync:csync-java:1.4.0'
87+
```
8788

8889
#Usage
8990

build.gradle

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
1+
plugins {
2+
id "com.jfrog.bintray" version "1.7.3"
3+
}
4+
5+
def mavenVersion='1.4.0'
16
group 'com.ibm'
2-
version '1.0-SNAPSHOT'
7+
version "${mavenVersion}"
38

49
apply plugin: 'java'
510
apply plugin: 'application'
11+
apply plugin: 'maven-publish'
612

713
mainClassName = "Main"
814

915
sourceCompatibility = 1.8
1016

1117
repositories {
1218
mavenCentral()
19+
jcenter()
1320
}
1421

22+
1523
compileJava {
1624
options.compilerArgs << "-Xlint:all" << "-Werror"
1725
}
@@ -23,14 +31,49 @@ dependencies {
2331
compile group: 'com.squareup.okhttp3', name: 'okhttp-ws', version: '3.4.2'
2432
compile group: 'com.google.guava', name: 'guava', version: '20.0'
2533
compile group: 'com.h2database', name: 'h2', version: '1.4.193'
26-
//compile group: 'com.github.davidmoten', name: 'rxjava-jdbc', version: '0.7.3'
27-
//compile group: 'com.appunite', name : 'websockets-rxjava', version : '4.0.1'
2834
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
2935
testCompile group: 'junit', name: 'junit', version: '4.11'
3036
}
3137

38+
publishing {
39+
repositories {
40+
maven{
41+
url "github.com/csync/csync-java"
42+
}
43+
}
44+
publications {
45+
mavenJava(MavenPublication) {
46+
from components.java
47+
artifact sourcesJar
48+
groupId 'com.ibm.csync'
49+
artifactId 'csync-java'
50+
version "${mavenVersion}"
51+
}
52+
}
53+
}
54+
55+
bintray {
56+
user = System.getenv('BINTRAY_USER')
57+
key = System.getenv('BINTRAY_KEY')
58+
publications = ['mavenJava']
59+
pkg {
60+
version {
61+
name = "${mavenVersion}"
62+
}
63+
repo = 'maven'
64+
name = 'csync-java'
65+
licenses = ['Apache-2.0']
66+
vcsUrl = 'https://github.com/csync/csync-java.git'
67+
}
68+
}
69+
3270
jar {
3371
from {
3472
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
3573
}
36-
}
74+
}
75+
76+
task sourcesJar(type: Jar, dependsOn: classes) {
77+
classifier = 'sources'
78+
from sourceSets.main.allSource
79+
}

0 commit comments

Comments
 (0)