You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MRESOURCES-190] Regression: The plugin is now silently ignoring .gitignore files. #397
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
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
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 .
/**
+ * 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: **/*~, **/#*#, **/.#*, **/%*%, **/._*</li>
+ * <li>CVS: **/CVS, **/CVS/**, **/.cvsignore</li>
+ * <li>RCS: **/RCS, **/RCS/**</li>
+ * <li>SCCS: **/SCCS, **/SCCS/**</li>
+ * <li>VSSercer: **/vssver.scc</li>
+ * <li>MKS: **/project.pj</li>
+ * <li>SVN: **/.svn, **/.svn/**</li>
+ * <li>GNU: **/.arch-ids, **/.arch-ids/**</li>
+ * <li>Bazaar: **/.bzr, **/.bzr/**</li>
+ * <li>SurroundSCM: **/.MySCMServerInfo</li>
+ * <li>Mac: **/.DS_Store</li>
+ * <li>Serena Dimension: **/.metadata, **/.metadata/**</li>
+ * <li>Mercurial: **/.hg, **/.hg/**</li>
+ * <li>GIT: **/.git, **/.gitignore, **/.gitattributes, **/.git/**</li>
+ * <li>Bitkeeper: **/BitKeeper, **/BitKeeper/**, **/ChangeSet,
+ * **/ChangeSet/**</li>
+ * <li>Darcs: **/_darcs, **/_darcs/**, **/.darcsrepo,
+ * **/.darcsrepo/****/-darcs-backup*, **/.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...
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.
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.
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.
Activity
jira-importer commentedon Nov 1, 2014
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
jira-importer commentedon May 7, 2015
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 .
jira-importer commentedon Mar 7, 2016
Karl Heinz Marbaise commented
You can now configure the maven-resources-plugin to support copying of those ignored files by using the following option:
jira-importer commentedon Mar 7, 2016
Karl Heinz Marbaise commented
Fixed in r1733876
jira-importer commentedon Mar 7, 2016
Christian Schlichtherle commented
What do these default excludes contain? As stated above, I think they not contain
.gitignoreand.hgignore.jira-importer commentedon Mar 7, 2016
Karl Heinz Marbaise commented
The contain the following:
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
.hgignoreto plexus...jira-importer commentedon Mar 7, 2016
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
.gitignoreand.hgignorefiles to be included in the generated archetype, so that the are created when the Maven Archetype Plugin creates a project from my archetype.jira-importer commentedon Mar 7, 2016
Karl Heinz Marbaise commented
In maven-filtering this behaviour was included since 2012 furthermore usually you don't want having all
.gitignoreor.svn(for older SVN versions which was contained in every folder) folders to be copied to thetarget/classesfolder...That was the reason doing so...and furthermore today having a.gitignorein asrc/main/resources/or more likely.gitattributeinsrc/main/resourcesi don't want to have it being copied totarget/classesfolder...The archetype is a special case yes...and there are some cases where it might be useful.jira-importer commentedon Mar 7, 2016
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.
[MRESOURCES-453] Leverage ChangeDetection from maven-filtering #397
[MRESOURCES-453] Leverage ChangeDetection from maven-filtering #397