Skip to main content

Posts

Showing posts with the label Maven

Comparison of maven-surefire-plugin and maven-failsafe-plugin

 Comparison of maven-surefire-plugin and maven-failsafe-plugin: References :     Maven Failsafe Plugin: https://maven.apache.org/surefire/maven-failsafe-plugin/index.html      Maven Surefire Plugin: https://maven.apache.org/surefire/maven-surefire-plugin/index.html   Someone asked me then what is the advantage of using one over the another. The advantage is the way they fail: Failsafe > runs all the integration tests, but if any tests fail during the integration-test phase, the plugin does not fail the build immediately. It still executes the post-integration-test phase. Therefore we can still perform any cleanup and environment tear-down as part of the post-integration-test phase. The subsequent verify phase of the build process reports any test failures. Surefire > It binds with the test phase, in case of any test failures, the build fails, and no further phases execute during the build process.

Transitive and Excluded dependency in Maven

Transitive dependency in Maven: Let say you have a library A1 that depends on library A2 and this A2 library further depends on the library A3. So your library A3 is a Transitive Dependency of your library A1. Excluded dependency in Maven: Let say you have a library A1 that depends on library A2, and this A2 library further depends on the library A3. If required,  we can explicitly exclude library A3 for the library A1. We can use the “exclusion” element to exclude it. Such dependencies are called Excluded dependencies in Maven.