• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DefaultFileSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.codehaus.plexus.archiver.util.DefaultFileSet的典型用法代码示例。如果您正苦于以下问题:Java DefaultFileSet类的具体用法?Java DefaultFileSet怎么用?Java DefaultFileSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DefaultFileSet类属于org.codehaus.plexus.archiver.util包,在下文中一共展示了DefaultFileSet类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createArchiveFile

import org.codehaus.plexus.archiver.util.DefaultFileSet; //导入依赖的package包/类
private File createArchiveFile( File targetDirectory, String directory, String archiveExt )
    throws NoSuchArchiverException, IOException, MojoExecutionException
{
    final MavenArchiver mavenArchiver = new MavenArchiver();

    mavenArchiver.setArchiver( jarArchiver );

    jarArchiver.addFileSet( new DefaultFileSet( targetDirectory ) );
    // jarArchiver.setDuplicateBehavior( duplicate );

    File resultArchive = getArchiveFile( getOutputDirectory(), getFinalName(), directory, archiveExt );

    mavenArchiver.setOutputFile( resultArchive );
    try
    {
        mavenArchiver.createArchive( getMavenSession(), getMavenProject(), getArchive() );
    }
    catch ( ArchiverException | ManifestException | DependencyResolutionRequiredException e )
    {
        getLog().error( e.getMessage(), e );
        throw new MojoExecutionException( e.getMessage(), e );
    }

    return resultArchive;

}
 
开发者ID:khmarbaise,项目名称:multienv-maven-plugin,代码行数:27,代码来源:ConfigurationMojo.java


示例2: execute

import org.codehaus.plexus.archiver.util.DefaultFileSet; //导入依赖的package包/类
/**
 * This Mojo gathers all deliverables into one archive and selects it as a project artifact
 * 
 * @throws MojoExecutionException .
 * @throws MojoFailureException when plugin execution result was other than expected
 * @see org.apache.maven.plugin.Mojo#execute()
 */
public void execute()
    throws MojoExecutionException, MojoFailureException
{
    File output = new File( String.format( "%s/%s.prz", targetFolder, finalName ) );
    getLog().info( String.format( "Packaging data from %s to %s", prePackageFolder, output.getName() ) );
    DefaultFileSet fileSet = new DefaultFileSet();
    fileSet.setDirectory( prePackageFolder );
    try
    {
        zipArchiver.addFileSet( fileSet );
        zipArchiver.setDestFile( output );
        zipArchiver.createArchive();
    }
    catch ( Exception e )
    {
        getLog().debug( "Failed to create archive", e );
        throw new MojoFailureException( e, "Failed to create archive",
                                        "Exception caught during an attempt to create an archive" );
    }

    project.getArtifact().setFile( output );
    getLog().info( "Done packaging" );
}
 
开发者ID:tptak,项目名称:installshield-maven-plugin,代码行数:31,代码来源:PrqPackageMojo.java


示例3: perform

import org.codehaus.plexus.archiver.util.DefaultFileSet; //导入依赖的package包/类
@Override
public void perform(final DARMojoContext context) throws IOException {
    final File diffusionDirectory = context.getDiffusionResourceDirectory();

    if (diffusionDirectory.exists()) {
        final DefaultFileSet fileSet = new DefaultFileSet();

        fileSet.setDirectory(diffusionDirectory);
        fileSet.setIncludes(
                or(context.getDiffusionIncludes(), DEFAULT_INCLUDES));
        fileSet.setExcludes(
                or(context.getDiffusionExcludes(), DEFAULT_EXCLUDES));

        fileSet.setPrefix(
                context.getPrefixDirectoryName() + File.separator);

        context.getArchiver().addFileSet(fileSet);
    }
    else {
        context.getLog().warn(
                diffusionDirectory + " does not exist, skipping");
    }
}
 
开发者ID:pushtechnology,项目名称:mvndar,代码行数:24,代码来源:AddDiffusionResourcesTask.java


示例4: createArchiveFile

