1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.maven.spring;
17
18 import java.util.List;
19
20 import org.apache.maven.project.MavenProject;
21 import org.kuali.common.util.execute.Executable;
22 import org.kuali.common.util.execute.ShowPropertiesExecutable;
23 import org.kuali.common.util.maven.MavenConstants;
24 import org.kuali.common.util.spring.SpringUtils;
25 import org.springframework.beans.factory.annotation.Autowired;
26 import org.springframework.beans.factory.annotation.Qualifier;
27 import org.springframework.context.annotation.Bean;
28 import org.springframework.context.annotation.Configuration;
29 import org.springframework.core.env.Environment;
30
31 @Configuration
32 public class ShowNativeMavenPropertiesConfig {
33
34 @Autowired
35 Environment env;
36
37 @Autowired
38 @Qualifier(MavenConstants.PROJECT_BEAN_NAME)
39 MavenProject mavenProject;
40
41 @Bean(initMethod = "execute")
42 public Executable showNativeMavenPropertiesExecutable() {
43 List<String> includes = SpringUtils.getListFromCSV(env, "properties.show.includes", "*");
44 List<String> excludes = SpringUtils.getListFromCSV(env, "properties.show.excludes", "");
45
46 ShowPropertiesExecutable executable = new ShowPropertiesExecutable();
47 executable.setProperties(mavenProject.getProperties());
48 executable.setExcludes(excludes);
49 executable.setIncludes(includes);
50 return executable;
51 }
52
53 }