Skip to content

Commit fc3390e

Browse files
author
Pavel Zavora
committed
feat: modernize dependencies and distribution layout
1 parent bf4aecb commit fc3390e

9 files changed

+69
-16
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ The tool ignores missing tables and columns when importing the data.
66
## Quick Start
77
1. Java must be installed, 1.8 or newer
88
2. Install `jdbcimage` tool
9-
* download the latest [release](https://github.com/sranka/jdbcimage/releases) as `jdbcimage${version}.tar.gz` or `jdbcimage${version}.zip`, or build it from sources
9+
* download the latest [release](https://github.com/sranka/jdbcimage/releases) as `jdbcimage.tar.gz` or `jdbcimage.zip`, or build it from sources
1010
* mvn install, the same files appear in the `target` directory
11-
* `tar xvf jdbcimage${version}.tar.gz` or `unzip jdbcimage${version}.zip` in a directory of your choice,
12-
* the examples below assume that the directory is in your `PATH` environment variable
11+
* `tar xvf jdbcimage.tar.gz` or `unzip jdbcimage.zip` in a directory of your choice,
12+
* the examples below assume that the directory `jdbcimage-${version}` is in your `PATH` environment variable
1313
* if you are using oracle database, copy its JDBC drivers to the lib directory
1414
3. Know how to connect to your database
1515
* *url* - JDBC connection URL, observe examples below

jdbcimage

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ done
2727
INSTALLDIR=`dirname "$PRG"`
2828

2929
echo "Starting Java with: $JAVA_OPTS"
30-
java $JAVA_OPTS -classpath "$INSTALLDIR/target/jdbcimage.jar:$INSTALLDIR/lib/*" io.github.sranka.jdbcimage.main.JdbcImageMain "$@"
30+
java $JAVA_OPTS -classpath "$INSTALLDIR/jdbcimage.jar:$INSTALLDIR/lib/*" io.github.sranka.jdbcimage.main.JdbcImageMain "$@"

jdbcimage.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
@setlocal
22
@echo off
33
set JAVA_OPTS=-Xmx1024m
4-
java %JAVA_OPTS% -classpath "%~dp0target/jdbcimage.jar;%~dp0lib/*" io.github.sranka.jdbcimage.main.JdbcImageMain %*
4+
java %JAVA_OPTS% -classpath "%~dp0jdbcimage.jar;%~dp0lib/*" io.github.sranka.jdbcimage.main.JdbcImageMain %*

lib/mariadb-java-client-3.5.2.jar

-726 KB
Binary file not shown.

lib/mssql-jdbc-12.8.1.jre8.jar

-1.4 MB
Binary file not shown.

lib/postgresql-42.7.5.jar

-1.04 MB
Binary file not shown.

pom.xml

+46-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<properties>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1616
<version.jdk>1.8</version.jdk>
17+
<app.main.class>io.github.sranka.jdbcimage.main.JdbcImageMain</app.main.class>
1718
</properties>
1819

1920
<licenses>
@@ -34,7 +35,7 @@
3435
<dependency>
3536
<groupId>org.apache.commons</groupId>
3637
<artifactId>commons-dbcp2</artifactId>
37-
<version>2.9.0</version>
38+
<version>2.13.0</version>
3839
</dependency>
3940
<!-- logging -->
4041
<dependency>
@@ -49,22 +50,41 @@
4950
<version>4.13.2</version>
5051
<scope>test</scope>
5152
</dependency>
53+
<!-- JDBC drivers -->
54+
<dependency>
55+
<groupId>org.mariadb.jdbc</groupId>
56+
<artifactId>mariadb-java-client</artifactId>
57+
<version>3.5.2</version>
58+
<scope>test</scope>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.postgresql</groupId>
62+
<artifactId>postgresql</artifactId>
63+
<version>42.7.5</version>
64+
<scope>provided</scope>
65+
</dependency>
66+
<dependency>
67+
<groupId>com.microsoft.sqlserver</groupId>
68+
<artifactId>mssql-jdbc</artifactId>
69+
<version>12.8.1.jre8</version>
70+
<scope>test</scope>
71+
</dependency>
5272
</dependencies>
5373

5474
<build>
75+
<finalName>jdbcimage</finalName>
5576
<plugins>
5677
<plugin>
5778
<groupId>org.apache.maven.plugins</groupId>
5879
<artifactId>maven-jar-plugin</artifactId>
59-
<version>2.4</version> <!-- only because of maven warnings -->
80+
<version>3.4.2</version>
6081
<configuration>
61-
<finalName>jdbcimage</finalName>
6282
</configuration>
6383
</plugin>
6484
<plugin>
6585
<groupId>org.codehaus.mojo</groupId>
6686
<artifactId>license-maven-plugin</artifactId>
67-
<version>1.16</version>
87+
<version>2.5.0</version>
6888
<executions>
6989
<execution>
7090
<id>add-third-party</id>
@@ -88,7 +108,20 @@
88108
<artifactId>maven-shade-plugin</artifactId>
89109
<version>3.6.0</version>
90110
<configuration>
111+
<artifactSet>
112+
<excludes>
113+
<exclude>org.mariadb.jdbc:mariadb-java-client:*</exclude>
114+
<exclude>org.postgresql:postgresql:*</exclude>
115+
<exclude>com.microsoft.sqlserver:mssql-jdbc:*</exclude>
116+
</excludes>
117+
</artifactSet>
91118
<transformers>
119+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
120+
<manifestEntries>
121+
<Main-Class>${app.main.class}</Main-Class>
122+
<X-Compile-Source-JDK>${version.jdk}</X-Compile-Source-JDK>
123+
</manifestEntries>
124+
</transformer>
92125
<!-- merge licenses -->
93126
<transformer
94127
implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer">
@@ -97,6 +130,15 @@
97130
implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
98131
</transformer>
99132
</transformers>
133+
<filters>
134+
<filter>
135+
<artifact>*:*</artifact>
136+
<excludes>
137+
<exclude>META-INF/MANIFEST.MF</exclude>
138+
<exclude>META-INF/versions/9/module-info.class</exclude>
139+
</excludes>
140+
</filter>
141+
</filters>
100142
</configuration>
101143
<executions>
102144
<execution>

src/main/assembly/assembly.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
4-
<id>assembly</id>
2+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 https://maven.apache.org/xsd/assembly-2.2.0.xsd"> <id>assembly</id>
54
<formats>
65
<format>tar.gz</format>
76
<format>zip</format>

src/main/assembly/component.xml

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
<component xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2 http://maven.apache.org/xsd/component-1.1.2.xsd">
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<component xmlns="http://maven.apache.org/ASSEMBLY-COMPONENT/2.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY-COMPONENT/2.2.0 https://maven.apache.org/xsd/assembly-component-2.2.0.xsd">
4+
<dependencySets>
5+
<dependencySet>
6+
<outputDirectory>lib</outputDirectory>
7+
<includes>
8+
<include>org.mariadb.jdbc:mariadb-java-client:*</include>
9+
<include>org.postgresql:postgresql:*</include>
10+
<include>com.microsoft.sqlserver:mssql-jdbc:*</include>
11+
</includes>
12+
<scope>test</scope>
13+
<useStrictFiltering>true</useStrictFiltering>
14+
</dependencySet>
15+
</dependencySets>
316
<fileSets>
417
<fileSet>
518
<directory/>
@@ -25,7 +38,6 @@
2538
<directory>lib</directory>
2639
<outputDirectory>lib</outputDirectory>
2740
<includes>
28-
<include>*.jar</include>
2941
<include>THIRD-PARTY.txt</include>
3042
</includes>
3143
<fileMode>644</fileMode>
@@ -41,7 +53,7 @@
4153
</fileSet>
4254
<fileSet>
4355
<directory>${project.build.directory}</directory>
44-
<outputDirectory>target</outputDirectory>
56+
<outputDirectory/>
4557
<includes>
4658
<include>jdbcimage.jar</include>
4759
</includes>

0 commit comments

Comments
 (0)