Skip to content

Commit 7337dda

Browse files
Augusto PassalaquaAugusto Passalaqua
authored andcommitted
Add DBConnTest module to pom.xml, split pom, remove unused dependencies.
1 parent 9dd6b4b commit 7337dda

18 files changed

+117
-58
lines changed

DatabaseConnector.pom.xml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>com.mendix.databaseconnector</groupId>
9+
<artifactId>databaseconnector-main</artifactId>
10+
<version>3.1.0</version>
11+
<relativePath>.</relativePath>
12+
</parent>
13+
14+
<artifactId>databaseconnector</artifactId>
15+
<version>3.1.0</version>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>com.zaxxer</groupId>
20+
<artifactId>HikariCP</artifactId>
21+
<version>2.6.1</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>org.slf4j</groupId>
25+
<artifactId>slf4j-api</artifactId>
26+
<version>1.7.21</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>com.ibm.db2.jcc</groupId>
30+
<artifactId>db2jcc</artifactId>
31+
<version>db2jcc4</version>
32+
<scope>runtime</scope>
33+
</dependency>
34+
<dependency>
35+
<groupId>org.hsqldb</groupId>
36+
<artifactId>hsqldb</artifactId>
37+
<version>2.4.1</version>
38+
<scope>runtime</scope>
39+
</dependency>
40+
<dependency>
41+
<groupId>org.mariadb.jdbc</groupId>
42+
<artifactId>mariadb-java-client</artifactId>
43+
<version>2.5.4</version>
44+
<scope>runtime</scope>
45+
</dependency>
46+
<dependency>
47+
<groupId>com.microsoft.sqlserver</groupId>
48+
<artifactId>mssql-jdbc</artifactId>
49+
<version>8.2.0.jre11</version>
50+
<scope>runtime</scope>
51+
</dependency>
52+
<dependency>
53+
<groupId>com.oracle.ojdbc</groupId>
54+
<artifactId>ojdbc8</artifactId>
55+
<version>19.3.0.0</version>
56+
<scope>runtime</scope>
57+
</dependency>
58+
<dependency>
59+
<groupId>org.postgresql</groupId>
60+
<artifactId>postgresql</artifactId>
61+
<version>42.2.9</version>
62+
<scope>runtime</scope>
63+
</dependency>
64+
<dependency>
65+
<groupId>com.sap.cloud.db.jdbc</groupId>
66+
<artifactId>ngdbc</artifactId>
67+
<version>2.3.58</version>
68+
<scope>runtime</scope>
69+
</dependency>
70+
</dependencies>
71+
</project>

DatabaseConnectorTest.pom.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>com.mendix.databaseconnector</groupId>
9+
<artifactId>databaseconnector-main</artifactId>
10+
<version>3.1.0</version>
11+
<relativePath>.</relativePath>
12+
</parent>
13+
14+
<artifactId>databaseconnectortest</artifactId>
15+
<version>3.1.0</version>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.mockito</groupId>
20+
<artifactId>mockito-core</artifactId>
21+
<version>3.2.4</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>commons-io</groupId>
25+
<artifactId>commons-io</artifactId>
26+
<version>2.3</version>
27+
</dependency>
28+
</dependencies>
29+
</project>

javasource/databaseconnectortest/actions/AssertEqualsListEntityValues.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import static java.lang.String.format;
1313
import static java.util.stream.Collectors.joining;
14-
import static org.apache.commons.lang3.StringUtils.isEmpty;
1514
import java.io.IOException;
1615
import java.io.InputStream;
1716
import java.math.BigDecimal;
@@ -90,6 +89,10 @@ private Optional<String> compare(int objectNr, IMendixObject expected, IMendixOb
9089
return isEmpty(message) ? Optional.empty() : Optional.of(format("Row %s: ", objectNr) + message);
9190
}
9291

