Skip to content

Commit 8ceee13

Browse files
author
Jacek Gębal
committed
Update to Java 17.
Update of utPLSQL-java-api version. Update of maven dependencies. Improved maintainability of tests - DB_URL and credentials are managed in env variables.
1 parent 66211d6 commit 8ceee13

39 files changed

Lines changed: 136 additions & 141 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
build:
1616

1717
runs-on: ubuntu-latest
18+
env:
19+
DB_URL: "//localhost:1521/FREEPDB1"
20+
DB_USER: UT3
21+
DB_PASS: UT3
1822

1923
services:
2024
oracle:

README.md

Lines changed: 34 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,8 @@ This plugin is compatible with utPLSQL 3.1.0+.
1111

1212
## Prerequisites
1313

14-
* Java SE Runtime Environment 8
15-
* Maven Version 3.5+
16-
* Oracle JDBC driver
17-
18-
```xml
19-
20-
<dependency>
21-
<groupId>com.oracle.database.jdbc</groupId>
22-
<artifactId>ojdbc8</artifactId>
23-
<version>21.3.0.0</version>
24-
</dependency>
25-
```
14+
* Java SE Runtime Environment 17
15+
* Maven Version 3.9.9+
2616

2717
## Usage
2818

@@ -31,7 +21,6 @@ This plugin is compatible with utPLSQL 3.1.0+.
3121
To skip running the tests for a particular project, set the **skipUtplsqlTests** property to true.
3222

3323
```xml
34-
3524
<configuration>
3625
<skipUtplsqlTests>true</skipUtplsqlTests>
3726
</configuration>
@@ -47,7 +36,6 @@ If you want to skip tests by default but want the ability to re-enable tests fro
4736
properties section in the pom:
4837

4938
```xml
50-
5139
<configuration>
5240
<skipUtplsqlTests>true</skipUtplsqlTests>
5341
</configuration>
@@ -62,7 +50,6 @@ This will allow you to run with all tests disabled by default and to run them wi
6250
Please refer to the following usage example for the parameters descriptions:
6351

