1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  package org.basepom.mojo.propertyhelper;
16  
17  import java.io.IOException;
18  
19  import com.google.common.flogger.FluentLogger;
20  import org.apache.maven.plugin.MojoExecutionException;
21  import org.apache.maven.plugins.annotations.Mojo;
22  import org.apache.maven.plugins.annotations.Parameter;
23  
24  
25  
26  
27  @Mojo(name = "get", threadSafe = true)
28  public final class GetMojo extends AbstractPropertyHelperMojo {
29  
30      private static final FluentLogger LOG = FluentLogger.forEnclosingClass();
31  
32      
33  
34  
35  
36      @Parameter(defaultValue = "false")
37      boolean persist = false;
38  
39  
40      @Override
41      protected void doExecute() throws MojoExecutionException, IOException {
42          LOG.atFine().log("Running property-helper:get");
43  
44          createFieldDefinitions();
45          createFields();
46          createGroups();
47  
48          if (persist) {
49              LOG.atFine().log("Persisting value cache");
50              
51              valueCache.persist();
52          }
53      }
54  }