System.out.println( "Analysing dependencies ..." );
for ( Iterator i = model.getAllDependencies().iterator(); i.hasNext(); )
{
Dependency dep = (Dependency) i.next();
dep.getRepositories().addAll( model.getRepositories() );
if ( modelFileCache.containsKey( dep.getId() ) )
{
buildProject( resolver.getArtifactFile( dep.getPomDependency() ).getParentFile(), false );
}
}
resolver.downloadDependencies( model.getAllDependencies() );
System.out.println();
System.out.println();
System.out.println( "Building project in " + basedir );
line();
// clean
System.out.println( "Cleaning " + buildDirFile + "..." );
FileUtils.forceDelete( buildDirFile );
// ----------------------------------------------------------------------
// Generate sources - modello
// ----------------------------------------------------------------------
File generatedSourcesDirectory = null;
if ( model.getPlugins().containsKey( MODELLO_PLUGIN_ID ) )
{
Plugin plugin = (Plugin) model.getPlugins().get( MODELLO_PLUGIN_ID );
File modelFile = new File( basedir, (String) plugin.getConfiguration().get( "model" ) );
System.out.println( "Model exists!" );
String modelVersion = (String) plugin.getConfiguration().get( "version" );
if ( modelVersion == null || modelVersion.trim().length() < 1 )
{
System.out.println( "No model version configured. Using \'1.0.0\'..." );
modelVersion = "1.0.0";
}
generatedSourcesDirectory = new File( basedir, "target/generated-sources/modello" );
if ( !generatedSourcesDirectory.exists() )
{
generatedSourcesDirectory.mkdirs();
}
Dependency dependency = plugin.asDependencyPom();
resolver.downloadDependencies( Collections.singletonList( dependency ) );
File artifactFile = resolver.getArtifactFile( dependency );
Model pluginReader = readModel( artifactFile, true );
List dependencies = new ArrayList();
for ( Iterator i = pluginReader.getAllDependencies().iterator(); i.hasNext(); )
{
Dependency d = (Dependency) i.next();
if ( !d.getGroupId().equals( "org.apache.maven" ) )
{
dependencies.add( d );
}
}