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

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


        final Set<Artifact> artifacts = project.getArtifacts();

        final List<Artifact> result = new ArrayList<Artifact>();
        for ( Artifact artifact : artifacts )
        {
            if ( !artifact.isOptional() && filter.include( artifact ) && ( "war".equals( artifact.getType() ) ) )
            {
                result.add( artifact );
            }
        }
        return result;
View Full Code Here


                // Artifact is not yet registered and it has neither test, nor a
                // provided scope, not is it optional
                ScopeArtifactFilter filter = new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME );
                if ( !isArtifactRegistered( artifact, allModules ) && !artifact.isOptional()
                    && filter.include( artifact ) )
                {
                    EarModule module = EarModuleFactory.newEarModule( artifact, javaEEVersion, defaultLibBundleDir,
                                                                      includeLibInApplicationXml, typeMappingService );
                    module.setEarExecutionContext( earExecutionContext );
                    allModules.add( module );
View Full Code Here

        mojo.excludeScope = "compile";
        mojo.execute();
        ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.excludeScope );

        for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
            assertUnpacked(!saf.include(artifact), artifact);
        }
    }

    public void testExcludeTestScope()
        throws IOException, MojoFailureException
View Full Code Here

        mojo.excludeScope = "runtime";
        mojo.execute();
        ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.excludeScope );

        for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
            assertUnpacked(!saf.include(artifact), artifact);
        }
    }

    public void testIncludeType()
        throws Exception
View Full Code Here

        mojo.includeScope = "compile";
        mojo.execute();
        ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope );

        for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
            assertUnpacked(saf.include(artifact), artifact);
        }
    }

    public void testIncludeTestScope()
        throws Exception
View Full Code Here

        mojo.execute();
        ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope );

        for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
            assertUnpacked(saf.include(artifact), artifact);
        }
    }

    public void testIncludeRuntimeScope()
        throws Exception
View Full Code Here

        mojo.includeScope = "runtime";
        mojo.execute();
        ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope );

        for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
            assertUnpacked(saf.include(artifact), artifact);
        }
    }

    public void testIncludeprovidedScope()
        throws Exception
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

        final Set<Artifact> artifacts = project.getArtifacts();

        final List<Artifact> result = new ArrayList<Artifact>();
        for ( Artifact artifact : artifacts )
        {
            if ( !artifact.isOptional() && filter.include( artifact ) && ( "war".equals( artifact.getType() ) ) )
            {
                result.add( artifact );
            }
        }
        return result;
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

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.