Package org.apache.maven.artifact.resolver

Examples of org.apache.maven.artifact.resolver.ArtifactResolver.resolve()


        throws Exception
    {
        ArtifactResolver artifactResolver = (ArtifactResolver) lookup( ArtifactResolver.class.getName() );
        try
        {
            artifactResolver.resolve( archetypeArtifact, remoteRepositories, localRepository );
        }
        catch ( ArtifactResolutionException e )
        {
            throw new ArchetypeDescriptorException( "Error attempting to download archetype: " + e.getMessage(), e );
        }
View Full Code Here


        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

                          NATIVE_ARTIFACTID, version, "", NATIVE_TYPE);
    ArtifactResolver resolver = request.getArtifactResolver();

    try
    {
      resolver.resolve(artifact, request.getRemoteRepositories(),
        request.getLocalRepository());

      File nativeArchive = artifact.getFile();
      UnArchiver unArchiver =
        request.getArchiverManager().getUnArchiver(nativeArchive);
View Full Code Here

                                                                      artifact.getVersion(), "java-source", "sources" );
                    if ( sourcesArtifact != null )
                    {
                        try
                        {
                            resolver.resolve( sourcesArtifact, remoteArtifactRepositories, localRepo );
                            String sourcesFilename = localRepo.pathOf( sourcesArtifact );

                            FileList.FileName sourcesFile = new FileList.FileName();
                            sourcesFile.setName( sourcesFilename );
View Full Code Here

        Artifact artifact = factory.createArtifact( JSW_GROUPID, JSW_ARTIFACTID, version, "",  JSW_TYPE);

        ArtifactResolver resolver = request.getArtifactResolver();
        try
        {
            resolver.resolve( artifact, request.getRemoteRepositories(), request.getLocalRepository() );

            File wrapperArchive = artifact.getFile();
            UnArchiver unArchiver = request.getArchiverManager().getUnArchiver( wrapperArchive );
            unArchiver.setSourceFile( wrapperArchive );
            unArchiver.setDestDirectory( outputDirectory );
View Full Code Here

        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

        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
Copyright © 2018 www.massapi.com. 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.