GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [MRESOURCES-190] Regression: The plugin is now silently ignoring .gitignore files. · Issue #397 · apache/maven-resources-plugin

[MRESOURCES-190] Regression: The plugin is now silently ignoring .gitignore files. #397

New issue
Copy link
New issue
Copy link
Closed
Closed
[MRESOURCES-190] Regression: The plugin is now silently ignoring .gitignore files.#397
Copy link
Assignees
khmarbaise
Labels
bugSomething isn't workingpriority:majorMajor loss of function
Milestone
3.0.0

Description

@jira-importer
jira-importer
opened on Oct 13, 2014
Issue body actions

Josue Abarca opened MRESOURCES-190 and commented

Hi, I have a custom archetype that includes a ".gitignore" file in the generated projects.

Since the change to Maven Resources Plugin 2.7, it seems that now it is silently excluding the ".gitignore" files.

If I change the pom to use the 2.6 version it works as expected.

I looked in the changelog for 2.7 and I can not find any note about it, so it seems like a regression.

In the archetype-metadata.xml I have:

<fileSet filtered="false" encoding="UTF-8">
<directory></directory>
<includes>
<include>.gitignore</include>
</includes>
</fileSet>

Here you can find an example project, that I am using for testing:

https://github.com/jmaslibre/my-app-archetype

Steps to reproduce:

  • Compile and install the archetype
    mvn clean install

  • Generate a project with the archetype
    cd ..
    mvn archetype:generate -DarchetypeGroupId=com.mycompany.app -DarchetypeArtifactId=my-app-archetype -DarchetypeVersion=1.0-SNAPSHOT -DgroupId=customGroup -DartifactId=customproject -DinteractiveMode=false

(unexpected) Current result :
ls -a customproject/.gitignore
ls: cannot access customproject/.gitignore: No such file or directory

Expected result:
ls -a customproject/.gitignore
customproject/.gitignore

Using:
Apache Maven 3.0.5
Java version: 1.7.0_67, vendor: Oracle Corporation
OS name: "linux" arch: "amd64", family: "unix"

If you need more information just let me know.


Affects: 2.7

Issue Links:

  • MRESOURCES-201 Add Parameter for not ignore directories with a leading dot.

4 votes, 6 watchers

