Skip to content

Commit

Permalink
Merge pull request #4 from sumedhsakdeo/maven_gradle_plugin_prep
Browse files Browse the repository at this point in the history
  • Loading branch information
sumedhsakdeo authored Feb 21, 2024
2 parents 9396240 + bdc65bd commit e799aac
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 11 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ allprojects {
apply plugin: "com.diffplug.spotless"
apply plugin: "com.github.spotbugs"

group = 'com.linkedin.openhouse'

repositories {
maven {
url "https://repo.maven.apache.org/maven2/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {
id 'jacoco'
}

group = 'com.linkedin.openhouse'
sourceCompatibility = '1.8'

ext {
Expand Down
50 changes: 43 additions & 7 deletions buildSrc/src/main/groovy/openhouse.maven-publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@ plugins {
id 'maven-publish'
}

task sourcesJar(type: Jar) {
classifier = "sources"
from sourceSets.main.allSource
}

task javadocJar(type: Jar) {
classifier = "javadoc"
from javadoc.destinationDir
}

[jar, sourcesJar, javadocJar].each { task ->
task.from(rootDir) {
include 'LICENSE'
include 'NOTICE'
}
}

def pomPath = "$buildDir/${name}.pom"
model {
tasks.generatePomFileForMavenJavaPublication {
Expand All @@ -12,15 +29,32 @@ model {
}
}

java {
withSourcesJar()
withJavadocJar()
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java

artifact sourcesJar
artifact javadocJar

pom {
name = 'OpenHouse'
description = 'Control Plane for Tables in Open Data Lakehouse'
url = 'https://github.com/linkedin/openhouse'

licenses {
license {
name = 'BSD 2-Clause License'
url = 'https://raw.githubusercontent.com/linkedin/openhouse/main/LICENSE'
}
}

scm {
connection = 'scm:git:git://github.com/linkedin/openhouse.git'
developerConnection = 'scm:git:ssh://github.com/linkedin/openhouse.git'
url = 'https://github.com/linkedin/openhouse'
}
}
}
}
repositories {
Expand All @@ -29,6 +63,8 @@ publishing {
}

artifacts {
archives file: file("$pomPath"), name: "$name", type: "pom"
archives jar, sourcesJar, javadocJar
archives file: file('$pomPath'), name: '$name', type: 'pom'
archives jar
archives sourcesJar
archives javadocJar
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// plugin for extensible springboot apps
// plugin for extensible springboot services
plugins {
id 'openhouse.springboot-conventions'
}
Expand All @@ -17,3 +17,10 @@ tasks.named("bootJar") {
attributes ('Main-Class': 'org.springframework.boot.loader.PropertiesLauncher')
}
}

configurations {
[apiElements, runtimeElements].each {
it.outgoing.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(jar) }
it.outgoing.artifact(bootJar)
}
}
1 change: 1 addition & 0 deletions housetables-service.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ COPY $JAR_FILES ./
RUN ls ./
RUN find . -name "*-sources.jar" -delete
RUN find . -name "*-javadoc.jar" -delete
RUN find . -name "*-lib.jar" -delete

# Rename the JAR file.
RUN ls ./
Expand Down
5 changes: 3 additions & 2 deletions services/housetables/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'openhouse.springboot-conventions'
id 'openhouse.springboot-ext-conventions'
id 'openhouse.hadoop-conventions'
id 'openhouse.iceberg-conventions'
id 'openhouse.maven-publish'
Expand All @@ -8,7 +8,8 @@ plugins {
* Invalid plugin request [id: 'org.springframework.boot', version: '2.1.2.RELEASE'].
* Plugin requests from precompiled scripts must not include a version number.
* Please remove the version from the offending request and make sure the module
* containing the requested plugin 'org.springframework.boot' is an implementation dependency.*/
* containing the requested plugin 'org.springframework.boot' is an implementation dependency.
*/
id 'org.springframework.boot' version '2.1.2.RELEASE'

/**
Expand Down

0 comments on commit e799aac

Please sign in to comment.