Skip to content

Instantly share code, notes, and snippets.

@nochmu
Last active February 22, 2018 19:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nochmu/1f640b01a685f3f83a349de2db8a8882 to your computer and use it in GitHub Desktop.
Save nochmu/1f640b01a685f3f83a349de2db8a8882 to your computer and use it in GitHub Desktop.
call utPLSQL-CLI with exec-maven-plugin
<project>
...
<properties>
<!-- Datbase -->
<db.host>oradev</db.host>
<db.port>1521</db.port>
<db.service>dev.loc</db.service>
<db.user.test>TEST</db.user.test>
<db.pw.test>test</db.pw.test>
<!-- Path to utplsql (see https://github.com/utPLSQL/utPLSQL-cli) -->
<utplsql.cli>${basedir}/lib/utPLSQL-cli/bin/utplsql</utplsql.cli>
<!-- ConnectionURL -->
<utplsql.url>${db.user.test}/${db.pw.test}@//${db.host}/${db.service}</utplsql.url>
<!-- Output directory -->
<utplsql.out>${project.build.directory}/utplsql/</utplsql.out>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>utplsql-mkdir</id> <!-- create the output directory -->
<phase>process-test-classes</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<longModulepath>false</longModulepath>
<executable>mkdir</executable>
<arguments>
<argument>-p</argument>
<argument>${utplsql.out}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>utplsql-run</id> <!-- run utPLSQL -->
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${utplsql.cli}</executable>
<workingDirectory>${project.build.directory}</workingDirectory>
<arguments>
<argument>run</argument>
<argument>${utplsql.url}</argument>
<argument>-f=ut_documentation_reporter</argument>
<argument>-s</argument>
<argument>-f=ut_xunit_reporter</argument>
<argument>-o=${utplsql.out}/xunit.xml</argument>
<argument>-f=ut_coverage_html_reporter</argument>
<argument>-o=${utplsql.out}/coverage.html</argument>
<argument>--failure-exit-code=1</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
</project>
@jgebal
Copy link

jgebal commented Nov 27, 2017

Awesome idea. Thanks for sharing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment