You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2020/10/27 19:27:43 UTC

[maven-archetype] branch ARCHETYPE-606 created (now d518207)

This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a change to branch ARCHETYPE-606
in repository https://gitbox.apache.org/repos/asf/maven-archetype.git.


      at d518207  Cleanup integration tests

This branch includes the following new commits:

     new 0e22327  - There is no way to include .gitignore files for the jar goal
     new 79db20a  Make exclude behaviour configurable
     new 329cc02  Add it for exclude behaviour
     new 63243f1  Fix javadoc formatting
     new f0f6571  Fix IT
     new 113c090  Remove unneeded file.
     new d518207  Cleanup integration tests

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-archetype] 06/07: Remove unneeded file.

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch ARCHETYPE-606
in repository https://gitbox.apache.org/repos/asf/maven-archetype.git

commit 113c090c0d9f00664ccb3f39e545c361addb6148
Author: Peter Lamby <pe...@direkt-gruppe.de>
AuthorDate: Mon Oct 12 11:10:15 2020 +0200

    Remove unneeded file.
    
    This file is now generated by the setup script.
---
 .../src/test/resources/projects/basic/reference/.gitignore               | 1 -
 1 file changed, 1 deletion(-)

diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/reference/.gitignore b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/reference/.gitignore
deleted file mode 100644
index 403f980..0000000
--- a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/reference/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-# Dummy


[maven-archetype] 01/07: - There is no way to include .gitignore files for the jar goal

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch ARCHETYPE-606
in repository https://gitbox.apache.org/repos/asf/maven-archetype.git

commit 0e2232758725690915fea559a8a846ad24ff3f82
Author: Peter Lamby <pe...@direkt-gruppe.de>
AuthorDate: Wed Oct 7 14:33:18 2020 +0200

    - There is no way to include .gitignore files for the jar goal
    
    It was impossible to include files which are by default excluded
    by plexus-archiver like .gitignore. This patch enables plexus-archiver
    to add these files.
---
 .../src/main/java/org/apache/maven/archetype/mojos/JarMojo.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/JarMojo.java b/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/JarMojo.java
index c950f38..2e72a4e 100644
--- a/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/JarMojo.java
+++ b/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/JarMojo.java
@@ -37,6 +37,7 @@ import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.archiver.Archiver;
 import org.codehaus.plexus.archiver.jar.JarArchiver;
+import org.codehaus.plexus.archiver.util.DefaultFileSet;
 
 import java.io.File;
 import java.util.Map;
@@ -136,7 +137,10 @@ public class JarMojo
 
         try
         {
-            archiver.getArchiver().addDirectory( archetypeDirectory );
+            DefaultFileSet fs = DefaultFileSet.fileSet( archetypeDirectory ).prefixed( "" )
+                .includeExclude( null,  null ).includeEmptyDirs( true );
+            fs.setUsingDefaultExcludes( false );
+            archiver.getArchiver().addFileSet( fs );
 
             archiver.createArchive( session, project, archive );
         }


[maven-archetype] 05/07: Fix IT

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch ARCHETYPE-606
in repository https://gitbox.apache.org/repos/asf/maven-archetype.git

commit f0f65712d65decb6842805f2e1f049282c027c6a
Author: Peter Lamby <pe...@direkt-gruppe.de>
AuthorDate: Mon Oct 12 11:06:28 2020 +0200

    Fix IT
---
 .../{verify.bsh => setup.bsh}                      | 30 +++++-----------------
 .../META-INF/maven/archetype-metadata.xml          |  6 +++++
 .../main/resources/archetype-resources/.gitignore  |  1 -
 3 files changed, 13 insertions(+), 24 deletions(-)

diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/verify.bsh b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/setup.bsh
similarity index 56%
rename from maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/verify.bsh
rename to maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/setup.bsh
index 2d245ae..8affb5d 100644
--- a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/verify.bsh
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/setup.bsh
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -18,29 +17,14 @@
  * under the License.
  */
 
