Package npanday.registry

Examples of npanday.registry.RepositoryRegistry


        if ( !logs.exists() )
        {
            logs.mkdir();
        }

        RepositoryRegistry repositoryRegistry;
        try
        {
            repositoryRegistry = npandayRegistry.createRepositoryRegistry();
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException(
                "NPANDAY-1600-000: Failed to create the repository registry for this plugin", e );
        }
        catch( NPandayRepositoryException e )
        {
            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>();
View Full Code Here


            localRepository = new File( System.getProperty( "user.home" ), ".m2/repository" );
        }

        String profile = System.getProperty( "dependencyProfile" );

        RepositoryRegistry repositoryRegistry;
        try
        {
            repositoryRegistry = npandayRegistry.createRepositoryRegistry();
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException(
                "NPANDAY-1600-000: Failed to create the repository registry for this plugin", e );
        }
        catch( NPandayRepositoryException e )
        {
            throw new MojoExecutionException(
                "NPANDAY-1600-007: Failed to create the repository registry for this plugin", e );
        }

        if ( netDependencies == null )
        {
            netDependencies = new NetDependency[0];
        }
        List<Dependency> dependencies = new ArrayList<Dependency>();
        for ( NetDependency netDependency : netDependencies )
        {
            Dependency dependency = new Dependency();
            dependency.setGroupId( netDependency.getGroupId() );
            dependency.setArtifactId( netDependency.getArtifactId() );
            dependency.setVersion( netDependency.getVersion() );
            dependency.setScope( Artifact.SCOPE_RUNTIME );
            dependency.setType( netDependency.getType() );
            dependencies.add( dependency );
        }

        artifactContext.init( project, project.getRemoteArtifactRepositories(), localRepository );
        if ( !new File( localRepository, "npanday.artifacts.resolved" ).exists() ) //performance optimization
        {
            try
            {
                artifactContext.getArtifactInstaller().resolveAndInstallNetDependenciesForProfile( profile,
                                                                                                   dependencies, null );
            }
            catch ( NPandayArtifactResolutionException e )
            {
               throw new MojoExecutionException( e.getMessage(), e );
            }
            catch ( IOException e )
            {
               throw new MojoExecutionException( e.getMessage(), e );
            }

            new File( localRepository, "npanday.artifacts.resolved" ).mkdir();
        }

        //Do GAC Install, if needed
        //TODO: Add in the dependencies from the MOJO config
        if ( isGacInstall )
        {
            NetDependenciesRepository repository =
                (NetDependenciesRepository) repositoryRegistry.find( "net-dependencies" );
            getLog().info( "NPANDAY-1600-001: Found net dependencies: Number = " + dependencies.size() );

            List<NetDependencyMatchPolicy> gacInstallPolicies = new ArrayList<NetDependencyMatchPolicy>();
            gacInstallPolicies.add( new GacMatchPolicy( true ) );
            List<Dependency> gacInstallDependencies = repository.getDependenciesFor( gacInstallPolicies );
View Full Code Here

    public void postExecute()
        throws MojoExecutionException, MojoFailureException
    {
        try
        {
            RepositoryRegistry repositoryRegistry = (RepositoryRegistry) container.lookup( RepositoryRegistry.ROLE );
            SettingsRepository settingsRepository = (SettingsRepository) repositoryRegistry.find( "npanday-settings" );
            if ( settingsRepository != null )
            {
                settingsRepository.reload();
            }
        }
View Full Code Here

TOP

Related Classes of npanday.registry.RepositoryRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.