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.Properties;
19  
20  import org.kuali.common.util.property.Constants;
21  import org.springframework.beans.factory.annotation.Autowired;
22  import org.springframework.beans.factory.annotation.Qualifier;
23  import org.springframework.context.annotation.Configuration;
24  import org.springframework.util.Assert;
25  
26  /**
27   * Enhance the wired in Maven properties and create a <code>ProjectProperties</code> bean from them.
28   * 
29   * @deprecated
30   */
31  @Deprecated
32  @Configuration
33  public class MavenPropertySourceConfig extends AbstractPropertySourceConfig {
34  
35  	@Autowired
36  	@Qualifier(Constants.DEFAULT_MAVEN_PROPERTIES_BEAN_NAME)
37  	Properties mavenProperties;
38  
39  	@Override
40  	protected org.kuali.common.util.property.ProjectProperties getProjectProperties() {
41  
42  		// Make sure the maven properties got wired in correctly
43  		Assert.notNull(mavenProperties, "mavenProperties are null");
44  
45  		// Add in org, group, home, and enhanced version properties
46  		org.kuali.common.util.MavenUtils.augmentProjectProperties(mavenProperties);
47  
48  		// Create a ProjectProperties pojo from the properties
49  		return org.kuali.common.util.MavenUtils.getMavenProjectProperties(mavenProperties);
50  	}
51  
52  }