A maven build plugin for transferring resources, compiling CCL code and unit tests, executing the tests, and retrieving the test and code coverage results. Additional reporting plugins are used to add the results to the maven site.
Maven must be configured as described here.
The expected project layout is shown below. This can be overridden with configuration options.
project_directory
pom.xml
- src
- main
- ccl
- resources
- test
- ccl
- resources
Here is the plugin specification.
<plugin>
<groupId>com.cerner.ccl.testing</groupId>
<artifactId>ccl-maven-plugin</artifactId>
<version>3.4</version>
<extensions>true</extensions>
</plugin>
A complete sample pom is available. It includes various reporting plugins discussed elsewhere. If mvn test -Pprofile
succeeds
but mvn test site -Pprofile
fails, some of the reporting plugins are at fault. Remove them from the build or visit their
individual documentation for suggestions.
A maven archetype is available to automatically create an empty starter project with the proper folder layout and the sample pom referenced above.
Execute the following command to get started looking here for guidance on populating the prompts.
mvn archetype:generate -Dfilter=com.cerner.ccl.archetype:cclunit-archetype
A number of configuration options are available. Look here for details.
Don’t want your password showing up in log files? Look here.
Look here for guidance.
All goals require a -Pprofile
argument to indicate the target host and domain and credentials for them. All file transfers are performed using sftp.
validate
process-resources
compile
process-test-resources
test-compile
test
If you are building the plugin from source please note the following points.
The integration tests for the plugin require an active maven profile that provides all the information required to use the plugin including identification of a target node, environment and domain as well as credentials for accessing them.
The integration tests will not compile properly with m2eclipse. To work around this, manually invoke the “test-compile” lifecycle (with an appropriate profile) from a command prompt. The desired version of the plugin must reside in the local maven repo as that is what the integration tests will run against when executed within the IDE.
The integration tests require a system property named maven-profile
with value equal to the id of the domain specific profile.
For convenience, the profile should set that property.
<profile>
<id>p-id</id>
<properties>
<ccl-host>p-host</ccl-host>
<ccl-environment>p-env</ccl-environment>
<ccl-domain>p-domain</ccl-domain>
<ccl-hostCredentialsId>p-host</ccl-hostCredentialsId>
<ccl-frontendCredentialsId>p-domain</ccl-frontendCredentialsId>
<maven-profile>p-id</maven-profile>
</properties>
<activation>
<property>
<name>maven-profile</name>
<value>p-id</value>
</property>
</activation>
</profile>