Example example_uses-provides_uses-in-client
Part of the full Java 9 Jigsaw modules example suite.
|
Authors
Originally written by Martin Lehmann, Kristine Schaal and RĂ¼diger Grammes (cf. original repository). Migrated for Java Modules support documentation of Apache MavenTM in the course of the Maven Support & Care program by Gerd Aschemann (and other team members) as forked repository. Please add discussions, requirements, bugfixes, etc. to the fork instead of the original. |
What is this example about?
Modules in this example
-
modmain, modservicedefinition, modserviceimplementation1, modserviceimplementation2
-
modmain has a Main class which is started in run.sh
Module Dependency Graph, created with DepVis
Example shows …
-
Usage of uses and provides
-
This example is the same as example_uses-provides but the
usesstatement is not in modservicedefinition but in modmain! (Souses …and the interface are not in the same module.)
Output
This example uses golden master testing to ensure output consistency.
The expected output is compared with actual output using verify.sh.
Expected Output
Found com.service.impl.ServiceImpl
Found net.service.impl.ServiceImpl
We finally use this implementation: net.service.impl.ServiceImpl
Maven 4 Migration
This example was migrated to Maven 4 using the standard approach documented in the central Maven 4 Migration guide. The migration required no special configuration beyond the standard Module Source Hierarchy setup.