Skip to content

hiwepy/maven-invoker-spring-boot-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

maven-invoker-spring-boot-starter

Spring Boot Starter For Maven Invoker

说明

基于 maven-invoker 的 Spring Boot Starter 实现

  1. 整合 maven-invoker

Maven

<dependency>
	<groupId>com.github.hiwepy</groupId>
	<artifactId>maven-invoker-spring-boot-starter</artifactId>
	<version>${project.version}</version>
</dependency>

Sample

import javax.annotation.PostConstruct;

import org.apache.maven.spring.boot.ext.MavenInvokerTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@EnableMavenInvoker
@SpringBootApplication
public class Application {
	
	@Autowired
	private MavenInvokerTemplate mavenInvokerTemplate;
	
	@PostConstruct
	private void init() {
		
		//mavenInvokerTemplate.deploy(file, groupId, artifactId, version, packaging, url, repositoryId);
		//mavenInvokerTemplate.deploy(basedir, file, groupId, artifactId, version, packaging, url, repositoryId);
		
		//mavenInvokerTemplate.execute(basedir, goals);
		//mavenInvokerTemplate.execute(basedir, goals);
		
	}
	
	public static void main(String[] args) throws Exception {
		SpringApplication.run(Application.class, args);
	}

}