92+
private boolean isEmpty(String message) {
93+
return message == null || message.isBlank();
94+
}
95+
9396
private Optional<String> compare(PrimitiveType primitiveType, IMendixObjectMember<?> expected, IMendixObjectMember<?> actual) {
9497
Object expectedValue = toComparableValue(expected.getValue(getContext()));
9598
Object actualValue = toComparableValue(actual.getValue(getContext()));

pom.xml

Lines changed: 6 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>com.mendix.databaseconnector</groupId>
8-
<artifactId>databaseconnector</artifactId>
8+
<artifactId>databaseconnector-main</artifactId>
99
<version>3.1.0</version>
1010
<licenses>
1111
<license>
1212
<name>Apache License, Version 2.0</name>
1313
</license>
1414
</licenses>
15+
<packaging>pom</packaging>
1516
<build>
1617
<plugins>
1718
<plugin>
@@ -29,58 +30,8 @@
2930
</plugin>
3031
</plugins>
3132
</build>
32-
<dependencies>
33-
<dependency>
34-
<groupId>com.zaxxer</groupId>
35-
<artifactId>HikariCP</artifactId>
36-
<version>2.6.1</version>
37-
</dependency>
38-
<dependency>
39-
<groupId>org.slf4j</groupId>
40-
<artifactId>slf4j-api</artifactId>
41-
<version>1.7.21</version>
42-
</dependency>
43-
<dependency>
44-
<groupId>com.ibm.db2.jcc</groupId>
45-
<artifactId>db2jcc</artifactId>
46-
<version>db2jcc4</version>
47-
<scope>runtime</scope>
48-
</dependency>
49-
<dependency>
50-
<groupId>org.hsqldb</groupId>
51-
<artifactId>hsqldb</artifactId>
52-
<version>2.4.1</version>
53-
<scope>runtime</scope>
54-
</dependency>
55-
<dependency>
56-
<groupId>org.mariadb.jdbc</groupId>
57-
<artifactId>mariadb-java-client</artifactId>
58-
<version>2.5.4</version>
59-
<scope>runtime</scope>
60-
</dependency>
61-
<dependency>
62-
<groupId>com.microsoft.sqlserver</groupId>
63-
<artifactId>mssql-jdbc</artifactId>
64-
<version>8.2.0.jre11</version>
65-
<scope>runtime</scope>
66-
</dependency>
67-
<dependency>
68-
<groupId>com.oracle.ojdbc</groupId>
69-
<artifactId>ojdbc8</artifactId>
70-
<version>19.3.0.0</version>
71-
<scope>runtime</scope>
72-
</dependency>
73-
<dependency>
74-
<groupId>org.postgresql</groupId>
75-
<artifactId>postgresql</artifactId>
76-
<version>42.2.9</version>
77-
<scope>runtime</scope>
78-
</dependency>
79-
<dependency>
80-
<groupId>com.sap.cloud.db.jdbc</groupId>
81-
<artifactId>ngdbc</artifactId>
82-
<version>2.3.58</version>
83-
<scope>runtime</scope>
84-
</dependency>
85-
</dependencies>
33+
<modules>
34+
<module>DatabaseConnector.pom.xml</module>
35+
<module>DatabaseConnectorTest.pom.xml</module>
36+
</modules>
8637
</project>

update-dependencies.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@ mvn dependency:copy-dependencies@userlib-copy
55

66
# Then create remove the old RequiredLib files:
77
rm -f userlib/*DatabaseConnector.RequiredLib
8+
rm -f userlib/*DatabaseConnectorTest.RequiredLib
89

910
# Recreate those RequiredLib files:
10-
mvn dependency:list \
11+
mvn dependency:list -pl :databaseconnector \
1112
| sed -nE 's#[^\s]* (.*):(.*):jar:(.*):(compile|runtime)#userlib/\1.\2-\3.jar.DatabaseConnector.RequiredLib#p' \
1213
| xargs touch
1314

15+
mvn dependency:list -pl :databaseconnectortest \
16+
| sed -nE 's#[^\s]* (.*):(.*):jar:(.*):(compile|runtime)#userlib/\1.\2-\3.jar.DatabaseConnectorTest.RequiredLib#p' \
17+
| xargs touch
18+
1419
# Update the license report file
15-
mvn project-info-reports:dependencies
20+
mvn project-info-reports:dependencies -pl :databaseconnector
1621

1722
# Create a neat zip file with that information
1823
cd target/site
178 KB
Binary file not shown.

userlib/commons-logging-1.1.3.jar

-60.6 KB
Binary file not shown.
0 Bytes
Binary file not shown.

userlib/joda-time-2.8.1.jar

-607 KB
Binary file not shown.

0 commit comments

Comments
 (0)