-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added mavenJava publication and oss repo for publishing to maven central
Added signing plugin for signing sourcesJar and javadocJar Removed bintray and jfrog tasks
- Loading branch information
1 parent
75213e0
commit 6c45340
Showing
1 changed file
with
54 additions
and
36 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 |
---|---|---|
|
@@ -10,6 +10,7 @@ plugins { | |
id "com.jfrog.bintray" version "1.8.5" | ||
id "com.jfrog.artifactory" version "4.15.2" | ||
id "maven-publish" | ||
id 'signing' | ||
} | ||
|
||
configurations { | ||
|
@@ -101,9 +102,48 @@ publishing { | |
def snapshotVersion = project.version.replaceAll("\\.${buildNumber}", '') + '-SNAPSHOT' | ||
version snapshotVersion | ||
} | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
artifact sourcesJar | ||
artifact javadocJar | ||
groupId project.group | ||
artifactId project.name | ||
version project.version | ||
pom { | ||
name = 'mobiTopp' | ||
description = 'mobiTopp (http://mobitopp.ifv.kit.edu/) is an agent-based travel demand model developed at the Institute for transport studies at the Karlsruhe Institute of Technology (http://www.ifv.kit.edu/english/index.php). Publications about mobiTopp can be found on the project site (http://mobitopp.ifv.kit.edu/28.php).' | ||
url = 'https://github.com/kit-ifv/mobitopp' | ||
licenses { | ||
license { | ||
name = 'GNU GENERAL PUBLIC LICENSE, Version 3' | ||
url = 'https://www.gnu.org/licenses/gpl-3.0-standalone.html' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'lb' | ||
name = 'Lars Briem' | ||
email = '[email protected]' | ||
} | ||
developer { | ||
id = 'jk' | ||
name = 'Jelle Kuebler' | ||
email = '[email protected]' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:git:https://github.com/kit-ifv/mobitopp.git' | ||
developerConnection = 'scm:git:ssh:[email protected]:kit-ifv/mobitopp.git' | ||
url = 'https://github.com/kit-ifv/mobitopp' | ||
} | ||
} | ||
|
||
} | ||
|
||
} | ||
repositories { | ||
maven { | ||
name = 'Internal' | ||
credentials { | ||
username getPropertyOrDefault('repositoryUsername') | ||
password getPropertyOrDefault('repositoryPassword') | ||
|
@@ -113,48 +153,26 @@ publishing { | |
def snapshotsRepoUrl = "${repositoryUrl}/repository/maven-snapshots" | ||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | ||
} | ||
} | ||
} | ||
maven { | ||
name = 'External' | ||
credentials { | ||
username getPropertyOrDefault('user_oss') | ||
password getPropertyOrDefault('pw_oss') | ||
} | ||
|
||
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" | ||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | ||
} | ||
|
||
artifactory { | ||
contextUrl = 'http://oss.jfrog.org' | ||
publish { | ||
repository { | ||
repoKey = 'oss-snapshot-local' | ||
username = project.hasProperty('user') ? project.property('user') : 'user' | ||
password = project.hasProperty('key') ? project.property('key') : 'key' | ||
} | ||
defaults { | ||
publications('snapshot') | ||
publishArtifacts = true | ||
publishPom = true | ||
} | ||
} | ||
resolve { | ||
repoKey = 'jcenter' | ||
} | ||
def buildnumber = project.hasProperty('build.number') ? project.property('build.number') : '' | ||
clientConfig.info.setBuildNumber(buildnumber) | ||
} | ||
|
||
bintray { | ||
user = project.hasProperty('user') ? project.property('user') : 'user' | ||
key = project.hasProperty('key')? project.property('key') : 'key' | ||
publications = ['release'] | ||
pkg { | ||
repo = 'ifv-mobitopp' | ||
name = project.name | ||
userOrg = 'ifv-mobitopp' | ||
licenses = ['GPL-3.0'] | ||
vcsUrl = 'https://github.com/ifv-mobitopp/mobitopp' | ||
version { | ||
name = project.version | ||
description = project.version | ||
released = new Date() | ||
} | ||
} | ||
signing { | ||
sign publishing.publications.mavenJava | ||
} | ||
|
||
|
||
def getPropertyOrDefault(key) { | ||
return project.hasProperty(key) ? project.property(key) : key | ||
} |