+// This is a workaround. The invoker-plugin does not copy the .gitignore file to the clone
+// target directory. So we create the .gitignore here in the setup task.
+
 import java.io.*;
 import org.codehaus.plexus.util.*;
 
-basedir = new File( basedir, "target/test-classes/projects/basic/project/project/basic" );
-if ( !basedir.exists() ) {
-	throw new Exception( basedir + " is missing." );
-}
-
-File main = new File( basedir, "src/main" );
-
-// check <fileset packaged="true">
-File app = new File( main, "java/build/archetype/App.java" );
-if ( !app.isFile() )
-{
-    throw new Exception( app + " file is missing or not a file." );
-}
-
-File buildLog = new File( basedir, "build.log" );
-
-String content = FileUtils.fileRead( buildLog, "UTF-8" );
+srcGitignore = new File ( basedir, "src/main/resources/archetype-resources/.gitignore" );
+targetGitignore = new File ( basedir, "src/test/resources/projects/basic/reference/.gitignore" );
 
-int idx = content.indexOf( "Yeah Baby, it rocks!" );
-if ( idx < 0 )
-{
-    throw new Exception( "build.log missing System.out.println from verify.groovy" );
-}
+FileUtils.fileWrite(srcGitignore, "UTF-8", "#Dummy");
+FileUtils.fileWrite(targetGitignore, "UTF-8", "#Dummy");
\ No newline at end of file
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/META-INF/maven/archetype-metadata.xml
index 28ff4bf..abe5546 100644
--- a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -24,6 +24,12 @@ under the License.
     xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
     name="build-archetype-IT">
   <fileSets>
+    <fileSet encoding="UTF-8">
+      <directory></directory>
+      <includes>
+        <include>.gitignore</include>
+      </includes>
+    </fileSet>
     <fileSet filtered="true" packaged="true" encoding="UTF-8">
       <directory>src/main/java</directory>
       <includes>
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/archetype-resources/.gitignore b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/archetype-resources/.gitignore
deleted file mode 100644
index 403f980..0000000
--- a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/archetype-resources/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-# Dummy


[maven-archetype] 02/07: Make exclude behaviour configurable

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch ARCHETYPE-606
in repository https://gitbox.apache.org/repos/asf/maven-archetype.git

commit 79db20abe81ee5b0ea2c9e353e15fd5d28f2718c
Author: Peter Lamby <pe...@direkt-gruppe.de>
AuthorDate: Fri Oct 9 14:36:23 2020 +0200

    Make exclude behaviour configurable
---
 .../src/main/java/org/apache/maven/archetype/mojos/JarMojo.java  | 9 ++++++++-
 maven-archetype-plugin/src/site/fml/faq.fml                      | 8 ++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/JarMojo.java b/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/JarMojo.java
