当前位置: 首页>>代码示例>>Java>>正文


Java ArtifactFilterException类代码示例

本文整理汇总了Java中org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException的典型用法代码示例。如果您正苦于以下问题:Java ArtifactFilterException类的具体用法?Java ArtifactFilterException怎么用?Java ArtifactFilterException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ArtifactFilterException类属于org.apache.maven.shared.artifact.filter.collection包,在下文中一共展示了ArtifactFilterException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: filterMarkedDependencies

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
/**
 * Filter the marked dependencies
 * 
 * @param artifacts
 * @return
 * @throws MojoExecutionException
 */
protected DependencyStatusSets filterMarkedDependencies( Set artifacts )
    throws MojoExecutionException
{
    // remove files that have markers already
    FilterArtifacts filter = new FilterArtifacts();
    filter.clearFilters();
    filter.addFilter( getMarkedArtifactFilter() );

    Set unMarkedArtifacts;
    try
    {
        unMarkedArtifacts = filter.filter( artifacts );
    }
    catch ( ArtifactFilterException e )
    {
        throw new MojoExecutionException(e.getMessage(),e);
    }

    // calculate the skipped artifacts
    Set skippedArtifacts = new HashSet();
    skippedArtifacts.addAll( artifacts );
    skippedArtifacts.removeAll( unMarkedArtifacts );

    return new DependencyStatusSets( unMarkedArtifacts, null, skippedArtifacts );
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:33,代码来源:AbstractDependencyFilterMojo.java

示例2: filter

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
public Set filter( Set artifacts )
    throws ArtifactFilterException
{
    Set result = new HashSet();

    Iterator iter = artifacts.iterator();
    
    while ( iter.hasNext() )
    {
        Artifact artifact = (Artifact) iter.next();
        if ( isArtifactIncluded( new ArtifactItem( artifact ) ) )
        {
            result.add( artifact );
        }
    }
    return result;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:18,代码来源:DestFileFilter.java

示例3: filter

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
public Set filter( Set artifacts )
    throws ArtifactFilterException
{
    Set result = new HashSet();

    Iterator iter = artifacts.iterator();
   
    while ( iter.hasNext() )
    {
        Artifact artifact = (Artifact) iter.next();
        if ( isArtifactIncluded( new ArtifactItem( artifact ) ) )
        {
            result.add( artifact );
        }
    }
    return result;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:18,代码来源:MarkerFileFilter.java

示例4: testMarkerSnapshots

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
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 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() );
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:18,代码来源:TestMarkerFileFilter.java

示例5: testMarkerRelease

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
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 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() );
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:20,代码来源:TestMarkerFileFilter.java

示例6: testDestFileOverwriteIfNewer

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
public void testDestFileOverwriteIfNewer()
    throws MojoExecutionException, IOException, ArtifactFilterException
{
    DestFileFilter filter = new DestFileFilter( outputFolder );

    fact.setCreateFiles( true );
    Artifact artifact = fact.getSnapshotArtifact();
    File artifactFile = artifact.getFile();
    artifactFile.setLastModified( artifactFile.lastModified() );
    filter.overWriteIfNewer = true;

    // should pass because the file doesn't exist yet.
    assertTrue( filter.isArtifactIncluded( artifact) );

    // create the file in the destination
    File destFile = createFile( artifact, false, false, false );

    // set the last modified timestamp to be older than the source
    destFile.setLastModified( artifactFile.lastModified() - 1000 );
    assertTrue( filter.isArtifactIncluded( artifact ) );

    // now set the last modified timestamp to be newer than the source
    destFile.setLastModified( artifactFile.lastModified() + 1000 );

    assertFalse( filter.isArtifactIncluded( artifact ) );
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:27,代码来源:TestDestFileFilter.java

示例7: filterDependencies

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
@Override
protected Set<Artifact> filterDependencies(Set<Artifact> dependencies,
                                           FilterArtifacts filters) throws MojoExecutionException {
    try {
        Set<Artifact> filtered = new LinkedHashSet<Artifact>(dependencies);

        @SuppressWarnings("unchecked")
        Collection<ArtifactsFilter> filtersToUse = filters.getFilters();
        filtersToUse.addAll(getAdditionalFilters());

        filtered.retainAll(filters.filter(dependencies));
        return filtered;
    }
    catch (ArtifactFilterException ex) {
        throw new MojoExecutionException(ex.getMessage(), ex);
    }
}
 
开发者ID:syndesisio,项目名称:syndesis,代码行数:18,代码来源:SupportMojo.java

示例8: getMarkedArtifactFilter

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected ArtifactsFilter getMarkedArtifactFilter() {
	return new ArtifactsFilter() {
		
		@Override
		public boolean isArtifactIncluded(Artifact artifact) throws ArtifactFilterException {
			return true;
		}
		
		@Override
		@SuppressWarnings("rawtypes")
		public Set filter(Set artifacts) throws ArtifactFilterException {
			return artifacts;
		}
	};
}
 
开发者ID:OnPositive,项目名称:aml,代码行数:18,代码来源:Java2RamlMojo.java

示例9: filterMarkedDependencies

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
protected DependencyStatusSets filterMarkedDependencies(Set artifacts) throws MojoExecutionException {
    // remove files that have markers already
    FilterArtifacts filter = new FilterArtifacts();
    filter.clearFilters();
    filter.addFilter(getMarkedArtifactFilter());

    Set unMarkedArtifacts;
    try {
        unMarkedArtifacts = filter.filter(artifacts);
    } catch (ArtifactFilterException e) {
        throw new MojoExecutionException(e.getMessage(), e);
    }

    // calculate the skipped artifacts
    Set skippedArtifacts = new HashSet();
    skippedArtifacts.addAll(artifacts);
    skippedArtifacts.removeAll(unMarkedArtifacts);

    return new DependencyStatusSets(unMarkedArtifacts, null, skippedArtifacts);
}
 
开发者ID:apache,项目名称:nifi-maven,代码行数:21,代码来源:NarMojo.java

示例10: resolvePluginArtifacts

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
/**
 * This method resolves the plugin artifacts from the project.
 *
 * @return set of resolved plugin artifacts.
 * @throws ArtifactResolutionException
 * @throws ArtifactNotFoundException
 * @throws ArtifactFilterException 
 */
@SuppressWarnings( "unchecked" )
protected Set<Artifact> resolvePluginArtifacts()
    throws ArtifactResolutionException, ArtifactNotFoundException, ArtifactFilterException
{
    final Set<Artifact> plugins = project.getPluginArtifacts();
    final Set<Artifact> reports = project.getReportArtifacts();

    Set<Artifact> artifacts = new HashSet<Artifact>();
    artifacts.addAll( reports );
    artifacts.addAll( plugins );

    final FilterArtifacts filter = getPluginArtifactsFilter();
    artifacts = filter.filter( artifacts );

    //        final ArtifactFilter filter = getPluginFilter();
    for ( final Artifact artifact : new HashSet<Artifact>( artifacts ) )
    {
        // resolve the new artifact
        this.resolver.resolve( artifact, this.remotePluginRepositories, this.getLocal() );
    }
    return artifacts;
}
 
开发者ID:gaol,项目名称:dependency-check-maven-plugin,代码行数:31,代码来源:DependencyCheckMojo.java

示例11: filter

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Set<?> filter(Set artifacts) throws ArtifactFilterException {

  if (!filterP2) {
    // allow all
    return artifacts;
  } else {
    // exclude group IDs starting with "p2."
    Set<Artifact> filtered = new HashSet<Artifact>();

    for (Object artifactObj : artifacts) {
      if (!((Artifact) artifactObj).getGroupId().startsWith("p2.")) {
        filtered.add((Artifact) artifactObj);
      }
    }

    return filtered;
  }
}
 
开发者ID:andriusvelykis,项目名称:pde-target-maven-plugin,代码行数:21,代码来源:AddPomDependenciesMojo.java

示例12: getDependencySets

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
/**
 * 
 * Method creates filters and filters the projects dependencies. This method
 * also transforms the dependencies if classifier is set. The dependencies
 * are filtered in least specific to most specific order
 * 
 * @param stopOnFailure
 * @return DependencyStatusSets - Bean of TreeSets that contains information
 *         on the projects dependencies
 * @throws MojoExecutionException 
 */
protected DependencyStatusSets getDependencySets( boolean stopOnFailure )
    throws MojoExecutionException
{
    // add filters in well known order, least specific to most specific
    FilterArtifacts filter = new FilterArtifacts();

    filter.addFilter( new TransitivityFilter( project.getDependencyArtifacts(), this.excludeTransitive ) );
    filter.addFilter( new ScopeFilter( this.includeScope, this.excludeScope ) );
    filter.addFilter( new TypeFilter( this.includeTypes, this.excludeTypes ) );
    filter.addFilter( new ClassifierFilter( this.includeClassifiers, this.excludeClassifiers ) );
    filter.addFilter( new GroupIdFilter( this.includeGroupIds, this.excludeGroupIds ) );
    filter.addFilter( new ArtifactIdFilter( this.includeArtifactIds, this.excludeArtifactIds ) );

    // start with all artifacts.
    Set artifacts = project.getArtifacts();

    // perform filtering
    try
    {
        artifacts = filter.filter( artifacts );
    }
    catch ( ArtifactFilterException e )
    {
        throw new MojoExecutionException(e.getMessage(),e);
    }

    // transform artifacts if classifier is set
    DependencyStatusSets status = null;
    if ( StringUtils.isNotEmpty( classifier ) )
    {
        status = getClassifierTranslatedDependencies( artifacts, stopOnFailure );
    }
    else
    {
        status = filterMarkedDependencies( artifacts );
    }

    return status;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:51,代码来源:AbstractDependencyFilterMojo.java

示例13: isArtifactIncluded

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
public boolean isArtifactIncluded( ArtifactItem item )
  throws ArtifactFilterException
{
    Artifact artifact = item.getArtifact();
    boolean overWrite = false;
    boolean result = false;
    if ( ( artifact.isSnapshot() && this.overWriteSnapshots )
        || ( !artifact.isSnapshot() && this.overWriteReleases ) )
    {
        overWrite = true;
    }

    handler.setArtifact( artifact );

    try
    {
        if ( overWrite || ( !handler.isMarkerSet() || ( overWriteIfNewer && handler.isMarkerOlder( artifact ) ) ) )
        {
            result = true;
        }
    }
    catch ( MojoExecutionException e )
    {
        throw new ArtifactFilterException (e.getMessage(),e);
    }

    return result;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:29,代码来源:MarkerFileFilter.java

示例14: isArtifactIncluded

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
public boolean isArtifactIncluded( ArtifactItem item ) throws ArtifactFilterException
{
    handler.setArtifact( item.getArtifact() );
    try
    {
        return ( !handler.isMarkerSet() );
    }
    catch ( MojoExecutionException e )
    {
        throw new ArtifactFilterException( e.getMessage(),e);
    }
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:13,代码来源:ResolveFileFilter.java

示例15: checkIfProcessingNeeded

import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; //导入依赖的package包/类
private boolean checkIfProcessingNeeded( ArtifactItem item )
    throws MojoExecutionException, ArtifactFilterException
{
    boolean result = false;
    if ( StringUtils.equalsIgnoreCase( item.getOverWrite(), "true" ) )
    {
        result = true;
    }
    else
    {
        ArtifactItemFilter filter = getMarkedArtifactFilter( item );
        result = filter.isArtifactIncluded( item );
    }
    return result;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:16,代码来源:AbstractFromConfigurationMojo.java


注:本文中的org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。