View Javadoc

1   /**
2    * Copyright 2010-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.common.util.spring;
17  
18  import java.util.List;
19  import java.util.Properties;
20  
21  import org.kuali.common.util.execute.Executable;
22  import org.kuali.common.util.execute.ShowPropertiesExecutable;
23  import org.kuali.common.util.property.Constants;
24  import org.springframework.beans.factory.annotation.Autowired;
25  import org.springframework.beans.factory.annotation.Qualifier;
26  import org.springframework.context.annotation.Bean;
27  import org.springframework.context.annotation.Configuration;
28  import org.springframework.core.env.Environment;
29  
30  @Configuration
31  public class ShowMavenPropertiesConfig {
32  
33  	@Autowired
34  	Environment env;
35  
36  	@Autowired
37  	@Qualifier(Constants.DEFAULT_MAVEN_PROPERTIES_BEAN_NAME)
38  	Properties mavenProperties;
39  
40  	@Bean(initMethod = "execute")
41  	public Executable showPropertiesExecutable() {
42  		List<String> includes = SpringUtils.getListFromCSV(env, "properties.show.includes", "*");
43  		List<String> excludes = SpringUtils.getListFromCSV(env, "properties.show.excludes", "");
44  
45  		ShowPropertiesExecutable executable = new ShowPropertiesExecutable();
46  		executable.setProperties(mavenProperties);
47  		executable.setExcludes(excludes);
48  		executable.setIncludes(includes);
49  		return executable;
50  	}
51  
52  }