1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util;
17
18 import org.apache.commons.lang3.StringUtils;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
21
22 public class MavenUtils {
23
24 private static final Logger logger = LoggerFactory.getLogger(MavenUtils.class);
25
26 public static final String POM = "pom";
27
28
29
30
31 public static final boolean skip(boolean forceMojoExecution, boolean skip, String packaging) {
32 if (forceMojoExecution) {
33 logger.info("Forced mojo execution");
34 return false;
35 }
36 if (skip) {
37 logger.info("Skipping mojo execution");
38 return true;
39 }
40 if (StringUtils.equalsIgnoreCase(packaging, POM)) {
41 logger.info("Skipping mojo execution for project with packaging type '{}'", POM);
42 return true;
43 } else {
44 return false;
45 }
46 }
47
48 }