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

Joël Royer edited comment on MRESOURCES-264 at 8/6/20, 12:11 PM:
-----------------------------------------------------------------

I'm using maven-resource-plugin in a maven artefact, and I have a .gitignore in 
src/main/resources/archetypes-resources folder.

Here is my pom.xml:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
 <modelVersion>4.0.0</modelVersion>

 <groupId>com.foo.archetypes</groupId>
 <artifactId>my-archetype</artifactId>
 <version>1.0.0-SNAPSHOT</version>
 <packaging>maven-archetype</packaging>

 <properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <maven-archetype.version>3.2.0</maven-archetype.version>
  <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
 </properties>

 <build>
  <extensions>
   <extension>
    <groupId>org.apache.maven.archetype</groupId>
    <artifactId>archetype-packaging</artifactId>
    <version>${maven-archetype.version}</version>
   </extension>
  </extensions>

  <pluginManagement>
   <plugins>
    <plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-archetype-plugin</artifactId>
     <version>${maven-archetype.version}</version>
     <configuration>
      <skip>true</skip>
     </configuration>
    </plugin>

    <plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-resources-plugin</artifactId>
     <version>${maven-resources-plugin.version}</version>
     <configuration>
      <addDefaultExcludes>false</addDefaultExcludes>
     </configuration>
    </plugin>
   </plugins>
  </pluginManagement>
 </build>
</project>{code}
Here is the fileset in archetype-metadata.xml:
{code:xml}
<fileSet filtered="true" encoding="UTF-8">
 <directory>/</directory>
 <includes>
  <include>.gitignore</include>
  <include>README.md</include>
 </includes>
</fileSet>
{code}


was (Author: joelroyer):
I'm using maven-resource-plugin in a maven artefact, and I have a .gitignore in 
src/main/resources/archetypes-resources folder. This

Here is my pom.xml:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
 <modelVersion>4.0.0</modelVersion>

 <groupId>com.foo.archetypes</groupId>
 <artifactId>my-archetype</artifactId>
 <version>1.0.0-SNAPSHOT</version>
 <packaging>maven-archetype</packaging>

 <properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <maven-archetype.version>3.2.0</maven-archetype.version>
  <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
 </properties>

 <build>
  <extensions>
   <extension>
    <groupId>org.apache.maven.archetype</groupId>
    <artifactId>archetype-packaging</artifactId>
    <version>${maven-archetype.version}</version>
   </extension>
  </extensions>

  <pluginManagement>
   <plugins>
    <plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-archetype-plugin</artifactId>
     <version>${maven-archetype.version}</version>
     <configuration>
      <skip>true</skip>
     </configuration>
    </plugin>

    <plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-resources-plugin</artifactId>
     <version>${maven-resources-plugin.version}</version>
     <configuration>
      <addDefaultExcludes>false</addDefaultExcludes>
     </configuration>
    </plugin>
   </plugins>
  </pluginManagement>
 </build>
</project>{code}
Here is the fileset in archetype-metadata.xml:
{code:xml}
<fileSet filtered="true" encoding="UTF-8">
 <directory>/</directory>
 <includes>
  <include>.gitignore</include>
  <include>README.md</include>
 </includes>
</fileSet>
{code}

> Parameter addDefaultExcludes with false does not copy .gitignore
> ----------------------------------------------------------------
>
>                 Key: MRESOURCES-264
>                 URL: https://issues.apache.org/jira/browse/MRESOURCES-264
>             Project: Maven Resources Plugin
>          Issue Type: Bug
>          Components: copy
>    Affects Versions: 3.1.0
>         Environment: CentOS 7 64bits, OpenJDK 11.0.7, Maven 3.6.3, Maven 
> Archetype Plugin 3.2.0
>            Reporter: Joël Royer
>            Priority: Major
>
> In a Maven archetype, I'm using the resource plugin to copy some files like a 
> .gitignore template. But this file is not copied when I generate a project 
> from this artefact.
> Here is my config for the resource plugin in my artefact:
> {code:java}
> <plugin>
>  <groupId>org.apache.maven.plugins</groupId>
>  <artifactId>maven-resources-plugin</artifactId>
>  <version>3.1.0</version>
>  <configuration>
>   <!-- Required so that .gitignore gets included in archetypes -->
>   <!-- See https://issues.apache.org/jira/browse/MRESOURCES-190 -->
>   <addDefaultExcludes>false</addDefaultExcludes>
>  </configuration>
> </plugin>
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to