Skip to content

Commit

Permalink
Add maven-publish.gradle to enable publishing to GitLab
Browse files Browse the repository at this point in the history
  • Loading branch information
msgilligan committed Sep 3, 2024
1 parent 96a165f commit 2935d91
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
9 changes: 8 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ plugins {
id 'com.github.hierynomus.license' version '0.16.1' apply false
}

subprojects {
ext.publishedProjects = ['secp-api', 'secp-ffm', 'secp-bouncy']

subprojects { sub ->
apply plugin: 'java'
apply plugin: 'groovy'
//apply plugin: 'test-report-aggregation'
Expand All @@ -23,6 +25,10 @@ subprojects {
}

java {
if (sub.name in publishedProjects) {
withJavadocJar()
}
withSourcesJar()
sourceCompatibility = JavaVersion.toVersion("22")
targetCompatibility = JavaVersion.toVersion("22")
toolchain {
Expand All @@ -47,4 +53,5 @@ subprojects {
}

apply from: 'gradle/licenseCheck.gradle'
apply from: 'gradle/maven-publish.gradle'

26 changes: 26 additions & 0 deletions gradle/maven-publish.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
subprojects {
apply plugin: 'maven-publish'

publishing {
publications {
jar(MavenPublication) {
from components.java
}

}
repositories {
def secpJdkGitLabProjectId = "55956336"
maven {
url "https://gitlab.com/api/v4/projects/${secpJdkGitLabProjectId}/packages/maven"
name "GitLab"
credentials(HttpHeaderCredentials) {
name = 'Private-Token'
value = project.findProperty("gitLabMavenToken")
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
}

0 comments on commit 2935d91

Please sign in to comment.