Package org.apache.maven.artifact.resolver

Examples of org.apache.maven.artifact.resolver.DefaultArtifactResolver


                getLogger().warn( "Invalid number of threads '" + numThreads + "' will be ignored: " + e.getMessage() );
            }
           
            if ( threads > 0 )
            {
                DefaultArtifactResolver artifactResolver = (DefaultArtifactResolver) container.lookup( ArtifactResolver.ROLE );
                try
                {
                    artifactResolver.configureNumberOfThreads( threads );
                    getLogger().debug( "Resolution thread pool size set to: " + threads );
                }
                finally
                {
                    container.release( artifactResolver );
View Full Code Here


                getLogger().warn( "Invalid number of threads '" + numThreads + "' will be ignored: " + e.getMessage() );
            }
           
            if ( threads > 0 )
            {
                DefaultArtifactResolver artifactResolver = (DefaultArtifactResolver) container.lookup( ArtifactResolver.ROLE );
                try
                {
                    artifactResolver.configureNumberOfThreads( threads );
                    getLogger().debug( "Resolution thread pool size set to: " + threads );
                }
                finally
                {
                    container.release( artifactResolver );
View Full Code Here

        Field artifactFactoryField = ShadeMojo.class.getDeclaredField( "artifactFactory" );
        artifactFactoryField.setAccessible( true );
        artifactFactoryField.set( mojo, artifactFactory );

        // configure artifactResolver (mocked) for mojo
        ArtifactResolver mockArtifactResolver = new DefaultArtifactResolver()
        {

            public void resolve( Artifact artifact, List remoteRepos, ArtifactRepository repo )
                throws ArtifactResolutionException, ArtifactNotFoundException
            {
                // artifact is resolved
                artifact.setResolved( true );

                // set file
                artifact.setFile( new File(
                    artifact.getArtifactId() + "-" + artifact.getVersion() + ( artifact.getClassifier() != null ? "-"
                        + artifact.getClassifier() : "" ) + ".jar" ) );
            }

        };
        Field artifactResolverField = ShadeMojo.class.getDeclaredField( "artifactResolver" );
        artifactResolverField.setAccessible( true );
        artifactResolverField.set( mojo, mockArtifactResolver );

        // create and configure MavenProject
        MavenProject project = new MavenProject();
        ArtifactHandler artifactHandler = (ArtifactHandler) lookup( ArtifactHandler.ROLE );
        Artifact artifact = new DefaultArtifact( "org.apache.myfaces.core", "myfaces-impl",
                                                 VersionRange.createFromVersion( "2.0.1-SNAPSHOT" ), "compile", "jar",
                                                 null, artifactHandler );
        mockArtifactResolver.resolve( artifact, null, null ); // setFile and setResolved
        project.setArtifact( artifact );
        Field projectField = ShadeMojo.class.getDeclaredField( "project" );
        projectField.setAccessible( true );
        projectField.set( mojo, project );
View Full Code Here

        Field artifactFactoryField = ShadeMojo.class.getDeclaredField( "artifactFactory" );
        artifactFactoryField.setAccessible( true );
        artifactFactoryField.set( mojo, artifactFactory );

        // configure artifactResolver (mocked) for mojo
        ArtifactResolver mockArtifactResolver = new DefaultArtifactResolver()
        {

            public void resolve( Artifact artifact, List<ArtifactRepository> remoteRepos, ArtifactRepository repo )
                throws ArtifactResolutionException, ArtifactNotFoundException
            {
                // artifact is resolved
                artifact.setResolved( true );

                // set file
                artifact.setFile( new File(
                    artifact.getArtifactId() + "-" + artifact.getVersion() + ( artifact.getClassifier() != null ? "-"
                        + artifact.getClassifier() : "" ) + ".jar" ) );
            }

        };
        Field artifactResolverField = ShadeMojo.class.getDeclaredField( "artifactResolver" );
        artifactResolverField.setAccessible( true );
        artifactResolverField.set( mojo, mockArtifactResolver );

        // create and configure MavenProject
        MavenProject project = new MavenProject();
        ArtifactHandler artifactHandler = (ArtifactHandler) lookup( ArtifactHandler.ROLE );
        Artifact artifact = new DefaultArtifact( "org.apache.myfaces.core", "myfaces-impl",
                                                 VersionRange.createFromVersion( "2.0.1-SNAPSHOT" ), "compile", "jar",
                                                 null, artifactHandler );
        mockArtifactResolver.resolve( artifact, null, null ); // setFile and setResolved
        project.setArtifact( artifact );
        Field projectField = ShadeMojo.class.getDeclaredField( "project" );
        projectField.setAccessible( true );
        projectField.set( mojo, project );
View Full Code Here

        Field artifactFactoryField = ShadeMojo.class.getDeclaredField( "artifactFactory" );
        artifactFactoryField.setAccessible( true );
        artifactFactoryField.set( mojo, artifactFactory );

        // configure artifactResolver (mocked) for mojo
        ArtifactResolver mockArtifactResolver = new DefaultArtifactResolver()
        {

            public void resolve( Artifact artifact, List<ArtifactRepository> remoteRepos, ArtifactRepository repo )
                throws ArtifactResolutionException, ArtifactNotFoundException
            {
                // artifact is resolved
                artifact.setResolved( true );

                // set file
                artifact.setFile( new File(
                    artifact.getArtifactId() + "-" + artifact.getVersion() + ( artifact.getClassifier() != null ? "-"
                        + artifact.getClassifier() : "" ) + ".jar" ) );
            }

        };
        Field artifactResolverField = ShadeMojo.class.getDeclaredField( "artifactResolver" );
        artifactResolverField.setAccessible( true );
        artifactResolverField.set( mojo, mockArtifactResolver );

        // create and configure MavenProject
        MavenProject project = new MavenProject();
        ArtifactHandler artifactHandler = (ArtifactHandler) lookup( ArtifactHandler.ROLE );
        Artifact artifact = new DefaultArtifact( "org.apache.myfaces.core", "myfaces-impl",
                                                 VersionRange.createFromVersion( "2.0.1-SNAPSHOT" ), "compile", "jar",
                                                 null, artifactHandler );
        mockArtifactResolver.resolve( artifact, null, null ); // setFile and setResolved
        project.setArtifact( artifact );
        Field projectField = ShadeMojo.class.getDeclaredField( "project" );
        projectField.setAccessible( true );
        projectField.set( mojo, project );
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.resolver.DefaultArtifactResolver

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.