I have a multi-module project, with a structure like this:
Then, I try to execute single integration test that is located in the pollen-reports-framework
module, as below:
mvn test -Dtest="com.jspollen.reports.resource.ReportResourceIntegrationTest"
It chugs along nicely (or so it seems), executing the required test:
[INFO] Results:
[INFO]
[INFO] Tests run: 44, Failures: 0, Errors: 0, Skipped: 0
, but then it tries to run the same test from another module and keels over:
[INFO] pollen-service-reports ............................. SUCCESS [ 1.607 s]
[INFO] pollen-reports-framework ........................... SUCCESS [ 30.620 s]
[INFO] pollen-reports-askpollen ........................... FAILURE [ 0.444 s]
[INFO] pollen-reports-homepagestats ....................... SKIPPED
[INFO] pollen-reports-keymeasures ......................... SKIPPED
[INFO] pollen-reports-customerprofile ..................... SKIPPED
[INFO] pollen-reports-kpitree ............................. SKIPPED
[INFO] pollen-reports-contributionbykpi ................... SKIPPED
[INFO] pollen-reports-productassociation .................. SKIPPED
[INFO] pollen-reports-contributionbyuserdefined ........... SKIPPED
[INFO] pollen-reports-rangeoptimiser ...................... SKIPPED
[INFO] pollen-reports-promotionscalendar .................. SKIPPED
[INFO] pollen-reports-repeatpurchase ...................... SKIPPED
[INFO] pollen-reports-crossshop ........................... SKIPPED
[INFO] pollen-reports-npdcalendar ......................... SKIPPED
[INFO] pollen-reports-customerjourney ..................... SKIPPED
[INFO] pollen-reports-controlstoreselector ................ SKIPPED
[INFO] pollen-reports-productswitching .................... SKIPPED
[INFO] pollen-reports-npdbenchmark ........................ SKIPPED
[INFO] pollen-reports-promotionsoptimisation .............. SKIPPED
[INFO] pollen-reports-rangingtree ......................... SKIPPED
[INFO] pollen-reports-gmandckeymeasures ................... SKIPPED
[INFO] pollen-reports-gmandccustomerprofile ............... SKIPPED
[INFO] pollen-reports-app ................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.141 s
[INFO] Finished at: 2022-06-24T17:09:43+01:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "artifactory" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project pollen-reports-askpollen: No tests were executed! (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]
The errror suggests it tries to run the test in the project pollen-reports-askpollen
, which is not where it is.
How can I avoid the below error and get a sensible test run report for a perfectly well executed test in the above set-up?