{
throw new MojoExecutionException(
"NPANDAY-1600-007: Failed to create the repository registry for this plugin", e );
}
NetDependenciesRepository netRepository = (NetDependenciesRepository) repositoryRegistry.find(
"net-dependencies" );
artifactContext.init( null, mavenProject.getRemoteArtifactRepositories(), new File( localRepository ) );
Map<String, ArtifactHandler> map = new HashMap<String, ArtifactHandler>();
for ( ArtifactHandler artifactHandler : artifactHandlers )
{
//If I add a handler that already exists, the runtime breaks.
if ( isDotNetHandler( artifactHandler ) )
{
map.put( artifactHandler.getPackaging(), artifactHandler );
}
}
artifactHandlerManager.addHandlers( map );
try
{
artifactContext.getArtifactInstaller().resolveAndInstallNetDependenciesForProfile( "VisualStudio2005", null,
null );
}
catch ( NPandayArtifactResolutionException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
catch( IOException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
// GAC Installs
List<NetDependencyMatchPolicy> gacInstallPolicies = new ArrayList<NetDependencyMatchPolicy>();
gacInstallPolicies.add( new GacMatchPolicy( true ) );
List<Dependency> gacInstallDependencies = netRepository.getDependenciesFor( gacInstallPolicies );
for ( Dependency dependency : gacInstallDependencies )
{
List<Artifact> artifacts = artifactContext.getArtifactsFor( dependency.getGroupId(),
dependency.getArtifactId(),
dependency.getVersion(), dependency.getType() );