Skip to content

Commit 1c96614

Browse files
Deploy reduced POM during release (#608)
* Revert "revert (#595)" This reverts commit 56ef04f. * Fix uber minimal * fix version
1 parent 3d4dc3c commit 1c96614

File tree

3 files changed

+140
-16
lines changed

3 files changed

+140
-16
lines changed

bin/version_updater.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def main():
115115

116116
driver_util_file_path = "../src/main/java/com/databricks/jdbc/common/util/DriverUtil.java"
117117
pom_file_path = "../pom.xml"
118+
reduced_pom_file_path = "../uber-minimal-pom.xml"
118119
connection_test_file_path = "../src/test/java/com/databricks/jdbc/api/impl/DatabricksConnectionTest.java"
119120
database_metadata_test_file_path = ("../src/test/java/com/databricks/jdbc/api/impl/DatabricksDatabaseMetaDataTest"
120121
".java")
@@ -127,6 +128,9 @@ def main():
127128
_update_pom_xml(pom_file_path, version)
128129
print(f"Updated version in {pom_file_path}")
129130

131+
_update_pom_xml(reduced_pom_file_path, version)
132+
print(f"Updated version in {reduced_pom_file_path}")
133+
130134
_update_assertions_test_file(connection_test_file_path, version)
131135
print("Updated version in {}".format(connection_test_file_path))
132136

pom.xml

Lines changed: 94 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@
2525
</developer>
2626
</developers>
2727
<scm>
28-
<connection>scm:git:https://github.com/databricks/databricks-jdbc.git</connection>
29-
<developerConnection>scm:git:https://github.com/databricks/databricks-jdbc.git</developerConnection>
30-
<url>https://github.com/databricks/databricks-jdbc</url>
28+
<connection>scm:git:https://github.com/databricks/databricks-jdbc.git</connection>
29+
<developerConnection>scm:git:https://github.com/databricks/databricks-jdbc.git</developerConnection>
30+
<url>https://github.com/databricks/databricks-jdbc</url>
3131
</scm>
3232
<issueManagement>
3333
<system>GitHub Issues</system>
3434
<url>https://github.com/databricks/databricks-jdbc/issues</url>
3535
</issueManagement>
3636
<distributionManagement>
3737
<repository>
38-
<id>ossrh</id>
39-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
38+
<id>local-test-repo</id>
39+
<url>file://${project.build.directory}/local-repo</url>
4040
</repository>
4141
</distributionManagement>
4242
<properties>
@@ -389,7 +389,6 @@
389389
</goals>
390390
<configuration>
391391
<!-- The shaded uber jar is the default jar produced by this build -->
392-
<createDependencyReducedPom>false</createDependencyReducedPom>
393392
<shadedArtifactAttached>false</shadedArtifactAttached>
394393
<relocations>
395394
<relocation>
@@ -489,6 +488,51 @@
489488
</plugins>
490489
</build>
491490
<profiles>
491+
<profile>
492+
<!-- Local deploy for testing -->
493+
<id>local-deploy</id>
494+
<build>
495+
<plugins>
496+
<plugin>
497+
<groupId>org.apache.maven.plugins</groupId>
498+
<artifactId>maven-deploy-plugin</artifactId>
499+
<version>2.8.2</version>
500+
<executions>
501+
<!-- Skip the default deploy execution -->
502+
<execution>
503+
<id>skip-default-deploy</id>
504+
<phase>deploy</phase>
505+
<goals>
506+
<goal>deploy</goal>
507+
</goals>
508+
<configuration>
509+
<skip>true</skip>
510+
</configuration>
511+
</execution>
512+
<!-- Use deploy-file goal to deploy with custom POM -->
513+
<execution>
514+
<id>deploy-with-custom-pom</id>
515+
<phase>deploy</phase>
516+
<goals>
517+
<goal>deploy-file</goal>
518+
</goals>
519+
<configuration>
520+
<file>${project.build.directory}/${project.build.finalName}.jar</file>
521+
<pomFile>${project.basedir}/uber-minimal-pom.xml</pomFile>
522+
<!-- Include other artifacts like sources and javadocs -->
523+
<files>${project.build.directory}/${project.build.finalName}-thin.jar</files>
524+
<types>jar</types>
525+
<classifiers>thin</classifiers>
526+
<!-- Use repository details from distributionManagement -->
527+
<repositoryId>local-test-repo</repositoryId>
528+
<url>file://${project.build.directory}/local-repo</url>
529+
</configuration>
530+
</execution>
531+
</executions>
532+
</plugin>
533+
</plugins>
534+
</build>
535+
</profile>
492536
<profile>
493537
<id>release</id>
494538
<build>
@@ -527,23 +571,41 @@
527571
<groupId>org.apache.maven.plugins</groupId>
528572
<artifactId>maven-gpg-plugin</artifactId>
529573
<version>1.6</version>
530-
<configuration>
531-
<!-- Prevent gpg from using pinentry programs -->
532-
<gpgArguments>
533-
<arg>--pinentry-mode</arg>
534-
<arg>loopback</arg>
535-
</gpgArguments>
536-
</configuration>
537574
<executions>
538575
<execution>
539-
<id>sign-artifacts</id>
540576
<goals>
541-
<goal>sign</goal>
577+
<!-- Refer: https://maven.apache.org/plugins/maven-gpg-plugin/sign-and-deploy-file-mojo.html -->
578+
<goal>sign-and-deploy-file</goal>
542579
</goals>
543-
<phase>verify</phase>
580+
<phase>deploy</phase>
581+
<configuration>
582+
<file>${project.build.directory}/${project.build.finalName}.jar</file>
583+
<repositoryId>ossrh</repositoryId>
584+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
585+
<!-- Prevent gpg from using pinentry programs -->
586+
<gpgArguments>
587+
<arg>--pinentry-mode</arg>
588+
<arg>loopback</arg>
589+
</gpgArguments>
590+
<!-- Custom reduced pom file for fat jar -->
591+
<pomFile>${project.basedir}/uber-minimal-pom.xml</pomFile>
592+
<sources>${project.build.directory}/${project.build.finalName}-sources.jar</sources>
593+
<javadoc>${project.build.directory}/${project.build.finalName}-javadoc.jar</javadoc>
594+
<files>${project.build.directory}/${project.build.finalName}-thin.jar</files>
595+
<types>jar</types>
596+
<classifiers>thin</classifiers>
597+
</configuration>
544598
</execution>
545599
</executions>
546600
</plugin>
601+
<plugin>
602+
<groupId>org.apache.maven.plugins</groupId>
603+
<artifactId>maven-deploy-plugin</artifactId>
604+
<version>2.8.2</version>
605+
<configuration>
606+
<skip>true</skip>
607+
</configuration>
608+
</plugin>
547609
<plugin>
548610
<groupId>org.sonatype.plugins</groupId>
549611
<artifactId>nexus-staging-maven-plugin</artifactId>
@@ -553,10 +615,26 @@
553615
<serverId>ossrh</serverId>
554616
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
555617
<autoReleaseAfterClose>true</autoReleaseAfterClose>
618+
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
556619
</configuration>
620+
<executions>
621+
<execution>
622+
<id>nexus-deploy</id>
623+
<phase>deploy</phase>
624+
<goals>
625+
<goal>release</goal>
626+
</goals>
627+
</execution>
628+
</executions>
557629
</plugin>
558630
</plugins>
559631
</build>
632+
<distributionManagement>
633+
<repository>
634+
<id>ossrh</id>
635+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
636+
</repository>
637+
</distributionManagement>
560638
</profile>
561639
</profiles>
562640
</project>

uber-minimal-pom.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com.databricks</groupId>
6+
<artifactId>databricks-jdbc</artifactId>
7+
<!-- This value may be modified by a release script to reflect the current version of the driver. -->
8+
<version>0.9.8-oss</version>
9+
<packaging>jar</packaging>
10+
<name>Databricks JDBC Driver</name>
11+
<description>Databricks JDBC Driver.</description>
12+
<url>https://github.com/databricks/databricks-jdbc</url>
13+
<licenses>
14+
<license>
15+
<name>Apache License, Version 2.0</name>
16+
<url>https://github.com/databricks/databricks-jdbc/blob/main/LICENSE</url>
17+
</license>
18+
</licenses>
19+
<developers>
20+
<developer>
21+
<name>Databricks JDBC Team</name>
22+
<email>[email protected]</email>
23+
<organization>Databricks</organization>
24+
<organizationUrl>https://www.databricks.com</organizationUrl>
25+
</developer>
26+
</developers>
27+
<scm>
28+
<connection>scm:git:https://github.com/databricks/databricks-jdbc.git</connection>
29+
<developerConnection>scm:git:https://github.com/databricks/databricks-jdbc.git</developerConnection>
30+
<url>https://github.com/databricks/databricks-jdbc</url>
31+
</scm>
32+
<issueManagement>
33+
<system>GitHub Issues</system>
34+
<url>https://github.com/databricks/databricks-jdbc/issues</url>
35+
</issueManagement>
36+
<distributionManagement>
37+
<repository>
38+
<id>ossrh</id>
39+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
40+
</repository>
41+
</distributionManagement>
42+
</project>

0 commit comments

Comments
 (0)