[](https://github.com/utPLSQL/utPLSQL-maven-plugin/actions/workflows/build.yml)
[](https://sonarcloud.io/dashboard?id=org.utplsql%3Autplsql-maven-plugin)
# utPLSQL-maven-plugin
A maven plugin for running Unit Tests with utPLSQL v3+.
## Compatibility
This plugin is compatible with utPLSQL 3.1.0+.
## Prerequisites
* Java SE Runtime Environment 8
* Maven Version 3.5+
* Oracle JDBC driver
```xml
com.oracle.database.jdbcojdbc821.3.0.0
```
## Usage
### Skipping Tests
To skip running the tests for a particular project, set the **skipUtplsqlTests** property to true.
```xml
true
```
You can also skip the tests via the command line by executing the following command:
mvn install -DskipTests
#### Skipping by Default
If you want to skip tests by default but want the ability to re-enable tests from the command line, you need to go via a
properties section in the pom:
```xml
true
```
This will allow you to run with all tests disabled by default and to run them with this command:
mvn install -DskipUtplsqlTests=false
### Configuration
Please refer to the following usage example for the parameters descriptions:
```xml
4.0.0org.my_orgmy-artifact-name1.0.0url_of_connectionuserpasswordorg.utplsqlutplsql-maven-plugin3.1.11testschema_namesrc/test/resources/scripts/sources**/*pkg**/*pkbsrc/test/resources/scripts/test**/*pkg**/*pkbfalsefalsefalsefalse0test_tagtrue5app.test1,app.test2app.test1,app.test2app.test1,app.test2app.test1,app.test2app.test1,app.test2app.test1,app.test2UT_COVERAGE_SONAR_REPORTERutplsql/coverage-sonar-reporter.xmltrueUT_SONAR_TEST_REPORTERutplsql/sonar-test-reporter.xmlfalseUT_TEAMCITY_REPORTERcode_owner.*/\w+/(\w+)/(\w+)\.\w{3}app21package bodypackage_bodiestests_owner.*/\w+/(\w+)/(\w+)\.\w{3}test21package bodypackage_bodies
```
More project samples are available in the `src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT`
directory:
* **simple-project:** Minimalist test project with standard project directory structure.
* **regex-project:** Overrides project directory structure and use additional parameters (sourcesRegexExpression,
testsRegexExpression, ...), to tell utPLSQL how project files should be mapped into database objects.
* **type-mapping-project:** Example how to use regex and custom type parameters together.
* **owner-param-project:** Demonstrates how to use sourcesOwner and testsOwner parameters.
## Comparison with utPLSQL CLI
| CLI short parameter | CLI long parameter | Maven XML path |
| --- | --- | --- |
| -c | --color | |
| | --failure-exit-code | |
| -p | --path | paths.path |
| -f | --format | reporters.reporter.name |
| -o | | reporters.reporter.fileOutput |
| -s | | reporters.reporter.consoleOutput |
| | | ignoreFailure |
| -scc | --skip-compatibility-check | skipCompatibilityCheck |
| | --tags | tags.tag |
| -D | --dbms_output | dbmsOutput |
| -r | --random-test-order | randomTestOrder |
| -seed | --random-test-order-seed | randomTestOrderSeed |
| -exclude | | excludeObject |
| -include | | includeObject |
| | | |
| -source_path | | sources.source.directory |
| -owner | | sourcesOwner |
| -regex_expression | | sourcesRegexExpression |
| -type_mapping | | list of testsCustomTypeMapping.customTypeMapping |
| -owner_subexpression | | sourcesOwnerSubexpression |
| -type_subexpression | | sourcesTypeSubexpression |
| -name_subexpression | | sourcesNameSubexpression |
| | | |
| -test_path | | tests.test.directory |
| -owner | | testsOwner |
| -regex_expression | | testsRegexExpression |
| -type_mapping | | list of testsCustomTypeMapping.customTypeMapping |
| -owner_subexpression | | testsOwnerSubexpression |
| -type_subexpression | | testsTypeSubexpression |
| -name_subexpression | | testsNameSubexpression |