You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Miroslav Zaťko (Jira)" <ji...@apache.org> on 2022/01/16 00:26:00 UTC

[jira] [Comment Edited] (ARCHETYPE-605) Allow .gitignore file in archetype resources

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

Miroslav Zaťko edited comment on ARCHETYPE-605 at 1/16/22, 12:25 AM:
---------------------------------------------------------------------

is it fixed in 3.2.1, can someone confirm? for me it looks like it is still an issue. ".gitignore" is not included in archetype jar

Changing version of maven-archetype-plugin from 3.2.1 back to older 3.1.2 fixes the issue...


was (Author: mirec.z@gmail.com):
is it fixed in 3.2.1, can someone confirm? for me it looks like it is still an issue. ".gitignore" is not included in archetype jar

> Allow .gitignore file in archetype resources
> --------------------------------------------
>
>                 Key: ARCHETYPE-605
>                 URL: https://issues.apache.org/jira/browse/ARCHETYPE-605
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Plugin
>    Affects Versions: 3.2.0
>            Reporter: Piotr Lewandowski
>            Priority: Major
>             Fix For: 3.2.1
>
>
> Since 3.2.0 (and plexus-archiver:4.2.2) JAR archive with archetype does not include {{.gitignore}} file, despite of fact that this file is located in {{archetype-resources}} directory.
> In {{JarMojo}} Plexus' {{addDirectory(File)}} method is called.
> {code:java}
> archiver.getArchiver().addDirectory( archetypeDirectory );{code}
> This method does not configure default excludes, that are enabled by default.
> {code:java}
>     @Override
>     public void addDirectory( @Nonnull final File directory )
>         throws ArchiverException
>     {
>         addFileSet(
>             fileSet( directory ).prefixed( "" ).includeExclude( null, null ).includeEmptyDirs( includeEmptyDirs ) );
>     }{code}
> {{setUsingDefaultExcludes}} method is not called on fileSet here.
> Later on, this fileSet is used to create {{PlexusIoFileResourceCollection}} object. On this object, {{getResources}} method is called that uses Plexus' {{DirectoryScanner}} to find out all resources that should be included into final artifact. This scanner uses {{usingDefaultExcludes}} configuration and excludes [among the others|https://github.com/sonatype/plexus-utils/blob/master/src/main/java/org/codehaus/plexus/util/AbstractScanner.java#L92], {{.gitignore}} file.
> I have not found any way to configure archetype-archiver to disable default excludes. In my opinion current behavior is a regression - custom {{.gitignore}} is useful feature in archetypes.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)