You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Zhang Xiaoyu (JIRA)" <ji...@apache.org> on 2018/07/13 01:39:00 UTC

[jira] [Commented] (ARCHETYPE-548) Resource files without extensions are not included in archetype

    [ https://issues.apache.org/jira/browse/ARCHETYPE-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16542401#comment-16542401 ] 

Zhang Xiaoyu commented on ARCHETYPE-548:
----------------------------------------

We met the same problem with version 3.0.1.

Currently we are using locally compiled plugin with below code change, which can work normally:
{code:java}
private FileSet getUnpackagedFileSet( final boolean filtered, final String group, final List<String> groupFiles,
                                          String defaultEncoding )
    {
//        Set<String> extensions = getExtensions( groupFiles );

        List<String> includes = new ArrayList<String>();
        List<String> excludes = new ArrayList<String>();

//        for ( String extension : extensions )
//        {
//            includes.add( "**/*." + extension );
//        }

        for ( String file : groupFiles )
        {
            if ( StringUtils.isEmpty( getExtension( file ) ) )
            {
                //include the exact name of file without extension.
                includes.add( file );
            }
            else
            {
                includes.add( "**/*." + getExtension( file ) );
            }
        }

        includes = new ArrayList<>( new HashSet<>( includes ) );

        return createFileSet( excludes, false, filtered, group, includes, defaultEncoding );
    }

private String getExtension( String file )
{
    return FileUtils.extension( ( file ) );
}
{code}

> Resource files without extensions are not included in archetype
> ---------------------------------------------------------------
>
>                 Key: ARCHETYPE-548
>                 URL: https://issues.apache.org/jira/browse/ARCHETYPE-548
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Archetypes
>            Reporter: Jay Guidos
>            Priority: Major
>
> Similar to the problem resolved in ARCHETYPE-499, but the patch for that Jira only addresses source files without extensions.  Resource files without extensions are still not included 
> There are are two implementations of getUnpackagedFileSet() in FileArchesetTypeCreator, and only one of them (the one called when a file is considered a source file) has the ARCHETYPE-499 patch.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)