import org.codehaus.plexus.archiver.util.DefaultFileSet; //导入依赖的package包/类
private File createArchiveFile( File unpackDirectory, File targetDirectory, String directory, String archiveExt )
    throws NoSuchArchiverException, IOException, MojoExecutionException
{
    final MavenArchiver mavenArchiver = new MavenArchiver();

    mavenArchiver.setArchiver( jarArchiver );

    jarArchiver.addFileSet( new DefaultFileSet( targetDirectory ) );
    jarArchiver.addFileSet( new DefaultFileSet( unpackDirectory ) );
    // jarArchiver.setDuplicateBehavior( duplicate );

    File resultArchive = getArchiveFile( getOutputDirectory(), getFinalName(), directory, archiveExt );

    mavenArchiver.setOutputFile( resultArchive );
    try
    {
        mavenArchiver.createArchive( getMavenSession(), getMavenProject(), getArchive() );
    }
    catch ( ArchiverException | ManifestException | DependencyResolutionRequiredException e )
    {
        getLog().error( e.getMessage(), e );
        throw new MojoExecutionException( e.getMessage(), e );
    }

    return resultArchive;

}
 
开发者ID:khmarbaise,项目名称:multienv-maven-plugin,代码行数:28,代码来源:EnvironmentMojo.java


示例5: toPlexusFileset

import org.codehaus.plexus.archiver.util.DefaultFileSet; //导入依赖的package包/类
private org.codehaus.plexus.archiver.FileSet toPlexusFileset(org.apache.maven.model.FileSet mavenFs)
{
  DefaultFileSet plexusFs = new DefaultFileSet();
  plexusFs.setDirectory(readDirectory(mavenFs));
  plexusFs.setIncludes(mavenFs.getIncludes().toArray(new String[0]));
  plexusFs.setExcludes(mavenFs.getExcludes().toArray(new String[0]));
  plexusFs.setUsingDefaultExcludes(false);
  plexusFs.setIncludingEmptyDirectories(true);
  return plexusFs;
}
 
开发者ID:axonivy,项目名称:project-build-plugin,代码行数:11,代码来源:FileSetConverter.java


示例6: getDefaultFileset

import org.codehaus.plexus.archiver.util.DefaultFileSet; //导入依赖的package包/类
private DefaultFileSet getDefaultFileset(File sourceDir)
{
  DefaultFileSet fileSet = new DefaultFileSet();
  fileSet.setDirectory(sourceDir);
  fileSet.setIncludingEmptyDirectories(iarIncludesEmptyDirs);
  fileSet.setIncludes(DEFAULT_INCLUDES);
  fileSet.setExcludes(ArrayUtils.addAll(DEFAULT_EXCLUDES, iarExcludes));
  return fileSet;
}
 
开发者ID:axonivy,项目名称:project-build-plugin,代码行数:10,代码来源:IarPackagingMojo.java


示例7: attachGeneratedIncludeFilesAsIncZip

import org.codehaus.plexus.archiver.util.DefaultFileSet; //导入依赖的package包/类
private void attachGeneratedIncludeFilesAsIncZip()
    throws MojoExecutionException
{
    try
    {
        ZipArchiver archiver = new ZipArchiver();
        DefaultFileSet fileSet = new DefaultFileSet();
        fileSet.setUsingDefaultExcludes( true );
        fileSet.setDirectory( javahOutputDirectory );
        archiver.addFileSet( fileSet );
        archiver.setDestFile( this.incZipFile );
        archiver.createArchive();

        if ( StringUtils.isBlank( this.classifier ) )
        {
            projectHelper.attachArtifact( this.project, INCZIP_TYPE, null, this.incZipFile );
        }
        else
        {
            projectHelper.attachArtifact( this.project, INCZIP_TYPE, this.classifier, this.incZipFile );
        }
    }
    catch ( Exception e )
    {
        throw new MojoExecutionException( "Unable to archive/deploy generated include files", e );
    }
}
 
开发者ID:mojohaus,项目名称:maven-native,代码行数:28,代码来源:NativeJavahMojo.java


示例8: execute

