You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: We're using the `antrun` plugin here to illustrate the proper way to make use of the discovered directories. They will be useful **ONLY IN PLUGIN CONFIGURATIONS, NOT DURING POM INTERPOLATION**.
68
70
@@ -71,15 +73,16 @@ execution-root Goal
71
73
72
74
This goal's output is roughly equivalent to using the `${session.executionRootDirectory}` expression in a plugin parameter value. Using the `execution-root` goal in place of `[GOAL NAME]` above, we see the following:
[echo] Test Configuration Directory: /Users/jdcasey/workspace/couch-java-looseLeaf/routem/src/test/configs
85
+
```
83
86
84
87
**NOTE:** This goal will inject a property that contains the absolute path of the directory in which Maven was invoked. Each project will have the property, and any plugins that execute after the `directory:execution-root` runs will have access to it.
85
88
@@ -88,27 +91,28 @@ directory-of Goal
88
91
89
92
If, instead of the execution root, you need to reference a directory in a specific module within the reactor, but don't want to do endless relative-path calculus, you can use the `directory-of` goal. For this goal to function properly, you need to specify a `project` parameter containing `groupId` and `artifactId`, like this:
90
93
91
-
<configuration>
92
-
<property>myDirectory</property>
93
-
<project>
94
-
<groupId>org.commonjava.routem</groupId>
95
-
<artifactId>routem-api</artifactId>
96
-
</project>
97
-
</configuration>
98
-
94
+
```xml
95
+
<configuration>
96
+
<property>myDirectory</property>
97
+
<project>
98
+
<groupId>org.commonjava.routem</groupId>
99
+
<artifactId>routem-api</artifactId>
100
+
</project>
101
+
</configuration>
102
+
```
99
103
100
104
Now, when we substitute `directory-of` for `[GOAL NAME]` in the usage template above, we get output like this:
[echo] Test Configuration Directory: /Users/jdcasey/workspace/couch-java-looseLeaf/routem/api/src/test/configs
111
-
113
+
main:
114
+
[echo] Test Configuration Directory: /Users/jdcasey/workspace/couch-java-looseLeaf/routem/api/src/test/configs
115
+
```
112
116
113
117
**NOTE:** This goal will function similarly to `execution-root` in terms of injecting a project property for later plugins to use. **HOWEVER**, if the reference project isn't found in the current build session, this goal will fail the build.
114
118
@@ -121,13 +125,15 @@ If the multimodule hierarchy uses multiple sibling parents from the disk that ar
121
125
122
126
If we modify the `execution-root` example to use the `highest-basedir` goal, then execute from the web/admin subdirectory of our sample project, we will see the following:
0 commit comments