Package org.apache.maven.artifact.resolver.filter

Examples of org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter.include()


        Iterator<Artifact> iter = mojo.project.getArtifacts().iterator();
        while ( iter.hasNext() )
        {
            Artifact artifact = iter.next();
            assertUnpacked( saf.include( artifact ), artifact );
        }
    }

    public void testIncludeprovidedScope()
        throws Exception
View Full Code Here


        {
            Artifact artifact = iter.next();
            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
            File file = new File( mojo.outputDirectory, fileName );

            assertEquals( !saf.include( artifact ), file.exists() );
        }
    }

    public void testExcludeTestScope()
        throws IOException
View Full Code Here

        {
            Artifact artifact = iter.next();
            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
            File file = new File( mojo.outputDirectory, fileName );

            assertEquals( !saf.include( artifact ), file.exists() );
        }
    }

    public void testCopyPom()
        throws Exception
View Full Code Here

        for ( Artifact artifact : artifacts )
        {

            // Artifact is not yet registered and it has neither test, nor a
            // provided scope, not is it optional
            if ( "war".equals( artifact.getType() ) && !artifact.isOptional() && filter.include( artifact ) )
            {
                getLog().info( "Deploy warfile: " + String.valueOf( artifact.getFile() ) );
                File webapps = new File( configurationDir, "webapps" );
                File artifactWarDir = new File( webapps, artifact.getArtifactId() );
                if ( !artifactWarDir.exists() )
View Full Code Here

        for ( Artifact artifact : artifacts )
        {

            // Artifact is not yet registered and it has neither test, nor a
            // provided scope, not is it optional
            if ( "war".equals( artifact.getType() ) && !artifact.isOptional() && filter.include( artifact ) )
            {
                getLog().info( "Deploy warfile: " + String.valueOf( artifact.getFile() ) );
                File webapps = new File( configurationDir, "webapps" );
                File artifactWarDir = new File( webapps, artifact.getArtifactId() );
                if ( !artifactWarDir.exists() )
View Full Code Here

                targetFileName = artifact.getGroupId() + "-" + targetFileName;
                context.getLog().debug( "Renamed to: " + targetFileName );
            }
            context.getWebappStructure().registerTargetFileName( artifact, targetFileName );

            if ( !artifact.isOptional() && filter.include( artifact ) )
            {
                try
                {
                    String type = artifact.getType();
                    if ( "tld".equals( type ) )
View Full Code Here

            @SuppressWarnings("unchecked")
            Set<Artifact> artifacts = project.getArtifacts();
            for (Artifact artifact : artifacts) {

                ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME);
                if (!artifact.isOptional() && filter.include(artifact)
                        && artifact.getArtifactHandler().isAddedToClasspath()) {
                    getLog().info("Copying artifact[" + artifact.getGroupId() + ", " + artifact.getId() + ", "
                            + artifact.getScope() + "]");
                    FileUtils.copyFileToDirectory(artifact.getFile(), getBuildDir());
                }
View Full Code Here

                    }

                    // TODO: utilise appropriate methods from project builder
                    ScopeArtifactFilter filter = new ScopeArtifactFilter(
                            Artifact.SCOPE_RUNTIME);
                    if (!artifact.isOptional() && filter.include(artifact)) {
                        String type = artifact.getType();
                        if ("jar".equals(type)) {
                            copyFileIfModified(artifact.getFile(), new File(
                                    libDir, targetFileName));
                        }
View Full Code Here

                    getLog().debug( "Renamed to: " + targetFileName );
                  }
   
                  // TODO: utilise appropriate methods from project builder
                  ScopeArtifactFilter filter = new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME );
                  if ( !artifact.isOptional() && filter.include( artifact ) )
                  {
                    String type = artifact.getType();
                    if ( "jar".equals( type ) )
                    {
                      copyFileIfModified( artifact.getFile(), new File( libDir, targetFileName ) );
View Full Code Here

                artifacts = project.getDependencyArtifacts();
            }
            for (Artifact artifact : artifacts) {

                ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME);
                if (!artifact.isOptional() && filter.include(artifact)) {
                    getLog().info("Copying artifact[" + artifact.getGroupId() + ", " + artifact.getId() + ", " +
                            artifact.getScope() + "]");
                    zipArchiver.addFile(artifact.getFile(), artifact.getArtifactId() + "-" + artifact.getVersion() + "." + (artifact.getType() == null ? "jar" : artifact.getType()));
                }
            }
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.