Hi, I have written a java library that I want to be fully working for various situations.
The thing I'm having trouble with is testing my error handling in case of missing dependencies that are expected to be "provided". Some of these dependencies are only called in edge cases in the processing. Thus I have a forced check at the startup to verify everything is correct. I have created several maven modules in my project dedicated to those kinds of tests. I found however that in some cases it makes a difference running the "mvn test" in those modules when running them from the root of the project or when running it only in the specific testing module. Specific example: I have log4j-core as a provided dependency in my "library" module and when I run the "full project" build my error handling test fails as the testing module will "have" the log4j-core dependency (where I want to test the scenario it doesn't have it). So my build fails. I then continue the build with mvn package -rf :integration-tests-logging-java-no-log4j then the test does pass (i.e. the missing dependency is properly missing and the error handling works as expected). What is the correct way to resolve this effect? -- Best regards / Met vriendelijke groeten, Niels Basjes
