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

Maven central setup #73

Merged
merged 3 commits into from
Apr 7, 2022
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
**/gradle
**/gradlew
**/gradlew.bat

.env
10 changes: 10 additions & 0 deletions .env-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#.env is only used in the docker-compose files

#
SIGNING_PRIVATE_KEY=
SIGNING_PRIVATE_KEY_PASSWORD=
SIGNING_KEY_ID=

#
CENTRAL_USER=
CENTRAL_PASSWORD=
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,7 @@ docs/node_modules
app/carnival-core/data

# scratch code
*.groovy_
*.groovy_

.env
*.gpg
12 changes: 11 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ buildscript {
plugins {
id 'groovy'
id 'maven-publish'
id 'signing'
id "com.github.ManifestClasspath" version "0.1.0-RELEASE"

// code coverage
Expand Down Expand Up @@ -131,14 +132,23 @@ subprojects {
}
}


///////////////////////////////////////////////////////////////////////////////
// Github Publish
///////////////////////////////////////////////////////////////////////////////
subprojects {
apply plugin: "maven-publish"
publishing {
repositories {
maven {
name = "Central"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = project.findProperty("central.user") ?: System.getenv("CENTRAL_USER")
password = project.findProperty("central.password") ?: System.getenv("CENTRAL_PASSWORD")
}
}
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/pmbb-ibi/carnival")
Expand Down
15 changes: 11 additions & 4 deletions app/carnival-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,25 @@ task javadocJar(type: Jar) {
classifier = 'javadoc'
}

apply plugin: "signing"
signing {
sign publishing.publications
}

publishing {
publications {
mavenGroovy(MavenPublication) {
artifactId = 'carnival-core'
from components.java
artifact sourcesJar
artifact javadocJar

pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name 'Carnival Core'
description 'The core classes of the Carnival framework'
url 'https://github.com/pmbb-ibi/carnival'
url 'https://github.com/carnival-data/carnival'
licenses {
license {
name 'GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007'
Expand All @@ -55,9 +61,9 @@ publishing {
}
}
scm {
connection 'scm:git:git://github.com:pmbb-ibi/carnival.git'
developerConnection 'scm:git:ssh://github.com:pmbb-ibi/carnival.git'
url 'https://github.com/pmbb-ibi/carnival'
connection 'scm:git:git://github.com/carnival-data/carnival.git'
developerConnection 'scm:git:ssh://github.com:carnival-data/carnival.git'
url 'https://github.com/carnival-data/carnival'
}
}
}
Expand All @@ -73,6 +79,7 @@ publishing {
}
repositories {
maven {
// mavenCentral {
// change URLs to point to your repos, e.g. http://my.org/repo
def releasesRepoUrl = "$buildDir/repos/releases"
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
Expand Down
2 changes: 1 addition & 1 deletion app/carnival-gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath group:'org.carnival', name:'carnival-gradle', version:'0.2.7'
classpath group:'io.github.carnival-data', name:'carnival-gradle', version:'0.2.7'
}
}
apply plugin: 'carnival.application'
Expand Down
5 changes: 5 additions & 0 deletions app/carnival-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ task javadocJar(type: Jar) {
classifier = 'javadoc'
}

apply plugin: "signing"
signing {
sign publishing.publications
}

publishing {
publications {
mavenGroovy(MavenPublication) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ class CarnivalApplicationPlugin implements Plugin<Project> {
implementation "org.neo4j.driver:neo4j-java-driver:${neo4JavaDriverVersion}"

// Carnival
implementation("org.carnival:carnival-util:${carnivalVersion}")
implementation("org.carnival:carnival-graph:${carnivalVersion}")
implementation("org.carnival:carnival-core:${carnivalVersion}")
implementation("io.github.carnival-data:carnival-util:${carnivalVersion}")
implementation("io.github.carnival-data:carnival-graph:${carnivalVersion}")
implementation("io.github.carnival-data:carnival-core:${carnivalVersion}")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class CarnivalLibraryPlugin implements Plugin<Project> {
implementation "org.neo4j.driver:neo4j-java-driver:${neo4JavaDriverVersion}"

// Carnival
implementation("org.carnival:carnival-util:${carnivalVersion}")
implementation("org.carnival:carnival-graph:${carnivalVersion}")
implementation("org.carnival:carnival-core:${carnivalVersion}")
implementation("io.github.carnival-data:carnival-util:${carnivalVersion}")
implementation("io.github.carnival-data:carnival-graph:${carnivalVersion}")
implementation("io.github.carnival-data:carnival-core:${carnivalVersion}")
}
}
}
5 changes: 5 additions & 0 deletions app/carnival-graph/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ task javadocJar(type: Jar) {
classifier = 'javadoc'
}

apply plugin: "signing"
signing {
sign publishing.publications
}

publishing {
publications {
mavenGroovy(MavenPublication) {
Expand Down
5 changes: 5 additions & 0 deletions app/carnival-util/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ task javadocJar(type: Jar) {
classifier = 'javadoc'
}

apply plugin: "signing"
signing {
sign publishing.publications
}

publishing {
publications {
mavenGroovy(MavenPublication) {
Expand Down
18 changes: 17 additions & 1 deletion app/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,20 @@ neo4JavaDriverVersion=4.1.1
javaVersion=11
# carnival
carnivalGroup=org.carnival
carnivalVersion=2.1.1-SNAPSHOT
carnivalVersion=2.1.4-SNAPSHOT

#When using Docker, these values are set for docker-compose in ../.env
#If not using Docker, set these values in another gradle.properties in your home directory

#GPG Signing Info for submission to Central Repository
#signing.keyId=
#signing.password=
#signing.secretKeyRingFile=

#Central Repository Authentication
#central.user=
#central.password=

#GitHub Packages Authentication
#gpr.user=
#gpr.key=
16 changes: 16 additions & 0 deletions docker-compose-publish-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3'

services:
app:
build:
context: .
dockerfile: Dockerfile
working_dir: /appsrc/app
command: >
gradle publishAllPublicationsToGitHubPackagesRepository
--no-daemon
--dry-run
tty: true
stdin_open: true
volumes:
- ./:/appsrc
21 changes: 21 additions & 0 deletions docker-compose-publish-maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3'

services:
app:
build:
context: .
dockerfile: Dockerfile
working_dir: /appsrc/app
command: >
gradle publishAllPublicationsToCentralRepository
-Psigning.secretKeyRingFile=/appsrc/signing_private.gpg
-Psigning.password=${SIGNING_PRIVATE_KEY_PASSWORD}
-Psigning.keyId=${SIGNING_KEY_ID}
-Pcentral.user=${CENTRAL_USER}
-Pcentral.password=${CENTRAL_PASSWORD}
--no-daemon
tty: true
stdin_open: true
volumes:
- ./:/appsrc
- ${SIGNING_PRIVATE_KEY}:/appsrc/signing_private.gpg
2 changes: 1 addition & 1 deletion docs/groovy/graph-method-1.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// DEPENDENCIES
///////////////////////////////////////////////////////////////////////////////

@Grab('org.carnival:carnival-core:2.1.1-SNAPSHOT')
@Grab('io.github.carnival-data:carnival-core:2.1.1-SNAPSHOT')
@Grab('org.apache.tinkerpop:gremlin-core:3.4.10')


Expand Down
2 changes: 1 addition & 1 deletion docs/groovy/graph-model-1.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// DEPENDENCIES
///////////////////////////////////////////////////////////////////////////////

@Grab('org.carnival:carnival-core:2.1.1-SNAPSHOT')
@Grab('io.github.carnival-data:carnival-core:2.1.1-SNAPSHOT')
@Grab('org.apache.tinkerpop:gremlin-core:3.4.10')


Expand Down
2 changes: 1 addition & 1 deletion docs/groovy/graph-model-2.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// DEPENDENCIES
///////////////////////////////////////////////////////////////////////////////

@Grab('org.carnival:carnival-core:2.1.1-SNAPSHOT')
@Grab('io.github.carnival-data:carnival-core:2.1.1-SNAPSHOT')
@Grab('org.apache.tinkerpop:gremlin-core:3.4.10')


Expand Down