From ca535542f3f04f183b22913631c56ff866bd8d14 Mon Sep 17 00:00:00 2001 From: alexradzin Date: Sun, 10 Sep 2023 11:43:00 +0300 Subject: [PATCH] publishing artifact to the central maven repository updated java version to 17 because it is required by plugin org.quiltmc.gradle.licenser. Source and target compatibility is still 11. --- .github/workflows/build.yml | 6 +- .github/workflows/code-analysis.yml | 4 +- .github/workflows/integration-test.yml | 2 +- .github/workflows/release.yml | 4 +- build.gradle | 74 +++++++++++++++++-- gradle.properties | 2 +- .../FireboltDatabaseMetadataTest.java | 2 +- .../firebolt/jdbc/util/VersionUtilTest.java | 2 +- 8 files changed, 80 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a6cef6a5..6a0db5ea0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,11 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: '11' + java-version: '17' + - name: Gradle version + uses: gradle/gradle-build-action@v2 + with: + arguments: --version - name: Build and test uses: gradle/gradle-build-action@v2 with: diff --git a/.github/workflows/code-analysis.yml b/.github/workflows/code-analysis.yml index 8db2f15dc..75a10bcca 100644 --- a/.github/workflows/code-analysis.yml +++ b/.github/workflows/code-analysis.yml @@ -13,10 +13,10 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: 11 + java-version: 17 distribution: 'zulu' - name: Cache SonarCloud packages uses: actions/cache@v1 diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 448169567..268324317 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -31,7 +31,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - name: Determine env variables run: | if [ "${{ github.event.inputs.environment }}" == 'staging' ]; then diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index adc1abf30..0b9adf583 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,5 +34,5 @@ jobs: - name: Deploy to Repsy repository run: ./gradlew publish env: - REPSY_USERNAME: ${{ secrets.REPSY_USERNAME }} - REPSY_PASSWORD: ${{ secrets.REPSY_PASSWORD }} + REPSY_USERNAME: ${{ secrets.MAVEN_REPO_USERNAME }} + REPSY_PASSWORD: ${{ secrets.MAVEN_REPO_PASSWORD }} diff --git a/build.gradle b/build.gradle index 020963f66..6e50cd7a7 100644 --- a/build.gradle +++ b/build.gradle @@ -6,6 +6,8 @@ plugins { id "org.sonarqube" version "4.3.1.3277" id 'maven-publish' id 'com.github.johnrengelman.shadow' version '8.0.0' + id 'org.quiltmc.gradle.licenser' version '2.0.1' + id 'signing' } group 'io.firebolt' @@ -22,6 +24,7 @@ project.ext { java { withSourcesJar() + withJavadocJar() } compileJava { @@ -91,6 +94,8 @@ dependencies { compileTestJava.dependsOn processTestResources jar.dependsOn processTestResources jar.dependsOn processIntegrationTestResources + javadoc.dependsOn processTestResources + javadoc.dependsOn processIntegrationTestResources compileTestCommonJava.dependsOn processTestResources compileTestCommonJava.dependsOn processIntegrationTestResources compileIntegrationTestJava.dependsOn processIntegrationTestResources @@ -151,7 +156,7 @@ shadowJar { JarFile jf = new JarFile(jar) jf.entries().each { entry -> if (entry.name.endsWith(".class") && entry.name != "module-info.class" && - !entry.name.startsWith('org/slf4j') && !entry.name.startsWith('ch/qos/logback')) { + !entry.name.startsWith('org/slf4j') && !entry.name.startsWith('ch/qos/logback')) { packages << entry.name[0..entry.name.lastIndexOf('/')-1].replaceAll('/', '.') } } @@ -194,22 +199,71 @@ publishing { publications { maven(MavenPublication) { from components.java + pom { + name = "firebolt-jdbc" + description = 'Type 4 JDBC driver that allows connection to Firebolt Database' + url = "https://github.com/firebolt-db/jdbc" + licenses { + license { + name = "The Apache License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + } + } + developers { + developer { + id = "JonyBoyko" + name = "Ivan Boyko" + email = "107884978+yingli017@users.noreply.github.com" + } + developer { + id = "ptiurin" + name = "Petro Tiurin" + email = "petro.tiurin@firebolt.io" + } + developer { + id = "kevin" + name = "Kevin Marr" + email = "kevin@firebolt.io" + } + developer { + id = "aymeric" + name = "Aymeric Dispa" + email = "aymeric@firebolt.io" + } + developer { + id = "alexradzin" + name = "Alexander Radzin" + email = "alexander.radzin@firebolt.io" + } + developer { + id = "reelsen" + name = "Alexander Reelsen" + email = "alexander@reelsen.net" + } + } + scm { + connection = "scm:svn:https://github.com/firebolt-db/jdbc/" + developerConnection = "scm:svn:https://github.com/firebolt-db/jdbc/" + url = "https://github.com/firebolt-db/jdbc/" + } + } // remove dependencies due to shaded jar pom.withXml { - node = asNode() - node.remove(node.get('dependencies')) + node = asNode() + node.remove(node.get('dependencies')) } } } repositories { maven { - def releasesRepoUrl = 'https://repo.repsy.io/mvn/firebolt/maven' - def snapshotsRepoUrl = 'https://repo.repsy.io/mvn/firebolt/maven-snapshots' + def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/' + def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/' + url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl credentials { - username System.getenv("REPSY_USERNAME") - password System.getenv("REPSY_PASSWORD") + username System.getenv("MAVEN_REPO_USERNAME") + password System.getenv("MAVEN_REPO_PASSWORD") } } } @@ -233,6 +287,7 @@ jar { } } + task generateJavadoc(type: Javadoc) { failOnError false source = sourceSets.main.allJava @@ -244,6 +299,11 @@ task generateJavadoc(type: Javadoc) { options.addStringOption('Xdoclint:none', '-quiet') } + +signing { + sign publishing.publications +} + if (hasProperty('buildScan')) { buildScan { termsOfServiceUrl = 'https://gradle.com/terms-of-service' diff --git a/gradle.properties b/gradle.properties index 0faed3411..d9c342e28 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version=2.4.6-SNAPSHOT +version=2.4.6 jdbcVersion=4.3 \ No newline at end of file diff --git a/src/test/java/com/firebolt/jdbc/metadata/FireboltDatabaseMetadataTest.java b/src/test/java/com/firebolt/jdbc/metadata/FireboltDatabaseMetadataTest.java index eb8ca7d14..d798c6b25 100644 --- a/src/test/java/com/firebolt/jdbc/metadata/FireboltDatabaseMetadataTest.java +++ b/src/test/java/com/firebolt/jdbc/metadata/FireboltDatabaseMetadataTest.java @@ -310,7 +310,7 @@ void shouldGetDriverMinorVersion() { @Test void shouldGetDriverVersion() throws SQLException { - assertEquals("2.4.6-SNAPSHOT", fireboltDatabaseMetadata.getDriverVersion()); + assertEquals("2.4.6", fireboltDatabaseMetadata.getDriverVersion()); } @Test diff --git a/src/test/java/com/firebolt/jdbc/util/VersionUtilTest.java b/src/test/java/com/firebolt/jdbc/util/VersionUtilTest.java index 0e4331c6c..a6f435a68 100644 --- a/src/test/java/com/firebolt/jdbc/util/VersionUtilTest.java +++ b/src/test/java/com/firebolt/jdbc/util/VersionUtilTest.java @@ -18,7 +18,7 @@ void shouldGetDriverMinorVersion() { @Test void shouldGetProjectVersion() { - assertEquals("2.4.6-SNAPSHOT", VersionUtil.getDriverVersion()); + assertEquals("2.4.6", VersionUtil.getDriverVersion()); } @Test