Skip to content

Commit f1da080

Browse files
committed
configure new respositories/plugin for nexus
1 parent 31d21f4 commit f1da080

File tree

1 file changed

+41
-60
lines changed

1 file changed

+41
-60
lines changed

build.gradle

Lines changed: 41 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ plugins {
1313
// EISOP Checker Framework
1414
id "org.checkerframework" version "0.6.55"
1515

16-
id("org.sonarqube") version "6.2.0.5505"
16+
// Plugin for publishing via the new Nexus API
17+
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
1718
}
1819

1920

@@ -56,9 +57,6 @@ subprojects {
5657

5758
repositories {
5859
mavenCentral()
59-
maven {
60-
url = 'https://git.key-project.org/api/v4/projects/35/packages/maven'
61-
}
6260
}
6361

6462
dependencies {
@@ -81,11 +79,11 @@ subprojects {
8179
testImplementation("ch.qos.logback:logback-classic:1.5.18")
8280

8381
testImplementation(platform("org.junit:junit-bom:5.13.2"))
84-
testImplementation ("org.junit.jupiter:junit-jupiter-api")
85-
testImplementation ("org.junit.jupiter:junit-jupiter-api")
86-
testImplementation ("org.junit.jupiter:junit-jupiter-params")
87-
testRuntimeOnly ("org.junit.jupiter:junit-jupiter-engine")
88-
testRuntimeOnly ("org.junit.platform:junit-platform-launcher")
82+
testImplementation("org.junit.jupiter:junit-jupiter-api")
83+
testImplementation("org.junit.jupiter:junit-jupiter-api")
84+
testImplementation("org.junit.jupiter:junit-jupiter-params")
85+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
86+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
8987
testImplementation project(':key.util')
9088

9189
// test fixtures
@@ -315,59 +313,10 @@ subprojects {
315313
}
316314
repositories {
317315
maven {
318-
/**
319-
* To be able to publish things on Maven Central, you need two things:
320-
*
321-
* (1) a JIRA account with permission on group-id `org.key-project`
322-
* (2) a keyserver-published GPG (w/o sub-keys)
323-
*
324-
* Your `$HOME/.gradle/gradle.properties` should like this:
325-
* ```
326-
* signing.keyId=YourKeyId
327-
* signing.password=YourPublicKeyPassword
328-
* ossrhUsername=your-jira-id
329-
* ossrhPassword=your-jira-password
330-
* ```
331-
*
332-
* You can test signing with `gradle sign`, and publish with `gradle publish`.
333-
* https://central.sonatype.org/publish/publish-guide/
334-
*/
335-
if (project.version.endsWith("-SNAPSHOT")) {
336-
name = "mavenSnapshot"
337-
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
338-
credentials(PasswordCredentials) {
339-
username = project.properties.getOrDefault("ossrhUsername", "")
340-
password = project.properties.getOrDefault("ossrhPassword", "")
341-
}
342-
} else {
343-
name = "mavenStaging"
344-
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
345-
credentials(PasswordCredentials) {
346-
username = project.properties.getOrDefault("ossrhUsername", "")
347-
password = project.properties.getOrDefault("ossrhPassword", "")
348-
}
349-
}
350-
}
351-
352-
/*
353-
maven { // deployment to git.key-project.org
354-
name = "GitlabPackages"
355-
url "https://git.key-project.org/api/v4/projects/35/packages/maven"
356-
credentials(HttpHeaderCredentials) {
357-
if (System.getenv("TOKEN") != null) {
358-
name = 'Private-Token'
359-
value = System.getenv("TOKEN")
360-
} else {
361-
name = 'Job-Token'
362-
value = System.getenv("CI_JOB_TOKEN")
363-
}
364-
}
365-
authentication {
366-
header(HttpHeaderAuthentication)
316+
name = "keylocal"
317+
url= uri("$rootDir/local")
367318
}
368319
}
369-
*/
370-
}
371320
}
372321

373322
signing {
@@ -377,6 +326,38 @@ subprojects {
377326
}
378327
}
379328

329+
330+
nexusPublishing {
331+
repositories {
332+
central {
333+
nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
334+
snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
335+
336+
stagingProfileId.set("org.key-project")
337+
338+
/**
339+
* To be able to publish things on Maven Central, you need two things:
340+
*
341+
* (1) a JIRA account with permission on group-id `org.key-project`
342+
* (2) a keyserver-published GPG (w/o sub-keys)
343+
*
344+
* Your `$HOME/.gradle/gradle.properties` should like this:
345+
* ```
346+
* signing.keyId=YourKeyId
347+
* signing.password=YourPublicKeyPassword
348+
* ossrhUsername=your-jira-id
349+
* ossrhPassword=your-jira-password
350+
* ```
351+
*
352+
* You can test signing with `gradle sign`, and publish with `gradle publish`.
353+
* https://central.sonatype.org/publish/publish-guide/
354+
*/
355+
username = project.properties.getOrDefault("ossrhUsername", "")
356+
password = project.properties.getOrDefault("ossrhPassword", "")
357+
}
358+
}
359+
}
360+
380361
tasks.register('start'){
381362
description = "Use :key.ui:run instead"
382363
doFirst {

0 commit comments

Comments
 (0)