[ https://issues.apache.org/jira/browse/ARCHETYPE-605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17476878#comment-17476878 ]
Piotr Lewandowski edited comment on ARCHETYPE-605 at 1/16/22, 9:11 PM: ----------------------------------------------------------------------- [~mire...@gmail.com] I can confirm that this works fine. You have to remember to reconfigure your Maven project accordingly to the [FAQ|https://maven.apache.org/archetype/maven-archetype-plugin/faq.html#excludes] was (Author: ketoor): [~mire...@gmail.com] I can confirm that this works fine. You have to remember to reconfigure your Maven project accordingly to the [FAQ|https://github.com/apache/maven-archetype/commit/5351651b33fde2cb046e2f103bbc6be3c38acbab#diff-0688c079bb77e1b385bfcc162e461397754653c8a8510607f7dba8882a7a24e2R58] > 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)