logger.finest( "NPANDAY-190-002: Converting Project: Artifact ID = " + project.getArtifactId() +
", Dependency Count =" + project.getProjectDependencies().size() );
Model model = ProjectFactory.createModelFrom( project );
ArtifactHandler handler = new DefaultArtifactHandler(
ArtifactType.getArtifactTypeForPackagingName( artifact.getType() ).getExtension() );
artifact.setArtifactHandler( handler );
ArtifactRepositoryLayout layout = new DefaultRepositoryLayout();
if ( !project.getArtifactType().equals( "pom" ) )
{
if ( artifact.getFile().exists() )
{
FileUtils.copyFile( artifact.getFile(), new File( mavenRepository, layout.pathOf( artifact ) ) );
}
else
{
logger.warning( "NPANDAY-190-003: Could not find file: " + artifact.getFile().getAbsolutePath() );
return;
}
}
if ( applicationConfig != null )
{
File destPath = applicationConfig.getConfigBuildPath();
if ( destPath.exists() )
{
FileUtils.copyFile( destPath, applicationConfig.getRepositoryPath( mavenRepository ) );
}
}
if ( !artifact.getType().equals( "exe.config" ) )//This is attached
{
ArtifactHandler pomhandler = new DefaultArtifactHandler( "pom" );
artifact.setArtifactHandler( pomhandler );
File pomFile = new File( mavenRepository, pathOfPom( artifact ) );
FileWriter fileWriter = new FileWriter( pomFile );
new MavenXpp3Writer().write( fileWriter, model );