Activity

  1. jira-importer commented on Nov 1, 2014

    @jira-importer
    jira-importer
    on Nov 1, 2014
    Author
    More actions

    Karl Heinz Marbaise commented

    Unfortunately i have to acknowledge this as a regression.
    This behaviour change can be drilled down to the upgrade of plexus-utils from 2.0.5 to 3.0.15. I have found the appropriate change http://jira.codehaus.org/browse/PLXUTILS-140. Created a new issue for this PLXUTILS-171

  2. jira-importer commented on May 7, 2015

    @jira-importer
    jira-importer
    on May 7, 2015
    Author
    More actions

    Christian Schlichtherle commented

    The change in PLXUTILS-140 is really a bad idea: If at all, the .git directory should be ignored, not the .gitignore and .gitattributes files. Likewise for the .hg directory. Better not to ignore anything by default because you can't configure this in these dependent plugins.

    What's more important, this change also breaks the maven-source-plugin:2.4:jar-no-fork goal for the same reason. It has a dependency on plexus-utils:3.0.18 .

  3. jira-importer commented on Mar 7, 2016

    @jira-importer
    jira-importer
    on Mar 7, 2016
    Author
    More actions

    Karl Heinz Marbaise commented

    You can now configure the maven-resources-plugin to support copying of those ignored files by using the following option:

    <plugin>
      <groupId>..</groupId>
      <artifactId>..</artifactId>
      ..
      <configuration>
        <addDefaultExcludes>false</addDefaultExcludes>
      </configuration>
    </plugin>
  4. jira-importer commented on Mar 7, 2016

    @jira-importer
    jira-importer
    on Mar 7, 2016
    Author
    More actions

    Karl Heinz Marbaise commented

    Fixed in r1733876

  5. jira-importer commented on Mar 7, 2016

    @jira-importer
    jira-importer
    on Mar 7, 2016
    Author
    More actions

    Christian Schlichtherle commented

    What do these default excludes contain? As stated above, I think they not contain .gitignore and .hgignore.

  6. jira-importer commented on Mar 7, 2016

    @jira-importer
    jira-importer
    on Mar 7, 2016
    Author
    More actions

    Karl Heinz Marbaise commented

    The contain the following:

      /**
    +     * By default files like {@code .gitignore}, {@code .cvsignore} etc. are excluded which means they will not being
    +     * copied. If you need them for a particular reason you can do that by settings this to {@code false}. This means
    +     * all files like the following will be copied.
    +     * <ul>
    +     * <li>Misc: &#42;&#42;/&#42;~, &#42;&#42;/#&#42;#, &#42;&#42;/.#&#42;, &#42;&#42;/%&#42;%, &#42;&#42;/._&#42;</li>
    +     * <li>CVS: &#42;&#42;/CVS, &#42;&#42;/CVS/&#42;&#42;, &#42;&#42;/.cvsignore</li>
    +     * <li>RCS: &#42;&#42;/RCS, &#42;&#42;/RCS/&#42;&#42;</li>
    +     * <li>SCCS: &#42;&#42;/SCCS, &#42;&#42;/SCCS/&#42;&#42;</li>
    +     * <li>VSSercer: &#42;&#42;/vssver.scc</li>
    +     * <li>MKS: &#42;&#42;/project.pj</li>
    +     * <li>SVN: &#42;&#42;/.svn, &#42;&#42;/.svn/&#42;&#42;</li>
    +     * <li>GNU: &#42;&#42;/.arch-ids, &#42;&#42;/.arch-ids/&#42;&#42;</li>
    +     * <li>Bazaar: &#42;&#42;/.bzr, &#42;&#42;/.bzr/&#42;&#42;</li>
    +     * <li>SurroundSCM: &#42;&#42;/.MySCMServerInfo</li>
    +     * <li>Mac: &#42;&#42;/.DS_Store</li>
    +     * <li>Serena Dimension: &#42;&#42;/.metadata, &#42;&#42;/.metadata/&#42;&#42;</li>
    +     * <li>Mercurial: &#42;&#42;/.hg, &#42;&#42;/.hg/&#42;&#42;</li>
    +     * <li>GIT: &#42;&#42;/.git, &#42;&#42;/.gitignore, &#42;&#42;/.gitattributes, &#42;&#42;/.git/&#42;&#42;</li>
    +     * <li>Bitkeeper: &#42;&#42;/BitKeeper, &#42;&#42;/BitKeeper/&#42;&#42;, &#42;&#42;/ChangeSet,
    +     * &#42;&#42;/ChangeSet/&#42;&#42;</li>
    +     * <li>Darcs: &#42;&#42;/_darcs, &#42;&#42;/_darcs/&#42;&#42;, &#42;&#42;/.darcsrepo,
    +     * &#42;&#42;/.darcsrepo/&#42;&#42;&#42;&#42;/-darcs-backup&#42;, &#42;&#42;/.darcs-temp-mail
    +     * </ul>
    +     *
    +     * @since 3.0.0
    

    Apart from that your assumption is partially not correct (See above list). maven-filtering component contained a default call to addDefaultExcludes which always excluded the above list.
    I need to add .hgignore to plexus...

  7. jira-importer commented on Mar 7, 2016

    @jira-importer
    jira-importer
    on Mar 7, 2016
    Author
    More actions

    Christian Schlichtherle commented

    Thanks for this list. It appears to be pretty arbitrary. I wonder what the use case behind excluding all these files by default. For my use case (generating a Maven Archetype), I would like most of these files included. For example, I want the .gitignore and .hgignore files to be included in the generated archetype, so that the are created when the Maven Archetype Plugin creates a project from my archetype.

  8. jira-importer commented on Mar 7, 2016

    @jira-importer
    jira-importer
    on Mar 7, 2016
    Author
    More actions

    Karl Heinz Marbaise commented

    In maven-filtering this behaviour was included since 2012 furthermore usually you don't want having all .gitignore or .svn (for older SVN versions which was contained in every folder) folders to be copied to the target/classes folder...That was the reason doing so...and furthermore today having a .gitignore in a src/main/resources/ or more likely .gitattribute in src/main/resources i don't want to have it being copied to target/classes folder...The archetype is a special case yes...and there are some cases where it might be useful.

  9. jira-importer commented on Mar 7, 2016

    @jira-importer
    jira-importer
    on Mar 7, 2016
    Author
    More actions

    Christian Schlichtherle commented

    Well, maybe this plugin should have separate goals: One for copying resources into JARs (so as is) and a new one for copying resources into archetypes. I think this is really a separate use case. Each of these goals could then have different default exclude lists.

  10. jira-importer
    closed this as completedon Mar 27, 2016
  11. jira-importer
    assigned
    khmarbaise
    on Jun 17, 2025
  12. jira-importer
    added
    bugSomething isn't working
    priority:majorMajor loss of function
    on Jun 17, 2025
  13. gnodet
    added 2 commits that reference this issue on Sep 26, 2026

    [MRESOURCES-453] Leverage ChangeDetection from maven-filtering #397

    bf89b3c

    [MRESOURCES-453] Leverage ChangeDetection from maven-filtering #397

    ed570e3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @khmarbaise
    khmarbaise

Labels

bugSomething isn't workingpriority:majorMajor loss of function

Type

No type

Projects

No projects

    Milestone

    • 3.0.0

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.