Examples of ArtifactItem


Examples of org.apache.maven.plugin.dependency.fromConfiguration.ArtifactItem

        Set<Artifact> artifacts_ = artifacts;
        Set<Artifact> result = new HashSet<Artifact>();
       
        for( Artifact artifact : artifacts_ )
        {
            if ( isArtifactIncluded( new ArtifactItem( artifact ) ) )
            {
                result.add( artifact );
            }
        }
        return result;
View Full Code Here

Examples of org.apache.maven.plugin.dependency.fromConfiguration.ArtifactItem

        //stubFactory.setUnpackableFile( mojo.getArchiverManager() );
        // i'm using one file repeatedly to archive so I can test the name
        // programmatically.
        stubFactory.setSrcFile( new File( getBasedir() + File.separatorChar + PACKED_FILE_PATH ) );
        Artifact artifact = stubFactory.createArtifact( "test", "test", "1.0", Artifact.SCOPE_COMPILE, "jar", null );
        ArtifactItem item = stubFactory.getArtifactItem( artifact );
        List<ArtifactItem> list = new ArrayList<ArtifactItem>( 1 );
        list.add( item );
        assertNotNull( mojo );
        assertNotNull( mojo.getProject() );
View Full Code Here

Examples of org.apache.maven.plugin.dependency.fromConfiguration.ArtifactItem

    public void testIncludeArtifactItemOverride()
      throws Exception
    {
        Artifact artifact = stubFactory.createArtifact( "test", "test", "1.0", Artifact.SCOPE_COMPILE, "jar", null );
        ArtifactItem item = stubFactory.getArtifactItem( artifact );
        item.setIncludes( "**/*" );
        List<ArtifactItem> list = new ArrayList<ArtifactItem>( 1 );
        list.add( item );
        mojo.setArtifactItems( list );
        mojo.setIncludes( "**/test2" + UNPACKED_FILE_SUFFIX );
        mojo.execute();
View Full Code Here

Examples of org.apache.maven.plugin.dependency.fromConfiguration.ArtifactItem

    public void testExcludeArtifactItemOverride()
  throws Exception
  {
        Artifact artifact = stubFactory.createArtifact( "test", "test", "1.0", Artifact.SCOPE_COMPILE, "jar", null );
        ArtifactItem item = stubFactory.getArtifactItem( artifact );
        item.setExcludes( "**/*" );
        List<ArtifactItem> list = new ArrayList<ArtifactItem>( 1 );
        list.add( item );
        mojo.setArtifactItems( list );
        mojo.setExcludes( "**/test2" + UNPACKED_FILE_SUFFIX );
        mojo.execute();
View Full Code Here

Examples of org.apache.maven.plugin.dependency.fromConfiguration.ArtifactItem

    public void testIncludeArtifactItemMultipleMarker()
      throws Exception
  {
        List<ArtifactItem> list = new ArrayList<ArtifactItem>();
        Artifact artifact = stubFactory.createArtifact( "test", "test", "1.0", Artifact.SCOPE_COMPILE, "jar", null );
        ArtifactItem item = stubFactory.getArtifactItem( artifact );
        item.setOverWrite( "false" );
        item.setIncludes( "**/test2" + UNPACKED_FILE_SUFFIX );
        list.add( item );
        item = stubFactory.getArtifactItem( artifact );
        item.setOverWrite( "false" );
        item.setIncludes( "**/test3" + UNPACKED_FILE_SUFFIX );
        list.add( item );
        mojo.setArtifactItems( list );
        mojo.execute();
        assertUnpacked( false, UNPACKED_FILE_PREFIX + 1 + UNPACKED_FILE_SUFFIX );
        assertUnpacked( false, UNPACKED_FILE_PREFIX + 11 + UNPACKED_FILE_SUFFIX );
View Full Code Here

Examples of org.apache.maven.plugin.dependency.fromConfiguration.ArtifactItem

    public void testIncludeArtifactItemMultipleExecutions()
      throws Exception
  {
        List<ArtifactItem> list = new ArrayList<ArtifactItem>();
        Artifact artifact = stubFactory.createArtifact( "test", "test", "1.0", Artifact.SCOPE_COMPILE, "jar", null );
        ArtifactItem item = stubFactory.getArtifactItem( artifact );
        item.setOverWrite( "false" );
        item.setIncludes( "**/test2" + UNPACKED_FILE_SUFFIX );
        list.add( item );
        item = stubFactory.getArtifactItem( artifact );
        item.setOverWrite( "false" );
        item.setIncludes( "**/test3" + UNPACKED_FILE_SUFFIX );
        list.add( item );
        mojo.setArtifactItems( list );
        mojo.execute();
        assertUnpacked( false, UNPACKED_FILE_PREFIX + 1 + UNPACKED_FILE_SUFFIX );
        assertUnpacked( false, UNPACKED_FILE_PREFIX + 11 + UNPACKED_FILE_SUFFIX );
View Full Code Here

Examples of org.apache.maven.plugin.dependency.fromConfiguration.ArtifactItem

        DependencyTestUtils.removeDirectory( testDir );
        assertFalse( testDir.exists() );

        stubFactory = new DependencyArtifactStubFactory( this.testDir, false );
        Artifact artifact = stubFactory.createArtifact( "test", "test", "1" );
        ArtifactItem artifactItem = stubFactory.getArtifactItem( artifact );
        artifactItems.add( stubFactory.getArtifactItem( stubFactory.createArtifact( "test", "test", "1" ) ) );
        artifact = stubFactory.createArtifact( "test2", "test2", "2" );
        artifactItem = new ArtifactItem( artifact );
        artifactItem.setIncludes( "**/*.xml" );
        artifactItems.add( artifactItem );
        artifact = stubFactory.createArtifact( "test3", "test3", "3" );
        artifactItem = new ArtifactItem( artifact );
        artifactItem.setExcludes( "**/*.class" );
        artifactItems.add( artifactItem );
        artifact = stubFactory.createArtifact( "test4", "test4", "4" );
        artifactItem = new ArtifactItem( artifact );
        artifactItem.setIncludes( "**/*.xml" );
        artifactItem.setExcludes( "**/*.class" );
        artifactItems.add( artifactItem );

        outputFolder = new File( "target/markers/" );
        DependencyTestUtils.removeDirectory( this.outputFolder );
        assertFalse( outputFolder.exists() );
View Full Code Here

Examples of org.apache.maven.plugin.dependency.fromConfiguration.ArtifactItem

        throws MojoExecutionException, IOException, InterruptedException
    {
        File theFile = new File( outputFolder, "theFile.jar" );
        outputFolder.mkdirs();
        theFile.createNewFile();
        ArtifactItem theArtifactItem = artifactItems.get( 0 );
        Artifact theArtifact = theArtifactItem.getArtifact();
        theArtifact.setFile( theFile );
        UnpackFileMarkerHandler handler = new UnpackFileMarkerHandler( theArtifactItem, this.outputFolder );
        assertFalse( handler.isMarkerSet() );
        // if the marker is not set, assume it is infinately older than the
        // artifact.
View Full Code Here

Examples of org.apache.maven.plugin.dependency.fromConfiguration.ArtifactItem

        Set<Artifact> artifacts_ = artifacts;
        Set<Artifact> result = new HashSet<Artifact>();
       
        for ( Artifact artifact : artifacts_ )
        {
            if ( isArtifactIncluded( new ArtifactItem( artifact ) ) )
            {
                result.add( artifact );
            }
        }
        return result;
View Full Code Here

Examples of org.apache.maven.plugin.dependency.fromConfiguration.ArtifactItem

        super( theWorkingDir, theCreateFiles );
    }

    public ArtifactItem getArtifactItem( Artifact artifact )
    {
        ArtifactItem item = new ArtifactItem( artifact );
        return item;
    }
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.