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
- Host: GitHub
- URL: https://github.com/jdcasey/emb
- Owner: jdcasey
- Created: 2010-04-30T20:19:56.000Z (about 16 years ago)
- Default Branch: master
- Last Pushed: 2011-11-07T21:50:24.000Z (over 14 years ago)
- Last Synced: 2025-03-11T12:58:08.660Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 1.29 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE-2.0.html
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() );
}