Skip to content

Commit bd8fd35

Browse files
author
Nilan
committed
Prepare publishing.
1 parent 5dcbecd commit bd8fd35

File tree

2 files changed

+65
-3
lines changed

2 files changed

+65
-3
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.jar
22
.idea
33
build
4-
.gradle
4+
.gradle
5+
gradle.properties

build.gradle

+63-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,73 @@
1+
apply plugin: 'java'
2+
apply plugin: 'maven'
3+
apply plugin: 'signing'
4+
15
group 'cool.graph.cuid-java'
6+
archivesBaseName = 'cuid-java'
27
version '0.1.0-SNAPSHOT'
38

4-
apply plugin: 'java'
5-
69
repositories {
710
mavenCentral()
811
}
912

1013
dependencies {
1114
testCompile group: 'junit', name: 'junit', version: '4.11'
1215
}
16+
17+
task sourcesJar(type: Jar) {
18+
classifier = 'sources'
19+
from sourceSets.main.allSource
20+
}
21+
22+
artifacts {
23+
archives sourcesJar
24+
}
25+
26+
signing {
27+
sign configurations.archives
28+
}
29+
30+
uploadArchives {
31+
repositories {
32+
mavenDeployer {
33+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
34+
35+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
36+
authentication(userName: ossrhUsername, password: ossrhPassword)
37+
}
38+
39+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
40+
authentication(userName: ossrhUsername, password: ossrhPassword)
41+
}
42+
43+
pom.project {
44+
name 'cuid-java'
45+
packaging 'jar'
46+
// optionally artifactId can be defined here
47+
description 'A application used as an example on how to set up pushing its components to the Central Repository.'
48+
url 'http://www.example.com/example-application'
49+
50+
scm {
51+
connection 'scm:svn:http://foo.googlecode.com/svn/trunk/'
52+
developerConnection 'scm:svn:https://foo.googlecode.com/svn/trunk/'
53+
url 'http://foo.googlecode.com/svn/trunk/'
54+
}
55+
56+
licenses {
57+
license {
58+
name 'The Apache License, Version 2.0'
59+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
60+
}
61+
}
62+
63+
developers {
64+
developer {
65+
id 'manfred'
66+
name 'Manfred Moser'
67+
68+
}
69+
}
70+
}
71+
}
72+
}
73+
}

0 commit comments

Comments
 (0)