View Javadoc

1   package org.kuali.maven.plugins.spring.config;
2   
3   import org.kuali.common.util.execute.Executable;
4   import org.kuali.maven.plugins.spring.AbstractSpringMojo;
5   import org.kuali.maven.plugins.spring.MavenConstants;
6   import org.kuali.maven.plugins.spring.MojoExecutable;
7   import org.kuali.maven.plugins.spring.SpringMojoService;
8   import org.springframework.beans.factory.annotation.Autowired;
9   import org.springframework.beans.factory.annotation.Qualifier;
10  import org.springframework.context.annotation.Bean;
11  import org.springframework.context.annotation.Configuration;
12  
13  @Configuration
14  public class MojoConfig {
15  
16  	@Autowired
17  	@Qualifier(MavenConstants.DEFAULT_MAVEN_MOJO_BEAN_NAME)
18  	AbstractSpringMojo mojo;
19  
20  	@Autowired
21  	@Qualifier(MavenConstants.SPRING_MOJO_SERVICE_BEAN_NAME)
22  	SpringMojoService service;
23  
24  	@Bean(initMethod = "execute")
25  	public Executable executable() {
26  		MojoExecutable executable = new MojoExecutable();
27  		executable.setService(service);
28  		executable.setMojo(mojo);
29  		return executable;
30  	}
31  }