Commit a21b59fb authored by Thilo Rörig's avatar Thilo Rörig

publishing to maven local repo and local artifactory repo

parent 555dd445
Pipeline #424 failed with stages
in 41 seconds
plugins {
id 'java-library'
id "java"
id "java-library"
id "maven-publish"
id "signing"
}
group = 'de.jtem'
......@@ -26,3 +29,74 @@ dependencies {
repositories {
jcenter()
}
task sourcesJar(type: Jar) {
archiveClassifier = "sources"
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
archiveClassifier = "javadoc"
from javadoc.destinationDir
}
javadocJar.dependsOn(javadoc)
artifacts {
archives javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
publishing {
publications {
halfedgeLibrary(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'Halfedge Library'
packaging 'jar'
description = 'The library provides an implementation of a halfedge ' +
'datastructure for the representation of oriented surfaces.'
url = 'https://gitlab.discretization.de/jtem/halfedge'
licenses {
license {
name = 'The 2-Clause BSD License'
url = 'https://opensource.org/licenses/bsd-license.php'
}
}
developers {
developer {
id = 'jtem-group'
name = 'jtem group'
email = 'jtem@math.tu-berlin.de'
}
}
}
}
}
repositories {
maven {
name = 'local'
def releasesRepoUrl = "file://$buildDir/repo/releases"
def snapshotsRepoUrl = "file://$buildDir/repo/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
maven {
name = 'localArtifactory'
def artifactoryUrl = "http://127.0.0.1:8081/artifactory"
def releasesRepoUrl = artifactoryUrl + "/libs-release-local"
def snapshotsRepoUrl = artifactoryUrl + "/libs-snapshots-local"
credentials{
username "$artifactory_user"
password "$artifactory_password"
}
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment