{
FileUtils.copyFileToDirectory( configExeFile, PathUtil.getUserAssemblyCacheFileFor( artifact,localRepository ).getParentFile() );
}
catch ( IOException e )
{
throw new ArtifactInstallationException( "NPANDAY-001-006: Failed to install artifact: ID = " +
artifact.getId() + ", File = " +
( ( artifact.getFile() != null ) ? artifact.getFile().getAbsolutePath() : "" ), e );
}
}
if ( !artifact.getType().equals( "exe.config" ) )//TODO: Generalize for any attached artifact
{
MavenXpp3Reader reader = new MavenXpp3Reader();
Model model;
try
{
logger.debug( "NPANDAY-001-033: config file:" + artifact.getType());
model = reader.read( new FileReader( pomFile ) );
if ( configExeFile.exists() )
{
Dependency dependency = new Dependency();
dependency.setGroupId( artifact.getGroupId() );
dependency.setArtifactId( artifact.getArtifactId() );
dependency.setVersion( artifact.getVersion() );
dependency.setType( ArtifactType.DOTNET_EXECUTABLE_CONFIG.getPackagingType() );
model.addDependency( dependency );
}
}
catch ( XmlPullParserException e )
{
throw new ArtifactInstallationException( "NPANDAY-001-012: Unable to read pom file: " + pomFile.getAbsolutePath(), e);
}
catch ( IOException e )
{
throw new ArtifactInstallationException( "NPANDAY-001-013: Unable to read pom file: " + pomFile.getAbsolutePath(), e );
}
}
}