index 2e72a4e..e651d33 100644
--- a/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/JarMojo.java
+++ b/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/JarMojo.java
@@ -51,6 +51,7 @@ import java.util.Map;
 public class JarMojo
     extends AbstractMojo
 {
+
     /**
      * Directory containing the classes.
      */
@@ -70,6 +71,12 @@ public class JarMojo
     private File outputDirectory;
 
     /**
+     * Exclude some files from the archetype like .gitignore.
+     * */
+    @Parameter( defaultValue = "true" )
+    private boolean useDefaultExcludes;
+
+    /**
      * The Maven project.
      */
     @Parameter( defaultValue = "${project}", readonly = true, required = true )
@@ -139,7 +146,7 @@ public class JarMojo
         {
             DefaultFileSet fs = DefaultFileSet.fileSet( archetypeDirectory ).prefixed( "" )
                 .includeExclude( null,  null ).includeEmptyDirs( true );
-            fs.setUsingDefaultExcludes( false );
+            fs.setUsingDefaultExcludes( useDefaultExcludes );
             archiver.getArchiver().addFileSet( fs );
 
             archiver.createArchive( session, project, archive );
diff --git a/maven-archetype-plugin/src/site/fml/faq.fml b/maven-archetype-plugin/src/site/fml/faq.fml
index 018a407..131beaa 100644
--- a/maven-archetype-plugin/src/site/fml/faq.fml
+++ b/maven-archetype-plugin/src/site/fml/faq.fml
@@ -55,6 +55,14 @@ under the License.
       </answer>
     </faq>
 
+    <faq id="excludes">
+      <question>How do I get files like <code>.gitignore</code> included into my archetype?</question>
+      <answer>
+        <p>First make sure you set <code>addDefaultExcludes</code> to <code>false</code> in the <code>maven-resources-plugin</code>
+        so that the archetype-plugin gets to see these files.</p>
+        <p>Then set <code>useDefaultExcludes</code> to <code>false</code> in the <code>maven-archetype-plugin</code>.</p>
+      </answer>
+    </faq>
   </part>
 
 </faqs>


[maven-archetype] 07/07: Cleanup integration tests

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch ARCHETYPE-606
in repository https://gitbox.apache.org/repos/asf/maven-archetype.git

commit d518207db05132bbbfa6b4429819eeb13c902b53
Author: Peter Lamby <pe...@direkt-gruppe.de>
AuthorDate: Tue Oct 27 15:07:03 2020 +0100

    Cleanup integration tests
---
 .../invoker.properties                              |  2 +-
 .../{setup.bsh => setup.groovy}                     |  0
 .../src/test/resources/projects/basic/verify.groovy | 21 ---------------------
 3 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/invoker.properties b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/invoker.properties
index 963ca6c..e71f103 100644
--- a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/invoker.properties
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/invoker.properties
@@ -15,4 +15,4 @@
 # specific language governing permissions and limitations
 # under the License.
 
-invoker.goals = clean integration-test
+invoker.goals = clean verify
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/setup.bsh b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/setup.groovy
similarity index 100%
rename from maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/setup.bsh
rename to maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/setup.groovy
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/verify.groovy b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/verify.groovy
deleted file mode 100644
index 02d9429..0000000
--- a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/verify.groovy
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-println( 'Yeah Baby, it rocks!' )
-System.out.flush()


[maven-archetype] 04/07: Fix javadoc formatting

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch ARCHETYPE-606
in repository https://gitbox.apache.org/repos/asf/maven-archetype.git

commit 63243f1b102dfdf13a15809ff2751b7cd07f785a
Author: Peter Lamby <pe...@direkt-gruppe.de>
AuthorDate: Mon Oct 12 09:14:50 2020 +0200

    Fix javadoc formatting
---
 .../src/main/java/org/apache/maven/archetype/mojos/JarMojo.java         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/JarMojo.java b/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/JarMojo.java
index e651d33..690731b 100644
--- a/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/JarMojo.java
+++ b/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/JarMojo.java
@@ -72,7 +72,7 @@ public class JarMojo
 
     /**
      * Exclude some files from the archetype like .gitignore.
-     * */
+     */
     @Parameter( defaultValue = "true" )
     private boolean useDefaultExcludes;
 


[maven-archetype] 03/07: Add it for exclude behaviour

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch ARCHETYPE-606
in repository https://gitbox.apache.org/repos/asf/maven-archetype.git

commit 329cc0247c58546caf4015de726383b8d16af8a1
Author: Peter Lamby <pe...@direkt-gruppe.de>
AuthorDate: Fri Oct 9 14:36:51 2020 +0200

    Add it for exclude behaviour
---
 .../archetype.properties                           | 18 ++++++
 .../invoker.properties                             | 18 ++++++
 .../ARCHETYPE-606_include-gitignore/pom.xml        | 75 ++++++++++++++++++++++
 .../META-INF/maven/archetype-metadata.xml          | 34 ++++++++++
 .../main/resources/archetype-resources/.gitignore  |  1 +
 .../src/main/resources/archetype-resources/pom.xml | 50 +++++++++++++++
 .../archetype-resources/src/main/java/App.java     | 36 +++++++++++
 .../resources/projects/archetype.pom.properties    | 21 ++++++
 .../test/resources/projects/archetype.properties   | 21 ++++++
 .../resources/projects/basic/archetype.properties  | 21 ++++++
 .../src/test/resources/projects/basic/goal.txt     |  1 +
 .../resources/projects/basic/reference/.gitignore  |  1 +
 .../resources/projects/basic/reference/pom.xml     | 50 +++++++++++++++
 .../src/main/java/build/archetype/App.java         | 36 +++++++++++
 .../test/resources/projects/basic/verify.groovy    | 21 ++++++
 .../test-settings.xml                              | 55 ++++++++++++++++
 .../ARCHETYPE-606_include-gitignore/verify.bsh     | 46 +++++++++++++
 17 files changed, 505 insertions(+)

diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/archetype.properties b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/archetype.properties
new file mode 100644
index 0000000..74cf9cb
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/archetype.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+excludePatterns=build.log,invoker.properties,verify.groovy
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/invoker.properties b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/invoker.properties
new file mode 100644
index 0000000..963ca6c
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.goals = clean integration-test
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/pom.xml b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/pom.xml
new file mode 100644
index 0000000..82eadc3
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/pom.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<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>org.apache.maven.plugins.archetype.its</groupId>
+  <artifactId>build-archetype-and-run-its</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>maven-archetype</packaging>
+
+  <name>build-archetype-and-run-its</name>
+  <description>packages an archetype then runs IT (archetype:integration-test)</description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.archetype</groupId>
+        <artifactId>archetype-packaging</artifactId>
+        <version>@project.version@</version>
+      </extension>
+    </extensions>
+
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-archetype-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <settingsFile>${basedir}/test-settings.xml</settingsFile>
+            <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+            <ignoreEOLStyle>true</ignoreEOLStyle>
+            <useDefaultExcludes>false</useDefaultExcludes>
+            <properties>
+              <maven.compiler.source>${maven.compiler.source}</maven.compiler.source>
+              <maven.compiler.target>${maven.compiler.target}</maven.compiler.target>
+              <!-- e.g. ensure that Java7 picks up TLSv1.2 when connecting with Central -->
+              <https.protocols>${https.protocols}</https.protocols>
+            </properties>
+          </configuration>
+        </plugin>
+        <plugin>
+          <artifactId>maven-resources-plugin</artifactId>
+          <configuration>
+            <includeEmptyDirs>true</includeEmptyDirs>
+            <addDefaultExcludes>false</addDefaultExcludes>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 0000000..28ff4bf
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
+    name="build-archetype-IT">
+  <fileSets>
+    <fileSet filtered="true" packaged="true" encoding="UTF-8">
+      <directory>src/main/java</directory>
+      <includes>
+        <include>**/*.java</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</archetype-descriptor>
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/archetype-resources/.gitignore b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/archetype-resources/.gitignore
new file mode 100644
index 0000000..403f980
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/archetype-resources/.gitignore
@@ -0,0 +1 @@
+# Dummy
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/archetype-resources/pom.xml b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 0000000..aa77176
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/archetype-resources/pom.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<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>
+## There should be no parent specified, as it should be set automatically
+
+  <groupId>${groupId}</groupId>
+  <artifactId>${artifactId}</artifactId>
+  <version>${version}</version>
+
+  <name>archetype build IT</name>
+
+  <properties>
+    <javaVersion>6</javaVersion>
+    <maven.compiler.source>1.${javaVersion}</maven.compiler.source>
+    <maven.compiler.target>1.${javaVersion}</maven.compiler.target>    
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.7.0</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/archetype-resources/src/main/java/App.java b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/archetype-resources/src/main/java/App.java
new file mode 100644
index 0000000..eb9b6c7
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/main/resources/archetype-resources/src/main/java/App.java
@@ -0,0 +1,36 @@
+package ${package};
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+        System.out.println( "groupId = ${groupId}" );
+        System.out.println( "artifactId = ${artifactId}" );
+        System.out.println( "package = ${package}" );
+        System.out.println( "packageInPathFormat = ${packageInPathFormat}" );
+    }
+}
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/archetype.pom.properties b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/archetype.pom.properties
new file mode 100644
index 0000000..627146f
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/archetype.pom.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# https://github.com/mojohaus/pom-root, creates simple pom with packaging pom
+groupId=org.codehaus.mojo.archetypes
+artifactId=pom-root
+version=1.1
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/archetype.properties b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/archetype.properties
new file mode 100644
index 0000000..75a95e1
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/archetype.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+groupId=com.company 
+artifactId=project
+version=1.0-SNAPSHOT
+package=com.company.project
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/archetype.properties b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/archetype.properties
new file mode 100644
index 0000000..3560bb4
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/archetype.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+version=0.1-SNAPSHOT
+groupId=archetype.it
+artifactId=basic
+package=build.archetype
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/goal.txt b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/goal.txt
new file mode 100644
index 0000000..f8808ba
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/goal.txt
@@ -0,0 +1 @@
+compile
\ No newline at end of file
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/reference/.gitignore b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/reference/.gitignore
new file mode 100644
index 0000000..403f980
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/reference/.gitignore
@@ -0,0 +1 @@
+# Dummy
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/reference/pom.xml b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/reference/pom.xml
new file mode 100644
index 0000000..1039f6a
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/reference/pom.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+--><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>
+  <parent>
+    <artifactId>project</artifactId>
+    <groupId>com.company</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <groupId>archetype.it</groupId>
+  <artifactId>basic</artifactId>
+  <version>0.1-SNAPSHOT</version>
+
+  <name>archetype build IT</name>
+
+  <properties>
+    <javaVersion>6</javaVersion>
+    <maven.compiler.source>1.${javaVersion}</maven.compiler.source>
+    <maven.compiler.target>1.${javaVersion}</maven.compiler.target>    
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.7.0</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/reference/src/main/java/build/archetype/App.java b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/reference/src/main/java/build/archetype/App.java
new file mode 100644
index 0000000..d507638
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/reference/src/main/java/build/archetype/App.java
@@ -0,0 +1,36 @@
+package build.archetype;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+        System.out.println( "groupId = archetype.it" );
+        System.out.println( "artifactId = basic" );
+        System.out.println( "package = build.archetype" );
+        System.out.println( "packageInPathFormat = build/archetype" );
+    }
+}
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/verify.groovy b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/verify.groovy
new file mode 100644
index 0000000..02d9429
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/src/test/resources/projects/basic/verify.groovy
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+println( 'Yeah Baby, it rocks!' )
+System.out.flush()
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/test-settings.xml b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/test-settings.xml
new file mode 100644
index 0000000..ab9e16e
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/test-settings.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<settings>
+  <profiles>
+    <profile>
+      <id>it-repo</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <repositories>
+        <repository>
+          <id>local.central</id>
+          <url>@localRepositoryUrl@</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>local.central</id>
+          <url>@localRepositoryUrl@</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+  </profiles>
+</settings>
\ No newline at end of file
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/verify.bsh b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/verify.bsh
new file mode 100644
index 0000000..2d245ae
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-606_include-gitignore/verify.bsh
@@ -0,0 +1,46 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import org.codehaus.plexus.util.*;
+
+basedir = new File( basedir, "target/test-classes/projects/basic/project/project/basic" );
+if ( !basedir.exists() ) {
+	throw new Exception( basedir + " is missing." );
+}
+
+File main = new File( basedir, "src/main" );
+
+// check <fileset packaged="true">
+File app = new File( main, "java/build/archetype/App.java" );
+if ( !app.isFile() )
+{
+    throw new Exception( app + " file is missing or not a file." );
+}
+
+File buildLog = new File( basedir, "build.log" );
+
+String content = FileUtils.fileRead( buildLog, "UTF-8" );
+
+int idx = content.indexOf( "Yeah Baby, it rocks!" );
+if ( idx < 0 )
+{
+    throw new Exception( "build.log missing System.out.println from verify.groovy" );
+}