-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepared gradle script for publishing to Maven Central
- Loading branch information
1 parent
23d0449
commit 44c1def
Showing
2 changed files
with
51 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ group 'com.zendesk.jazon' | |
|
||
apply plugin: 'groovy' | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
sourceCompatibility = 1.8 | ||
|
||
|
@@ -22,31 +23,67 @@ task sourceJar(type: Jar, dependsOn: classes) { | |
from sourceSets.main.allSource | ||
} | ||
|
||
task javadocJar(type: Jar) { | ||
classifier = 'javadoc' | ||
from javadoc | ||
} | ||
|
||
artifacts { | ||
archives sourceJar, javadocJar | ||
} | ||
|
||
signing { | ||
sign publishing.publications | ||
} | ||
|
||
publishing { | ||
publications { | ||
jazon(MavenPublication) { | ||
from components.java | ||
artifact sourceJar | ||
artifact javadocJar | ||
pom { | ||
name = 'Jazon' | ||
packaging = 'jar' | ||
description = 'A library for test assertions on JSON payloads.' | ||
url = 'https://github.com/zendesk/jazon' | ||
|
||
scm { | ||
connection = 'scm:git:git://github.com/zendesk/jazon.git' | ||
developerConnection = 'scm:git:ssh://github.com:zendesk/jazon.git' | ||
url = 'http://github.com/zendesk/jazon/tree/master' | ||
} | ||
|
||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id = 'pawel' | ||
name = 'Paweł Mikołajczyk' | ||
email = '[email protected]' | ||
organization = 'Zendesk' | ||
organizationUrl = 'https://zendesk.com' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
if (version.toString().endsWith('-SNAPSHOT')) { | ||
url baseMavenRepoSnapshotsUrl | ||
credentials { | ||
username baseMavenRepoSnapshotsUser | ||
password baseMavenRepoSnapshotsPassword | ||
} | ||
} else { | ||
url baseMavenRepoInternalUrl | ||
credentials { | ||
username baseMavenRepoInternalUser | ||
password baseMavenRepoInternalPassword | ||
} | ||
String snapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots/' | ||
String releaseUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' | ||
url = version.endsWith('SNAPSHOT') ? snapshotUrl : releaseUrl | ||
credentials { | ||
username ossrhUsername | ||
password ossrhPassword | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
dependencies { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version = 0.2 | ||
version = 0.3-alpha |