Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/veithen/hermetic-maven-plugin
Maven plugin to make test execute hermetically
https://github.com/veithen/hermetic-maven-plugin
maven-plugin
Last synced: about 2 months ago
JSON representation
Maven plugin to make test execute hermetically
- Host: GitHub
- URL: https://github.com/veithen/hermetic-maven-plugin
- Owner: veithen
- Created: 2018-12-26T23:17:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-16T07:55:37.000Z (4 months ago)
- Last Synced: 2024-09-16T11:19:35.190Z (4 months ago)
- Topics: maven-plugin
- Language: Java
- Homepage:
- Size: 287 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hermetic-maven-plugin
This Maven plugin configures the Maven build so that tests are executed hermetically, i.e. without access to remote resources. To achieve this the plugin generates a Java 2 security policy and configures a custom security manager. By default the corresponding command line arguments are added to the `argLine` property so that they are picked up by [maven-surefire-plugin](http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#argLine).
## Making maven-invoker-plugin executions hermetic
By default the plugin only makes unit tests hermetic. To make integration tests for Maven plugins hermetic, add the following line to the maven-invoker-plugin configuration:
${argLine}
If the integration test projects have unit tests, their execution will fail because maven-surefire-plugin tries to fork a VM (which by default is forbidden by the generated security policy). Use one of the following options to solve this:
1. Add `0` to the maven-surefire-plugin configuration in the test projects.
2. Add `true` to the hermetic-maven-plugin configuration in the main project. You should then add `@argLine@` to the maven-surefire-plugin configuration in the test projects so that the unit tests in those projects are executed hermetically.