Uploaded image for project: 'Maven Archetype'
  1. Maven Archetype
  2. ARCHETYPE-605

Allow .gitignore file in archetype resources

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.2.1
    • Plugin
    • None

    Description

      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.

      archiver.getArchiver().addDirectory( archetypeDirectory );

      This method does not configure default excludes, that are enabled by default.

          @Override
          public void addDirectory( @Nonnull final File directory )
              throws ArchiverException
          {
              addFileSet(
                  fileSet( directory ).prefixed( "" ).includeExclude( null, null ).includeEmptyDirs( includeEmptyDirs ) );
          }

      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, .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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ketoor Piotr Lewandowski
              Votes:
              6 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: