Examples of DefaultFileMarkerHandler


Examples of org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler

    }

    protected ArtifactsFilter getMarkedArtifactFilter()
    {
        return new MarkerFileFilter( this.overWriteReleases, this.overWriteSnapshots, this.overWriteIfNewer,
                                     new DefaultFileMarkerHandler( this.markersDirectory ) );
    }
View Full Code Here

Examples of org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler

    }

    public void assertNoMarkerFile( Artifact artifact )
    {
        DefaultFileMarkerHandler handle = new DefaultFileMarkerHandler( artifact, mojo.markersDirectory );
        try
        {
            assertFalse( handle.isMarkerSet() );
        }
        catch ( MojoExecutionException e )
        {
            fail( e.getLongMessage() );
        }
View Full Code Here

Examples of org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler

            File destDir;
            destDir = DependencyUtil.getFormattedOutputDirectory( useSubDirectoryPerScope, useSubDirectoryPerType,
                                                                  useSubDirectoryPerArtifact, useRepositoryLayout,
                                                                  stripVersion, outputDirectory, artifact );
            unpack( artifact, destDir, getIncludes(), getExcludes() );
            DefaultFileMarkerHandler handler = new DefaultFileMarkerHandler( artifact, this.markersDirectory );
            handler.setMarker();
        }

        for ( Artifact artifact : dss.getSkippedDependencies() )
        {
            getLog().info( artifact.getFile().getName() + " already exists in destination." );
View Full Code Here

Examples of org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler

    }

    protected ArtifactsFilter getMarkedArtifactFilter()
    {
        return new MarkerFileFilter( this.overWriteReleases, this.overWriteSnapshots, this.overWriteIfNewer,
                                     new DefaultFileMarkerHandler( this.markersDirectory ) );
    }
View Full Code Here

Examples of org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler

    }

    public void testMarkerFile() throws ArtifactFilterException
      
    {
        MarkerFileFilter filter = new MarkerFileFilter( true, true, false, new DefaultFileMarkerHandler( outputFolder ) );
        Set<Artifact> result = filter.filter( artifacts );
        assertEquals( 2, result.size() );

        filter.setOverWriteReleases( false );
        filter.setOverWriteSnapshots( false );
View Full Code Here

Examples of org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler

    }

    public void testMarkerSnapshots() throws ArtifactFilterException, MojoExecutionException, IOException
      
    {
        DefaultFileMarkerHandler handler = new DefaultFileMarkerHandler( fact.getSnapshotArtifact(), outputFolder );
        handler.setMarker();

        MarkerFileFilter filter = new MarkerFileFilter( true, false, false, new DefaultFileMarkerHandler( outputFolder ) );
        Set<Artifact> result = filter.filter( artifacts );
        assertEquals( 1, result.size() );

        filter.setOverWriteSnapshots( true );
        result = filter.filter( artifacts );
        assertEquals( 2, result.size() );
        assertTrue( handler.clearMarker() );
        DependencyTestUtils.removeDirectory( outputFolder );
        assertFalse( outputFolder.exists() );
    }
View Full Code Here

Examples of org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler

    }

    public void testMarkerRelease()
        throws IOException, ArtifactFilterException, MojoExecutionException
    {
        DefaultFileMarkerHandler handler = new DefaultFileMarkerHandler( fact.getReleaseArtifact(), outputFolder );
        handler.setMarker();

        MarkerFileFilter filter = new MarkerFileFilter( false, false, false,
                                                        new DefaultFileMarkerHandler( outputFolder ) );
        Set<Artifact> result = filter.filter( artifacts );
        assertEquals( 1, result.size() );

        filter.setOverWriteReleases( true );
        result = filter.filter( artifacts);
        assertEquals( 2, result.size() );

        assertTrue( handler.clearMarker() );
        DependencyTestUtils.removeDirectory( outputFolder );
        assertFalse( outputFolder.exists() );
    }
View Full Code Here

Examples of org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler

        Artifact snap = fileFact.getSnapshotArtifact();
        Artifact release = fileFact.getReleaseArtifact();
        Set<Artifact> tempArtifacts = new HashSet<Artifact>();
        tempArtifacts.add( snap );
        tempArtifacts.add( release );
        DefaultFileMarkerHandler handler = new DefaultFileMarkerHandler( snap, outputFolder );
        handler.setMarker();
        snap.getFile().setLastModified( snap.getFile().lastModified() + 1500 );
        MarkerFileFilter filter = new MarkerFileFilter( false, false, true, new DefaultFileMarkerHandler( outputFolder ) );
        Set<Artifact> result = filter.filter( tempArtifacts );
        assertEquals( 2, result.size() );

        // update marker; filter won't include snapshot because timestamps equal
        handler.setMarker();
        result = filter.filter( tempArtifacts );
        assertEquals( 1, result.size() );
       
        // filter won't include snapshot because it is older than marker
        snap.getFile().setLastModified( snap.getFile().lastModified() - 10000 );

        result = filter.filter( tempArtifacts );
        assertEquals( 1, result.size() );

        assertTrue( handler.clearMarker() );
        assertFalse( handler.isMarkerSet() );
        snap.getFile().delete();
        release.getFile().delete();
        DependencyTestUtils.removeDirectory( outputFolder );
        assertFalse( outputFolder.exists() );
    }
View Full Code Here

Examples of org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler

        assertFalse( outputFolder.exists() );
    }

    public void testGettersSetters()
    {
        MarkerFileFilter filter = new MarkerFileFilter( true, false, true, new DefaultFileMarkerHandler( outputFolder ) );
        assertEquals( true, filter.isOverWriteReleases() );
        assertEquals( false, filter.isOverWriteSnapshots() );
        assertEquals( true, filter.isOverWriteIfNewer() );

        filter.setOverWriteReleases( false );
View Full Code Here

Examples of org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler

    }

    public void assertNoMarkerFile( Artifact artifact )
    {
        DefaultFileMarkerHandler handle = new DefaultFileMarkerHandler( artifact, mojo.markersDirectory );
        try
        {
            assertFalse( handle.isMarkerSet() );
        }
        catch ( MojoExecutionException e )
        {
            fail( e.getLongMessage() );
        }
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.