I have a multi-module Maven+Spring project. Some modules depend on other modules.
Let's say we have a module named services
that depends on the module named persistence
.
The services module :
- At Spring level, imports the
persistence
context - At Maven level, depends on the
persistence
module
The persistence
module defines some configuratrion related to the... persistence : datasource, JPA, transactions...
It has some dependencies for testing the DB (JDBC drivers, DBCP, H2) that are limited to the test scope, since when the app is deployed, the DataSource will defined in the container (Tomcat) and accessed via JNDI.
Now, I would like to have access, during the Maven test phase of the services
module, to the test-scoped (transitive) dependencies of the persistence
module.
The Maven manual (Table 3.1) say that normally, test-scope dependencies are not available transitively.
Is it possible to obtain them somehow in the context of a multi-module project ?
If not what are good alternatives ? (Define the test dependencies in the parent pom ?... )