11plugins {
2- // Apply the java-library plugin to add support for Java Library
32 id ' java-library'
43 id ' maven-publish'
4+ id ' signing'
55}
66
77group = ' org.cryptimeleon'
8- version = ' 1.0.0' + (Boolean . valueOf(System . getProperty(" disablesnapshot" )) ? " " : " -SNAPSHOT" )
8+ archivesBaseName = project. name
9+ boolean isRelease = project. hasProperty(" release" )
10+ version = ' 1.0.0' + (isRelease ? " " : " -SNAPSHOT" )
911
10- description = """ """
12+ description = ' The Math library provides the mathematical foundation for the other Cryptimeleon libraries. ' +
13+ ' It provides basics such as mathematical groups, rings and fields, e.g. Z_n , ' +
14+ ' as well as implementations of cryptographic pairings.'
1115
1216sourceCompatibility = 1.8
1317targetCompatibility = 1.8
@@ -18,12 +22,9 @@ tasks.withType(JavaCompile) {
1822
1923
2024repositories {
21- jcenter()
22- mavenCentral()
2325 mavenLocal()
24- maven { url " https://nexus.cs.upb.de/repository/sfb901-libs/" }
25- maven { url " https://nexus.cs.upb.de/repository/sfb901-releases/" }
26- maven { url " https://nexus.cs.upb.de/repository/sfb901-snapshots/" }
26+ mavenCentral()
27+ jcenter()
2728}
2829
2930dependencies {
@@ -94,27 +95,82 @@ java {
9495 registerFeature(" tests" ) {
9596 usingSourceSet(sourceSets. test)
9697 }
98+ withJavadocJar()
99+ withSourcesJar()
97100}
98101
102+
99103publishing {
100104 publications {
101105 mavenJava(MavenPublication ) {
102106 from components. java
103- artifact sourcesJar
104- artifact javadocJar
107+ versionMapping {
108+ usage(' java-api' ) {
109+ fromResolutionOf(' runtimeClasspath' )
110+ }
111+ usage(' java-runtime' ) {
112+ fromResolutionResult()
113+ }
114+ }
115+ artifacts {
116+ archives javadocJar, sourcesJar
117+ }
118+
119+ pom {
120+ name = ' Math'
121+ url = ' https://cryptimeleon.org'
122+ licenses {
123+ license {
124+ name = ' The Apache License, Version 2.0'
125+ url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
126+ }
127+ }
128+ developers {
129+ developer {
130+ id = ' jbobolz'
131+ name = ' Jan Bobolz'
132+ email = ' mail@jan-bobolz.de'
133+ organization = ' Paderborn University'
134+ }
135+ developer {
136+ id = ' feidens'
137+ name = ' Fabian Eidens'
138+ email = ' fabianeidens@gmail.com'
139+ organization = ' Paderborn University'
140+ url = ' https://feidens.github.io/'
141+ }
142+ developer {
143+ id = ' rheitjoh'
144+ name = ' Raphael Heitjohann'
145+ email = ' rheitjoh@mail.uni-paderborn.de'
146+ organization = ' Paderborn University'
147+ }
148+ }
149+ scm {
150+ connection = ' scm:git:git://github.com/cryptimeleon/math.git'
151+ developerConnection = ' scm:git:https://github.com/cryptimeleon/math.git'
152+ url = ' https://github.com/cryptimeleon/math/'
153+ }
154+ }
105155 }
106156 }
107-
108157 repositories {
109158 maven {
110159 credentials {
111- username = System . getProperty( ' nexus.user ' )
112- password = System . getProperty( ' nexus.key ' )
160+ username = System . getenv( " OSSRH_USERNAME " )
161+ password = System . getenv( " OSSRH_TOKEN " )
113162 }
114- def releasesRepoUrl = " https://nexus.cs.upb.de/repository/sfb901-releases/ "
115- def snapshotsRepoUrl = " https://nexus.cs.upb.de/repository/sfb901-snapshots/ "
116- url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
163+ name = ' OSSRH '
164+ def releasesRepoUrl = ' https://oss.sonatype.org/service/local/staging/deploy/maven2/ '
165+ url = version. endsWith(' SNAPSHOT' ) ? ' ' : releasesRepoUrl
117166 }
118167 }
119168}
120169
170+ signing {
171+ required(project. hasProperty(" release" ))
172+ def signingKey = findProperty(" signingKey" )
173+ def signingPassword = findProperty(" signingPassword" )
174+ useInMemoryPgpKeys(signingKey, signingPassword)
175+ sign publishing. publications. mavenJava
176+ }
0 commit comments