// Protected
// -----------------------------------------------------------------------
protected Daemon createDaemon( MavenProject project, ArtifactRepositoryLayout layout )
{
Daemon complete = new Daemon();
complete.setClasspath( new Classpath() );
// -----------------------------------------------------------------------
// Add the project itself as a dependency.
// -----------------------------------------------------------------------
Dependency projectDependency = new Dependency();
Artifact projectArtifact = project.getArtifact();
if ( ! "pom".equalsIgnoreCase(projectArtifact.getType()) ){
projectArtifact.isSnapshot();
projectDependency.setGroupId( projectArtifact.getGroupId() );
projectDependency.setArtifactId( projectArtifact.getArtifactId() );
projectDependency.setVersion( projectArtifact.getVersion() );
projectDependency.setClassifier( projectArtifact.getClassifier() );
projectDependency.setRelativePath( layout.pathOf( projectArtifact ) );
complete.getClasspath().addDependency( projectDependency );
}
// -----------------------------------------------------------------------
// Add all the dependencies from the project.
// -----------------------------------------------------------------------
for ( Iterator it = project.getRuntimeArtifacts().iterator(); it.hasNext(); )
{
Artifact artifact = (Artifact) it.next();
artifact.isSnapshot();
Dependency dependency = new Dependency();
dependency.setGroupId( artifact.getGroupId() );
dependency.setArtifactId( artifact.getArtifactId() );
dependency.setVersion( artifact.getVersion() );
dependency.setClassifier( artifact.getClassifier() );
dependency.setRelativePath( layout.pathOf( artifact ) );
complete.getClasspath().addDependency( dependency );
}
return complete;
}