1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util;
17
18 import java.util.Properties;
19
20 import org.kuali.common.util.spring.service.PropertySourceAddPriority;
21 import org.kuali.common.util.spring.service.PropertySourceContext;
22 import org.kuali.common.util.spring.service.SpringContext;
23
24
25
26
27
28
29 @Deprecated
30 public class MavenUtils {
31
32 @Deprecated
33 public static final String POM = org.kuali.common.util.maven.MavenUtils.POM;
34 @Deprecated
35 public static final String PROJECT_VERSION_KEY = org.kuali.common.util.maven.MavenUtils.PROJECT_VERSION_KEY;
36 @Deprecated
37 public static final String PROJECT_ENCODING_KEY = org.kuali.common.util.maven.MavenUtils.PROJECT_ENCODING_KEY;
38
39 public static org.kuali.common.util.service.SpringContext getMavenizedSpringContext(Class<?> propertySourceConfig) {
40 SpringContext context = org.kuali.common.util.maven.MavenUtils.getMavenizedSpringContext(propertySourceConfig);
41 return convert(context);
42 }
43
44 private static final org.kuali.common.util.service.SpringContext convert(SpringContext newContext) {
45 if (newContext == null) {
46 return null;
47 }
48 org.kuali.common.util.service.SpringContext oldContext = new org.kuali.common.util.service.SpringContext();
49 oldContext.setAnnotatedClasses(newContext.getAnnotatedClasses());
50 oldContext.setBeanNames(newContext.getBeanNames());
51 oldContext.setBeans(newContext.getBeans());
52 oldContext.setDisplayName(newContext.getDisplayName());
53 oldContext.setId(newContext.getId());
54 oldContext.setLocations(newContext.getLocations());
55 oldContext.setPropertySourceContext(convert(newContext.getPropertySourceContext()));
56 return oldContext;
57 }
58
59 private static final org.kuali.common.util.service.PropertySourceContext convert(PropertySourceContext newContext) {
60 if (newContext == null) {
61 return null;
62 }
63 org.kuali.common.util.service.PropertySourceContext oldContext = new org.kuali.common.util.service.PropertySourceContext();
64 oldContext.setLastOneInWins(newContext.isLastOneInWins());
65 oldContext.setRemoveExistingSources(newContext.isRemoveExistingSources());
66 oldContext.setSources(newContext.getSources());
67 oldContext.setPriority(convert(newContext.getPriority()));
68 return oldContext;
69 }
70
71 private static final org.kuali.common.util.service.PropertySourceAddPriority convert(PropertySourceAddPriority newPriority) {
72 if (newPriority == null) {
73 return null;
74 }
75 return org.kuali.common.util.service.PropertySourceAddPriority.valueOf(newPriority.name());
76 }
77
78
79
80
81 public static SpringContext getMavenizedSpringContext(Properties mavenProperties, Class<?> propertySourceConfig) {
82 return org.kuali.common.util.maven.MavenUtils.getMavenizedSpringContext(mavenProperties, propertySourceConfig);
83 }
84
85
86
87
88
89 public static void augmentProjectProperties(Properties mavenProperties) {
90 org.kuali.common.util.maven.MavenUtils.augmentProjectProperties(mavenProperties);
91 }
92
93 public static org.kuali.common.util.property.ProjectProperties getMavenProjectProperties(Properties mavenProperties) {
94 return org.kuali.common.util.maven.MavenUtils.getMavenProjectProperties(mavenProperties);
95 }
96
97
98
99
100 public static final boolean skip(boolean forceMojoExecution, boolean skip, String packaging) {
101 return org.kuali.common.util.maven.MavenUtils.skip(forceMojoExecution, skip, packaging);
102 }
103
104 }