6452
```xml
65-
6653
<project xmlns="http://maven.apache.org/POM/4.0.0"
6754
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6855
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -267,35 +254,35 @@ directory:
267254

268255
## Comparison with utPLSQL CLI
269256

270-
| CLI short parameter | CLI long parameter | Maven XML path |
271-
| --- | --- | --- |
272-
| -c | --color | |
273-
| | --failure-exit-code | |
274-
| -p | --path | paths.path |
275-
| -f | --format | reporters.reporter.name |
276-
| -o | | reporters.reporter.fileOutput |
277-
| -s | | reporters.reporter.consoleOutput |
278-
| | | ignoreFailure |
279-
| -scc | --skip-compatibility-check | skipCompatibilityCheck |
280-
| | --tags | tags.tag |
281-
| -D | --dbms_output | dbmsOutput |
282-
| -r | --random-test-order | randomTestOrder |
283-
| -seed | --random-test-order-seed | randomTestOrderSeed |
284-
| -exclude | | excludeObject |
285-
| -include | | includeObject |
286-
| | | |
287-
| -source_path | | sources.source.directory |
288-
| -owner | | sourcesOwner |
289-
| -regex_expression | | sourcesRegexExpression |
290-
| -type_mapping | | list of testsCustomTypeMapping.customTypeMapping |
291-
| -owner_subexpression | | sourcesOwnerSubexpression |
292-
| -type_subexpression | | sourcesTypeSubexpression |
293-
| -name_subexpression | | sourcesNameSubexpression |
294-
| | | |
295-
| -test_path | | tests.test.directory |
296-
| -owner | | testsOwner |
297-
| -regex_expression | | testsRegexExpression |
298-
| -type_mapping | | list of testsCustomTypeMapping.customTypeMapping |
299-
| -owner_subexpression | | testsOwnerSubexpression |
300-
| -type_subexpression | | testsTypeSubexpression |
301-
| -name_subexpression | | testsNameSubexpression |
257+
| CLI short parameter | CLI long parameter | Maven XML path |
258+
|----------------------|----------------------------|--------------------------------------------------|
259+
| -c | --color | |
260+
| | --failure-exit-code | |
261+
| -p | --path | paths.path |
262+
| -f | --format | reporters.reporter.name |
263+
| -o | | reporters.reporter.fileOutput |
264+
| -s | | reporters.reporter.consoleOutput |
265+
| | | ignoreFailure |
266+
| -scc | --skip-compatibility-check | skipCompatibilityCheck |
267+
| | --tags | tags.tag |
268+
| -D | --dbms_output | dbmsOutput |
269+
| -r | --random-test-order | randomTestOrder |
270+
| -seed | --random-test-order-seed | randomTestOrderSeed |
271+
| -exclude | | excludeObject |
272+
| -include | | includeObject |
273+
| | | |
274+
| -source_path | | sources.source.directory |
275+
| -owner | | sourcesOwner |
276+
| -regex_expression | | sourcesRegexExpression |
277+
| -type_mapping | | list of testsCustomTypeMapping.customTypeMapping |
278+
| -owner_subexpression | | sourcesOwnerSubexpression |
279+
| -type_subexpression | | sourcesTypeSubexpression |
280+
| -name_subexpression | | sourcesNameSubexpression |
281+
| | | |
282+
| -test_path | | tests.test.directory |
283+
| -owner | | testsOwner |
284+
| -regex_expression | | testsRegexExpression |
285+
| -type_mapping | | list of testsCustomTypeMapping.customTypeMapping |
286+
| -owner_subexpression | | testsOwnerSubexpression |
287+
| -type_subexpression | | testsTypeSubexpression |
288+
| -name_subexpression | | testsNameSubexpression |

pom.xml

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>org.utplsql</groupId>
77
<artifactId>utplsql-maven-plugin</artifactId>
8-
<version>3.1.12-SNAPSHOT</version>
8+
<version>3.2.0-SNAPSHOT</version>
99
<packaging>maven-plugin</packaging>
1010

1111
<name>utPLSQL Maven Plugin</name>
@@ -26,6 +26,11 @@
2626
<organization>utPLSQL.org</organization>
2727
<organizationUrl>http://utplsql.org</organizationUrl>
2828
</developer>
29+
<developer>
30+
<name>Jacek Gebal</name>
31+
<organization>utPLSQL.org</organization>
32+
<organizationUrl>https://utplsql.org</organizationUrl>
33+
</developer>
2934
<developer>
3035
<name>Simon Martinelli</name>
3136
<organization>utPLSQL.org</organization>
@@ -40,29 +45,35 @@
4045

4146
<distributionManagement>
4247
<snapshotRepository>
43-
<id>ossrh</id>
44-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
48+
<id>central</id>
49+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
4550
</snapshotRepository>
4651
<repository>
47-
<id>ossrh</id>
48-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
52+
<id>central</id>
53+
<url>https://central.sonatype.com</url>
4954
</repository>
5055
</distributionManagement>
5156

5257
<properties>
53-
<maven.compiler.target>1.8</maven.compiler.target>
54-
<maven.compiler.source>1.8</maven.compiler.source>
5558
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
59+
<maven.compiler.release>17</maven.compiler.release>
60+
61+
<utplsql-java-api.version>3.2.3</utplsql-java-api.version>
5662

57-
<maven.version>3.5.2</maven.version>
58-
<itf.version>0.11.0</itf.version>
59-
<junit.version>5.8.1</junit.version>
63+
<!-- Minimum Maven API version required to run this plugin -->
64+
<maven.version>3.9.9</maven.version>
65+
<!-- Maven plugin tooling (annotations + plugin-plugin) has its own release cycle -->
66+
<maven.plugin.tools.version>3.15.2</maven.plugin.tools.version>
67+
68+
<itf.version>0.13.1</itf.version>
69+
<junit.version>5.12.2</junit.version>
6070

6171
<sonar.organization>utplsql</sonar.organization>
6272
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
6373
</properties>
6474

6575
<dependencies>
76+
<!-- Maven API - provided by the Maven runtime -->
6677
<dependency>
6778
<groupId>org.apache.maven</groupId>
6879
<artifactId>maven-core</artifactId>
@@ -72,31 +83,27 @@
7283
<dependency>
7384
<groupId>org.apache.maven.plugin-tools</groupId>
7485
<artifactId>maven-plugin-annotations</artifactId>
75-
<version>${maven.version}</version>
86+
<version>${maven.plugin.tools.version}</version>
7687
<scope>provided</scope>
7788
</dependency>
7889
<dependency>
7990
<groupId>org.apache.maven.shared</groupId>
8091
<artifactId>maven-shared-utils</artifactId>
81-
<version>3.3.4</version>
82-
</dependency>
83-
84-
<dependency>
85-
<groupId>org.utplsql</groupId>
86-
<artifactId>utplsql-java-api</artifactId>
87-
<version>3.1.15</version>
88-
</dependency>
89-
90-
<dependency>
91-
<groupId>com.oracle.database.jdbc</groupId>
92-
<artifactId>ojdbc8</artifactId>
93-
<version>21.3.0.0</version>
92+
<version>3.4.2</version>
9493
</dependency>
9594

95+
<!-- plexus-utils is a transitive dependency of maven-core (provided), so mark as provided -->
9696
<dependency>
9797
<groupId>org.codehaus.plexus</groupId>
9898
<artifactId>plexus-utils</artifactId>
9999
<version>3.6.1</version>
100+
<scope>provided</scope>
101+
</dependency>
102+
103+
<dependency>
104+
<groupId>org.utplsql</groupId>
105+
<artifactId>utplsql-java-api</artifactId>
106+
<version>${utplsql-java-api.version}</version>
100107
</dependency>
101108

102109
<!-- Test Dependencies -->
@@ -109,7 +116,7 @@
109116
<dependency>
110117
<groupId>org.apache.maven.plugin-testing</groupId>
111118
<artifactId>maven-plugin-testing-harness</artifactId>
112-
<version>3.3.0</version>
119+
<version>3.5.1</version>
113120
<scope>test</scope>
114121
</dependency>
115122

@@ -142,22 +149,27 @@
142149
<dependency>
143150
<groupId>org.slf4j</groupId>
144151
<artifactId>slf4j-simple</artifactId>
145-
<version>1.7.32</version>
152+
<version>2.0.17</version>
146153
<scope>test</scope>
147154
</dependency>
148155
</dependencies>
149156

150157
<build>
151158
<plugins>
159+
<plugin>
160+
<groupId>org.apache.maven.plugins</groupId>
161+
<artifactId>maven-compiler-plugin</artifactId>
162+
<version>3.14.0</version>
163+
</plugin>
152164
<plugin>
153165
<groupId>org.apache.maven.plugins</groupId>
154166
<artifactId>maven-surefire-plugin</artifactId>
155-
<version>2.22.2</version>
167+
<version>3.5.5</version>
156168
</plugin>
157169
<plugin>
158170
<groupId>org.apache.maven.plugins</groupId>
159171
<artifactId>maven-failsafe-plugin</artifactId>
160-
<version>2.22.2</version>
172+
<version>3.5.5</version>
161173
<executions>
162174
<execution>
163175
<goals>
@@ -185,7 +197,7 @@
185197
<plugin>
186198
<groupId>org.apache.maven.plugins</groupId>
187199
<artifactId>maven-shade-plugin</artifactId>
188-
<version>3.2.2</version>
200+
<version>3.6.2</version>
189201
<executions>
190202
<execution>
191203
<phase>package</phase>
@@ -194,18 +206,11 @@
194206
</goals>
195207
</execution>
196208
</executions>
197-
<configuration>
198-
<artifactSet>
199-
<includes>
200-
<include>org.utplsql:java-api</include>
201-
</includes>
202-
</artifactSet>
203-
</configuration>
204209
</plugin>
205210
<plugin>
206211
<groupId>org.apache.maven.plugins</groupId>
207212
<artifactId>maven-plugin-plugin</artifactId>
208-
<version>${maven.version}</version>
213+
<version>${maven.plugin.tools.version}</version>
209214
<configuration>
210215
<goalPrefix>utplsql</goalPrefix>
211216
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
@@ -228,7 +233,7 @@
228233
<plugin>
229234
<groupId>com.amashchenko.maven.plugin</groupId>
230235
<artifactId>gitflow-maven-plugin</artifactId>
231-
<version>1.16.0</version>
236+
<version>1.21.0</version>
232237
<configuration>
233238
<verbose>true</verbose>
234239
<gitFlowConfig>
@@ -247,7 +252,7 @@
247252
<plugin>
248253
<groupId>org.jacoco</groupId>
249254
<artifactId>jacoco-maven-plugin</artifactId>
250-
<version>0.8.7</version>
255+
<version>0.8.13</version>
251256
<executions>
252257
<execution>
253258
<id>prepare-agent</id>
@@ -278,7 +283,7 @@
278283
<plugin>
279284
<groupId>org.apache.maven.plugins</groupId>
280285
<artifactId>maven-javadoc-plugin</artifactId>
281-
<version>3.3.1</version>
286+
<version>3.12.0</version>
282287
<executions>
283288
<execution>
284289
<id>attach-javadocs</id>
@@ -291,7 +296,7 @@
291296
<plugin>
292297
<groupId>org.apache.maven.plugins</groupId>
293298
<artifactId>maven-source-plugin</artifactId>
294-
<version>3.2.1</version>
299+
<version>3.4.0</version>
295300
<executions>
296301
<execution>
297302
<id>attach-sources</id>
@@ -305,7 +310,7 @@
305310
<plugin>
306311
<groupId>org.apache.maven.plugins</groupId>
307312
<artifactId>maven-gpg-plugin</artifactId>
308-
<version>3.0.1</version>
313+
<version>3.2.8</version>
309314
<executions>
310315
<execution>
311316
<id>sign-artifacts</id>

scripts/0_start_db.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

scripts/1_install_utplsql.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ curl -Lk "${UTPLSQL_DOWNLOAD_URL}" -o utPLSQL.zip
55
unzip -q utPLSQL.zip
66

77
docker run --rm -v $(pwd)/utPLSQL:/utPLSQL -w /utPLSQL/source --network host \
8-
--entrypoint sqlplus truemark/sqlplus:19.8 sys/oracle@//127.0.0.1:1521/XE as sysdba @install_headless.sql UT3 UT3 users
8+
--entrypoint sqlplus truemark/sqlplus:19.8 sys/oracle@${DB_URL} as sysdba @install_headless.sql UT3 UT3 users

scripts/2_install_demo_project.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
2-
sys/oracle@//127.0.0.1:1521/XE as sysdba @scripts/sql/create_users.sql
2+
sys/oracle@${DB_URL} as sysdba @scripts/sql/create_users.sql
33

44
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
5-
app/pass@//127.0.0.1:1521/XE @scripts/sql/create_app_objects.sql
5+
app/pass@${DB_URL} @scripts/sql/create_app_objects.sql
66

77
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
8-
code_owner/pass@//127.0.0.1:1521/XE @scripts/sql/create_source_owner_objects.sql
8+
code_owner/pass@${DB_URL} @scripts/sql/create_source_owner_objects.sql
99

1010
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
11-
tests_owner/pass@//127.0.0.1:1521/XE @scripts/sql/create_tests_owner_objects.sql
11+
tests_owner/pass@${DB_URL} @scripts/sql/create_tests_owner_objects.sql

src/test/java/org/utplsql/maven/plugin/ReportChecker.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ private ReportChecker() {
2828
*/
2929
public static void assertThatReportsAreGeneratedAsExpected(MavenExecutionResult result, String... files) {
3030
for (String filename : files) {
31-
File expectedOutputFile = new File(result.getMavenProjectResult().getTargetProjectDirectory(), "/expected-output/utplsql/" + filename);
32-
File outputFile = new File(result.getMavenProjectResult().getTargetProjectDirectory(), "/target/utplsql/" + filename);
31+
File expectedOutputFile = new File(result.getMavenProjectResult().getTargetProjectDirectory().toFile(), "/expected-output/utplsql/" + filename);
32+
File outputFile = new File(result.getMavenProjectResult().getTargetProjectDirectory().toFile(), "/target/utplsql/" + filename);
3333

3434
assertThat(result.getMavenProjectResult()).withFile("/utplsql/" + filename).exists();
3535

@@ -60,7 +60,7 @@ public static void assertThatReportsAreGeneratedAsExpected(MavenExecutionResult
6060
* @return if report exits
6161
*/
6262
public static boolean reportWasGenerated(MavenExecutionResult result, String filename) {
63-
File outputFile = new File(result.getMavenProjectResult().getTargetProjectDirectory(), "/target/utplsql/" + filename);
63+
File outputFile = new File(result.getMavenProjectResult().getTargetProjectDirectory().toFile(), "/target/utplsql/" + filename);
6464
return outputFile.exists();
6565
}
6666
}

0 commit comments

Comments
 (0)