import org.codehaus.plexus.archiver.util.DefaultFileSet; //导入依赖的package包/类
/**
 * 
 * @throws MojoExecutionException if an unexpected problem occurs
 * @throws MojoFailureException if an expected problem occurs
 */
public void execute()
    throws MojoExecutionException, MojoFailureException
{

    try
    {
        File nbmBuildDirFile = new File( outputDirectory, brandingToken );

        ZipArchiver archiver = new ZipArchiver();
        DefaultFileSet fs = new DefaultFileSet();
        fs.setDirectory( outputDirectory );
        fs.setIncludes( new String[] {
            brandingToken + "/**",
        } );
        fs.setExcludes( new String[] {
            brandingToken + "/bin/*",
        } );
        archiver.addFileSet( fs );
        File bins = new File( nbmBuildDirFile, "bin" );
        for ( File bin : bins.listFiles() )
        {
            archiver.addFile( bin, brandingToken + "/bin/" + bin.getName(), 0755 );
        }
        File zipFile = new File( outputDirectory, finalName + ".zip" );
        //TODO - somehow check for last modified content to see if we shall be
        //recreating the zip file.
        archiver.setDestFile( zipFile );
        archiver.setForced( false );
        archiver.createArchive();
        project.getArtifact().setFile( zipFile );

    }
    catch ( Exception ex )
    {
        throw new MojoExecutionException( "", ex );
    }

}
 
开发者ID:bitstrings,项目名称:nbm-maven,代码行数:44,代码来源:CreateStandaloneMojo.java


示例9: perform

import org.codehaus.plexus.archiver.util.DefaultFileSet; //导入依赖的package包/类
@Override
public void perform(final DARMojoContext context) throws IOException {

    final File outputDirectory = context.getOutputDirectory();

    if (outputDirectory.exists()) {
        final DefaultFileSet fileSet = new DefaultFileSet();

        fileSet.setDirectory(context.getOutputDirectory());
        fileSet.setIncludes(
            or(context.getOutputIncludes(), DEFAULT_INCLUDES));
        fileSet.setExcludes(
            or(context.getOutputExcludes(), DEFAULT_EXCLUDES));

        final File target =
            FileUtils.getFile(
                context.getPrefixDirectoryName(),
                context.getExtDirectoryName());

        fileSet.setPrefix(target.toString() + File.separator);

        context.getArchiver().addFileSet(fileSet);
    }
    else {
        context.getLog().warn(
            outputDirectory + " does not exist, skipping");
    }
}
 
开发者ID:pushtechnology,项目名称:mvndar,代码行数:29,代码来源:AddProjectOutputTask.java


示例10: execute

import org.codehaus.plexus.archiver.util.DefaultFileSet; //导入依赖的package包/类
public void execute()
    throws MojoExecutionException
{
    if ( skipIncludeDeployment )
    {
        return;
    }

    if ( this.sources.length != 0 )
    {
        try
        {
            ZipArchiver archiver = new ZipArchiver();

            boolean zipIt = false;
            for ( int i = 0; i < sources.length; ++i )
            {
                if ( sources[i].isDeployable() )
                {
                    DefaultFileSet fileSet = new DefaultFileSet();
                    fileSet.setUsingDefaultExcludes( true );
                    fileSet.setDirectory( sources[i].getDirectory() );
                    fileSet.setIncludes( sources[i].getIncludes() );
                    fileSet.setExcludes( sources[i].getExcludes() );
                    archiver.addFileSet( fileSet );
                    zipIt = true;
                }
            }

            if ( zipIt )
            {
                archiver.setDestFile( this.incZipFile );
                archiver.createArchive();
                projectHelper.attachArtifact( this.project, INCZIP_TYPE, null, this.incZipFile );
            }
        }
        catch ( Exception e )
        {
            throw new MojoExecutionException( e.getMessage(), e );
        }
    }
}
 
开发者ID:mojohaus,项目名称:maven-native,代码行数:43,代码来源:NativeBundleIncludeFilesMojo.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AopConfigUtils类代码示例发布时间:2022-05-22
下一篇:
Java QueryFunction类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap