An open API service indexing awesome lists of open source software.

https://github.com/jdcasey/emb

Extensible versions of Apache Maven
https://github.com/jdcasey/emb

Last synced: 3 months ago
JSON representation

Extensible versions of Apache Maven

Awesome Lists containing this project

README

          

# EMB - Extensible, Modular Builds #

EMB is a build tool that wraps and extends [Apache Maven](http://maven.apache.org/). Its goal is to provide a mechanism for changing the core functionality of Maven using sets of add-on libraries.

## Getting Started ##

The simplest way to use EMB is via the emb-booter. To do this, first add a dependency in your POM to emb-booter:


4.0.0
org.commonjava.emb.example
example
1.0-SNAPSHOT

3.0-beta-2
0.3-SNAPSHOT



org.commonjava.emb
emb-booter
${embVersion}


Then, create a new EMBEmbedder instance, and use it to build a project:

List goals = new ArrayList();
goals.add( "clean" );
goals.add( "install" );

new EMBEmbedderBuilder().build().execute( new EMBExecutionRequest().setGoals( goals ) );

## Using Services ##

You can use allowed Maven components via the ServiceManager. For instance, to resolve an artifact:

EMBEmbeder emb = new EMBEmbedderBuilder().build();
emb.serviceManager().repositorySystem().resolve( artifact );

Or, to build a set of MavenProject instances from POM files:

EMBEmbeder emb = new EMBEmbedderBuilder().build();

ProjectBuildingRequest req = new DefaultProjectBuildingRequest()
.setSystemProperties( System.getProperties() )
.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL )
.setForceUpdate( true )
.setProcessPlugins( false )
.setRepositoryCache( new InternalRepositoryCache() )
.setLocalRepository( emb.serviceManager()
.repositorySystem()
.createLocalRepository( new File( workDir, "local-repository" ) ) );

List results = emb.serviceManager().projectBuilder().build( pomFiles, useReactor, req );

List projects = new ArrayList( pomFiles.size() );
for ( final ProjectBuildingResult result : results )
{
projects.add( result.getProject() );
}