Allure integration with multi-module test suite
There are many open points on this question which are not clear due to lack of details.
According to your description the project structure is hence as following:
project | |--- test-module |--- core-module |--- driver-module (depends on `core` and `test`) | \ pom.xml
You actually execute tests only via the driver
module and via the exec-maven-plugin
, however the allure documentation specifies the classic approach, to execute the test
phase, that is, the Maven phase dedicated to tests execution (via the maven-surefire-plugin
, automatically invoked by Maven during this phase via default bindings).
You actually configure the maven-surefire-plugin
as specified by its documentation: specifying it into the parent pom.xml
file would be fine in this case, in its pluginManagement
section > Maven will pick up its global configuration during the default-test
execution of the default maven-surefire-plugin
binding.
However, the whole mechanism is linked to the test
phase. Do you execute it?
You did not provide details about the exec-maven-plugin
and what it is supposed to do concerning the driver
module and why you would use the jetty-maven-plugin
to see the report. Normally, test reports are available and can be seen direct html
files, no need to host them in an embedded jetty server, unless required by the overall process (CI, deployment to a company server, etc.). These reports should also be made available to the project documentation site, which can be generated via the site
lifecycle and its maven-site-plugin
.
From your details, you share the jetty-maven-plugin
configuration pointing at a site
folder: is this folder generated during the test
phase (if you invoke it)? Or during your exec
invocation?
Concerning the way you use dependencies in the parent pom, you actually did not share it in your question, so not easy to help. Normally, you would put dependencies in the dependencies
section of the parent pom which are common to all modules (e.g. classic example is log4j
, something every module would use). Otherwise, you would use the dependencyManagement
section of the parent pom to manage versions of certain dependencies which could be use by one or more modules (but modules would need to re-declare them to effectively use them, omitting their versions though, specified by the parent). That is, the parent pom is a central place of governance and harmonisation.
Update
Concerning the /target/allure-results
folder generated, you need also to check its content to be a valid site directory (that is, e.g. it should contain an index.html
).
Creating a new Maven webapp project and adding the following to its pom.xml
file:
<build> <plugins> <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.2.10.v20150310</version> <configuration> <webAppSourceDirectory>${project.build.directory}/site</webAppSourceDirectory> <stopKey>stop</stopKey> <stopPort>1234</stopPort> </configuration> </plugin> </plugins></build>
(Note: exactly as per your question, but pointing simply to the site
directory)
And executing:
mvn clean install sitemvn jetty:run
the Maven site (generated during the site
phase as invoked above) would be available at localhost:8080
(default jetty URL). That's because an index.html
was generated.
However, if I manually delete the index.html
, the jetty will show an Directory: /
page, listing the available files.
Hence, most probably, the allure report didn't generate an index.html
file, because most probably it is not meant to generate it, but simply an HTML report generared during the test
phase.