@@ -50,10 +50,10 @@ so package:
50
50
* ` moduleA.exportOnlyToB ` will be exported only to ` moduleB `
51
51
* ` moduleA.internal ` is encapsulated & other modules don't have access
52
52
to it. For example if you uncomment the line in ` moduleB.TestB ` :
53
- ```
54
- // InternalA internalA; // no access
55
- ```
56
- project will not compile.
53
+ ```
54
+ // InternalA internalA; // no access
55
+ ```
56
+ project will not compile.
57
57
### moduleB
58
58
```
59
59
module moduleB {
@@ -73,7 +73,7 @@ so (we don't repeat keyword defined in previous step):
73
73
* ` moduleB ` is reporting dependency on ` moduleA ` , what is more - every
74
74
further module that will be requiring ` moduleB ` will get access to
75
75
` moduleA ` also.
76
- Note that we have to put ` moduleA ` also in ` pom.xml ` (without ` pom.xml `
76
+ * Note that we have to put ` moduleA ` also in ` pom.xml ` (without ` pom.xml `
77
77
we should add ` moduleA ` to ` module-path ` of ` moduleB ` otherwise project
78
78
will not compile).
79
79
@@ -102,15 +102,15 @@ so:
102
102
` moduleB ` ) we have to also add it to ` pom.xml ` - if not, nothing more
103
103
should be done.
104
104
* note that if you uncomment the line in ` moduleC.TestC ` :
105
- ```
106
- // ExportAOnlyToB exportAOnlyToB; // no access
107
- ```
105
+ ```
106
+ // ExportAOnlyToB exportAOnlyToB; // no access
107
+ ```
108
108
project will not compile, so package `ExportAOnlyToB` was correctly
109
109
exported only to `moduleB` (`moduleB.TestB`)
110
110
* in `moduleC.TestC` we use transitive dependency on `moduleA`:
111
- ```
112
- ExportA.export();
113
- ```
111
+ ```
112
+ ExportA.export();
113
+ ```
114
114
____
115
115
### reflection
116
116
Module with only one simple class `Invoker` to invoker static methods:
@@ -153,8 +153,8 @@ the `Sources Root` (`src/main/java`)
153
153
* Note that if we put file `moduleA.TestA` on the same level as
154
154
`module-info.java` compilation will succedd, but running main method
155
155
will result in `error`:
156
- ```
157
- Error occurred during initialization of boot layer
158
- java.lang.module.FindException: Error reading module: path\moduleB\target\classes
159
- Caused by: java.lang.module.InvalidModuleDescriptorException: TestB.class found in top-level directory (unnamed package not allowed in module)
160
- ```
156
+ ```
157
+ Error occurred during initialization of boot layer
158
+ java.lang.module.FindException: Error reading module: path\moduleB\target\classes
159
+ Caused by: java.lang.module.InvalidModuleDescriptorException: TestB.class found in top-level directory (unnamed package not allowed in module)
160
+ ```
0 commit comments