Examples of ArtifactFactory


Examples of org.apache.maven.artifact.factory.ArtifactFactory

        ModelDefaultsInjector injector = (ModelDefaultsInjector) lookup( ModelDefaultsInjector.ROLE );

        injector.injectDefaults( model );

        ArtifactFactory factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );

        project.setArtifacts( project.createArtifacts( factory, null, null ) );

        String key = ArtifactUtils.versionlessKey( groupId, artifactId );
View Full Code Here

Examples of org.apache.maven.artifact.factory.ArtifactFactory

    }

    private Artifact createArtifact( String groupId, String artifactId, String version, String type )
        throws Exception
    {
        ArtifactFactory artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
        return artifactFactory.createBuildArtifact( groupId, artifactId, version, type );
    }
View Full Code Here

Examples of org.apache.maven.artifact.factory.ArtifactFactory

    }

    protected Artifact createArtifact( String groupId, String artifactId, String version )
        throws Exception
    {
        ArtifactFactory artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );

        // TODO: used to be SCOPE_COMPILE, check
        return artifactFactory.createBuildArtifact( groupId, artifactId, version, "jar" );
    }
View Full Code Here

Examples of org.apache.maven.artifact.factory.ArtifactFactory

    }

    protected Artifact createArtifact( String groupId, String artifactId, String version, String type )
        throws Exception
    {
        ArtifactFactory artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );

        return artifactFactory.createBuildArtifact( groupId, artifactId, version, type );
    }
View Full Code Here

Examples of org.apache.maven.artifact.factory.ArtifactFactory

            throw new BuildException( "Unable to get extension '"
                                      + ArtifactUtils.versionlessKey( groupId, artifactId ) + "' because version '"
                                      + version + " is invalid: " + e.getMessage(), e );
        }

        ArtifactFactory factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
        Artifact providerArtifact = factory.createExtensionArtifact( groupId, artifactId, versionRange );

        log( "Installing provider: " + providerArtifact );

        ArtifactResolutionResult result;
        try
View Full Code Here

Examples of org.apache.maven.artifact.factory.ArtifactFactory

        ArtifactRepository localRepo = createLocalArtifactRepository();
        log( "Using local repository: " + localRepo.getBasedir(), Project.MSG_VERBOSE );

        // Look up required resources from the plexus container
        ArtifactResolver resolver = (ArtifactResolver) lookup( ArtifactResolver.ROLE );
        ArtifactFactory artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
        MavenMetadataSource metadataSource = (MavenMetadataSource) lookup( ArtifactMetadataSource.ROLE );

        Pom pom = initializePom( localRepo );
        if ( pom != null )
        {
            dependencies = pom.getDependencies();
        }
        else
        {
            // we have to have some sort of Pom object in order to satisfy the requirements for building the
            // originating Artifact below...
            pom = createDummyPom( localRepo );
        }

        if ( dependencies.isEmpty() )
        {
            log( "There were no dependencies specified", Project.MSG_WARN );
        }
        else
        {
            // check scopes
            for ( Dependency dependency : dependencies )
            {
                String scope = dependency.getScope();

                if ( Artifact.SCOPE_SYSTEM.equals( scope ) )
                {
                    if ( StringUtils.isBlank( dependency.getSystemPath() ) )
                    {
                        throw new BuildException( dependency.toString()
                            + " is defined with scope='system': systemPath attribute is required." );
                    }
                }
                else if ( ( scope != null ) && !SCOPES_SET.contains( scope ) )
                {
                    // see MANTTASKS-190
                    log( "Unknown scope='" + scope + "' for " + dependency + ", supported scopes are: " + SCOPES_SET,
                         Project.MSG_WARN );
                }
            }
        }

        log( "Resolving dependencies...", Project.MSG_VERBOSE );

        ArtifactResolutionResult result;

        List<ArtifactRepository> remoteArtifactRepositories = createRemoteArtifactRepositories( pom.getRepositories() );

        try
        {
            Set<Artifact> artifacts = MavenMetadataSource.createArtifacts( artifactFactory, dependencies, null, null, null );

            Artifact pomArtifact = artifactFactory.createBuildArtifact( pom.getGroupId(), pom.getArtifactId(),
                pom.getVersion(), pom.getPackaging() );

            List<AntResolutionListener> listeners = Collections.singletonList( new AntResolutionListener( getProject() ) );

            Map<String,Artifact> managedDependencies = pom.getMavenProject().getManagedVersionMap();
View Full Code Here

Examples of org.apache.maven.artifact.factory.ArtifactFactory

    }

    protected Artifact createDummyArtifact()
    {
        ArtifactFactory factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
        // TODO: maybe not strictly correct, while we should enforce that packaging has a type handler of the same id, we don't
        return factory.createBuildArtifact( "unspecified", "unspecified", "0.0", "jar" );
    }
View Full Code Here

Examples of org.apache.maven.artifact.factory.ArtifactFactory

        ProjectSorter sorter = new ProjectSorter( reactorProjects );

        reactorProjects = sorter.getSortedProjects();

        ArtifactFactory artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
        ArtifactCollector artifactCollector = (ArtifactCollector) lookup( ArtifactCollector.class.getName() );
        ArtifactMetadataSource artifactMetadataSource = (ArtifactMetadataSource) lookup( ArtifactMetadataSource.ROLE );

        // pass back over and resolve dependencies - can't be done earlier as the order may not be correct
        for ( Iterator i = reactorProjects.iterator(); i.hasNext(); )
View Full Code Here

Examples of org.apache.maven.artifact.factory.ArtifactFactory

                    }
                }
            }
        }
       
        ArtifactFactory artifactFactory = (ArtifactFactory) container.lookup( ArtifactFactory.ROLE );
        Artifact artifact =
            artifactFactory.createArtifact( groupId, artifactId, version, Artifact.SCOPE_RUNTIME, "jar" );
        Artifact dummyArtifact = artifactFactory.createProjectArtifact( "dummy", "dummy", "1.0" );

        if ( artifact.isSnapshot() )
        {
            remoteRepositories.add( factory.createArtifactRepository( "apache.snapshots",
                                                                      "http://people.apache.org/repo/m2-snapshot-repository",
View Full Code Here

Examples of org.camunda.bpm.engine.ArtifactFactory

*/
public class DefaultArtifactFactoryTest {

  @Test
  public void testDefaultArtifactService() throws Exception {
    ArtifactFactory artifactFactory = new DefaultArtifactFactory();

    DummyArtifact artifact = artifactFactory.getArtifact(DummyArtifact.class);
    Assert.assertNotNull(artifact);
  }
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.