1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.commonjava.maven.plugins.execroot;
17
18 import java.io.File;
19 import java.nio.file.Path;
20
21 import org.apache.maven.plugins.annotations.LifecyclePhase;
22 import org.apache.maven.plugins.annotations.Mojo;
23
24
25
26
27 @Mojo(name = "execution-root", defaultPhase = LifecyclePhase.INITIALIZE, requiresProject = true, threadSafe = true)
28 public class ExecutionRootGoal extends AbstractDirectoryGoal {
29
30
31 protected static final String EXEC_ROOT_CONTEXT_KEY = "directories.execRoot";
32
33 @Override
34 protected File findDirectory() {
35 return Path.of(session.getExecutionRootDirectory()).toFile();
36 }
37
38 @Override
39 protected String getContextKey() {
40 return EXEC_ROOT_CONTEXT_KEY;
41 }
42
43 @Override
44 protected String getLogLabel() {
45 return "Execution-Root";
46 }
47
48 }