Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add maven-publish.gradle to enable publishing to GitLab #56

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ plugins {
id 'com.github.hierynomus.license' version '0.16.1' apply false
}

subprojects {
// Projects to be published with maven-publish
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 +26,10 @@ subprojects {
}

java {
if (sub.name in publishedProjects) {
withJavadocJar()
}
withSourcesJar()
toolchain {
// `languageVersion` is used to configure the "Java Toolchain" used for the build. This includes `javac`,
// `jlink`, and the `jpackage` tool.
Expand All @@ -45,4 +52,5 @@ subprojects {
}

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

29 changes: 29 additions & 0 deletions gradle/maven-publish.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
subprojects { sub ->

if (sub.name in publishedProjects) {
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)
}
}
}
}
}
}