maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject [2/5] maven-archetype git commit: [ARCHETYPE-522] Introduce MRM for archetype-maven-plugin ITs
Date Tue, 28 Feb 2017 21:29:47 GMT
http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/src/test/resources/projects/basic/verify.groovy
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/src/test/resources/projects/basic/verify.groovy b/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/src/test/resources/projects/basic/verify.groovy
new file mode 100644
index 0000000..cd3ba2b
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/src/test/resources/projects/basic/verify.groovy
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+ 
+System.out.println(" Yeah Baby it rocks!")
+System.out.println("basedir:"+basedir)
+assert new File(basedir,"reference/src/main/resources/empty-directory").exists();
+assert new File(basedir,"reference/src/main/resources/empty-directory").isDirectory();
+assert new File(basedir,"project/basic/src/main/resources/empty-directory").exists();
+assert new File(basedir,"project/basic/src/main/resources/empty-directory").isDirectory();

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/test-settings.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/test-settings.xml b/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/test-settings.xml
new file mode 100644
index 0000000..ab9e16e
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/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

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/verify.bsh
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/verify.bsh b/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/verify.bsh
new file mode 100644
index 0000000..f6d2460
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/verify.bsh
@@ -0,0 +1,75 @@
+
+/*
+ * 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/basic" );
+
+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." );
+}
+
+// check __propertyName__ path replacement
+File artifactId = new File( main, "resources/test-basic.properties" );
+if ( !artifactId.isFile() )
+{
+    throw new Exception( artifactId + " file is missing or not a file." );
+}
+
+File packageInPathFormat = new File( main, "resources/build/archetype/build.archetype.properties" );
+if ( !packageInPathFormat.isFile() )
+{
+    throw new Exception( packageInPathFormat + " file is missing or not a file." );
+}
+
+// ARCHETYPE-289 check empty directory creation
+File empty = new File( main, "resources/empty-directory" );
+if ( !empty.isDirectory() )
+{
+    throw new Exception( empty + " directory is missing or not a directory." );
+}
+File filteredEmpty = new File( main, "resources/basic-empty-directory" );
+if ( !filteredEmpty.isDirectory() )
+{
+    throw new Exception( filteredEmpty + " directory is missing or not a directory." );
+}
+
+// ARCHETYPE-334 check generated project has been compiled
+File appClass = new File( basedir, "target/classes/build/archetype/App.class" );
+if ( !appClass.isFile() )
+{
+    throw new Exception( appClass + " not here: generated project not compiled?" );
+}
+
+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 out.println from verify.groovy" );
+}

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/invoker.properties
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/invoker.properties b/maven-archetype-plugin/src/it/projects/build-archetype/invoker.properties
new file mode 100644
index 0000000..963ca6c
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/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

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/pom.xml b/maven-archetype-plugin/src/it/projects/build-archetype/pom.xml
new file mode 100644
index 0000000..b24c297
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/pom.xml
@@ -0,0 +1,64 @@
+<?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</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>maven-archetype</packaging>
+
+  <name>build-archetype</name>
+  <description>packages an archetype then runs IT (archetype:integration-test)</description>
+
+  <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>${basedir}/target/local-repo</localRepositoryPath>
+            <ignoreEOLStyle>true</ignoreEOLStyle>
+          </configuration>
+
+        </plugin>
+        <plugin>
+          <artifactId>maven-resources-plugin</artifactId>
+          <configuration>
+            <includeEmptyDirs>true</includeEmptyDirs>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/setup.bsh
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/setup.bsh b/maven-archetype-plugin/src/it/projects/build-archetype/setup.bsh
new file mode 100644
index 0000000..4a20d75
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/setup.bsh
@@ -0,0 +1,28 @@
+
+/*
+ * 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.
+ */
+
+resources = new File( basedir, "src/main/resources/archetype-resources/src/main/resources" );
+reference = new File( basedir, "src/test/resources/projects/basic/reference/src/main/resources" );
+
+// empty directories not supported by git: create them when preparing the IT
+new File( resources, "empty-directory" ).mkdir();
+new File( reference, "empty-directory" ).mkdir();
+new File( resources, "__artifactId__-empty-directory" ).mkdir();
+new File( reference, "basic-empty-directory" ).mkdir();

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 0000000..c363e21
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,60 @@
+<?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">
+  <requiredProperties>
+    <requiredProperty key="requiredPropertyWithoutDefaultValue"/>
+    <requiredProperty key="requiredPropertyWithDefaultValue">
+      <defaultValue>this property has a default value defined in the archetype descriptor</defaultValue>
+    </requiredProperty>
+  </requiredProperties>
+
+  <fileSets>
+    <fileSet filtered="true" packaged="true" encoding="UTF-8">
+      <directory>src/main/java</directory>
+      <includes>
+        <include>**/*.java</include>
+      </includes>
+    </fileSet>
+    <fileSet filtered="true" packaged="false" encoding="UTF-8">
+      <directory>src/main/resources</directory>
+      <includes>
+        <include>**/*.properties</include>
+        <include>**/__*/</include>
+      </includes>
+    </fileSet>
+    <fileSet filtered="false" packaged="false" encoding="UTF-8">
+      <directory>src/main/resources</directory>
+      <includes>
+        <include>**</include>
+      </includes>
+    </fileSet>
+    <fileSet filtered="false" packaged="true" encoding="UTF-8">
+      <directory>src/site</directory>
+      <includes>
+        <include>**</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</archetype-descriptor>

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/pom.xml b/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 0000000..6c23175
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/pom.xml
@@ -0,0 +1,31 @@
+<?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>${groupId}</groupId>
+  <artifactId>${artifactId}</artifactId>
+  <version>${version}</version>
+
+  <name>archetype build IT</name>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/main/java/App.java
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/main/java/App.java b/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/main/java/App.java
new file mode 100644
index 0000000..0e020bd
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/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}" );
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/main/resources/__packageInPathFormat__/__package__.properties
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/main/resources/__packageInPathFormat__/__package__.properties b/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/main/resources/__packageInPathFormat__/__package__.properties
new file mode 100644
index 0000000..cf96eed
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/main/resources/__packageInPathFormat__/__package__.properties
@@ -0,0 +1,20 @@
+# 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.
+
+# test file path __propertyName__ replacement with its value
+# __packageInPathFormat__ in file directory was replaced with "${packageInPathFormat}"
+# __package__ in filename was replaced with "${package}"

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/main/resources/test-__artifactId__.properties
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/main/resources/test-__artifactId__.properties b/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/main/resources/test-__artifactId__.properties
new file mode 100644
index 0000000..100ffba
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/main/resources/test-__artifactId__.properties
@@ -0,0 +1,27 @@
+# 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.
+
+# test file path __propertyName__ replacement with its value
+# __artifactId__ in filename was replaced with "${artifactId}"
+
+rootArtifactId = ${rootArtifactId}
+
+requiredPropertyWithoutDefaultValue = ${requiredPropertyWithoutDefaultValue}
+
+requiredPropertyWithDefaultValue = ${requiredPropertyWithDefaultValue}
+
+nonRequiredProperty = ${nonRequiredProperty}

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/site/apt/__artifactId__.apt
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/site/apt/__artifactId__.apt b/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/site/apt/__artifactId__.apt
new file mode 100644
index 0000000..aaa6104
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/src/main/resources/archetype-resources/src/site/apt/__artifactId__.apt
@@ -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.
+
+test:
+- non-filtered: ${artifactId} stays intact (not replaced by Velocity)
+- packaged: package directory will be added
+- __artifactId__ is replaced (even if non-filtered)

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/archetype.properties b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/archetype.properties
new file mode 100644
index 0000000..01013f2
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/archetype.properties
@@ -0,0 +1,27 @@
+# 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
+
+requiredPropertyWithoutDefaultValue=a value defined in archetype.properties
+
+requiredPropertyWithDefaultValue=not the default value, but a value defined in archetype.properties
+
+nonRequiredProperty=a property that is not defined as requiredProperty in the archetype descriptor
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/goal.txt
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/goal.txt b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/goal.txt
new file mode 100644
index 0000000..f8808ba
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/goal.txt
@@ -0,0 +1 @@
+compile
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/pom.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/pom.xml b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/pom.xml
new file mode 100644
index 0000000..ed5ad61
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/pom.xml
@@ -0,0 +1,31 @@
+<?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>archetype.it</groupId>
+  <artifactId>basic</artifactId>
+  <version>0.1-SNAPSHOT</version>
+
+  <name>archetype build IT</name>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/main/java/build/archetype/App.java
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/main/java/build/archetype/App.java b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/main/java/build/archetype/App.java
new file mode 100644
index 0000000..3119279
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/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" );
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/main/resources/build/archetype/build.archetype.properties
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/main/resources/build/archetype/build.archetype.properties b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/main/resources/build/archetype/build.archetype.properties
new file mode 100644
index 0000000..f996e64
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/main/resources/build/archetype/build.archetype.properties
@@ -0,0 +1,20 @@
+# 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.
+
+# test file path __propertyName__ replacement with its value
+# __packageInPathFormat__ in file directory was replaced with "build/archetype"
+# __package__ in filename was replaced with "build.archetype"

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/main/resources/test-basic.properties
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/main/resources/test-basic.properties b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/main/resources/test-basic.properties
new file mode 100644
index 0000000..bc7e8cd
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/main/resources/test-basic.properties
@@ -0,0 +1,27 @@
+# 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.
+
+# test file path __propertyName__ replacement with its value
+# __artifactId__ in filename was replaced with "basic"
+
+rootArtifactId = basic
+
+requiredPropertyWithoutDefaultValue = a value defined in archetype.properties
+
+requiredPropertyWithDefaultValue = not the default value, but a value defined in archetype.properties
+
+nonRequiredProperty = a property that is not defined as requiredProperty in the archetype descriptor

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/site/build/archetype/apt/basic.apt
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/site/build/archetype/apt/basic.apt b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/site/build/archetype/apt/basic.apt
new file mode 100644
index 0000000..aaa6104
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/reference/src/site/build/archetype/apt/basic.apt
@@ -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.
+
+test:
+- non-filtered: ${artifactId} stays intact (not replaced by Velocity)
+- packaged: package directory will be added
+- __artifactId__ is replaced (even if non-filtered)

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/verify.groovy
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/verify.groovy b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/verify.groovy
new file mode 100644
index 0000000..cd3ba2b
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/src/test/resources/projects/basic/verify.groovy
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+ 
+System.out.println(" Yeah Baby it rocks!")
+System.out.println("basedir:"+basedir)
+assert new File(basedir,"reference/src/main/resources/empty-directory").exists();
+assert new File(basedir,"reference/src/main/resources/empty-directory").isDirectory();
+assert new File(basedir,"project/basic/src/main/resources/empty-directory").exists();
+assert new File(basedir,"project/basic/src/main/resources/empty-directory").isDirectory();

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/test-settings.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/test-settings.xml b/maven-archetype-plugin/src/it/projects/build-archetype/test-settings.xml
new file mode 100644
index 0000000..ab9e16e
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/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

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/build-archetype/verify.bsh
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/verify.bsh b/maven-archetype-plugin/src/it/projects/build-archetype/verify.bsh
new file mode 100644
index 0000000..f6d2460
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/verify.bsh
@@ -0,0 +1,75 @@
+
+/*
+ * 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/basic" );
+
+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." );
+}
+
+// check __propertyName__ path replacement
+File artifactId = new File( main, "resources/test-basic.properties" );
+if ( !artifactId.isFile() )
+{
+    throw new Exception( artifactId + " file is missing or not a file." );
+}
+
+File packageInPathFormat = new File( main, "resources/build/archetype/build.archetype.properties" );
+if ( !packageInPathFormat.isFile() )
+{
+    throw new Exception( packageInPathFormat + " file is missing or not a file." );
+}
+
+// ARCHETYPE-289 check empty directory creation
+File empty = new File( main, "resources/empty-directory" );
+if ( !empty.isDirectory() )
+{
+    throw new Exception( empty + " directory is missing or not a directory." );
+}
+File filteredEmpty = new File( main, "resources/basic-empty-directory" );
+if ( !filteredEmpty.isDirectory() )
+{
+    throw new Exception( filteredEmpty + " directory is missing or not a directory." );
+}
+
+// ARCHETYPE-334 check generated project has been compiled
+File appClass = new File( basedir, "target/classes/build/archetype/App.class" );
+if ( !appClass.isFile() )
+{
+    throw new Exception( appClass + " not here: generated project not compiled?" );
+}
+
+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 out.println from verify.groovy" );
+}

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/archetype.properties
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/archetype.properties b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/archetype.properties
new file mode 100644
index 0000000..0d3bce8
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/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=**/toexclude/**
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/invoker.properties
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/invoker.properties b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/invoker.properties
new file mode 100644
index 0000000..27ec90f
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/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 org.apache.maven.plugins:maven-archetype-plugin:${project.version}:create-from-project -Darchetype.properties=archetype.properties

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/pom.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/pom.xml b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/pom.xml
new file mode 100644
index 0000000..7a173a0
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/pom.xml
@@ -0,0 +1,30 @@
+<!--
+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>create-from-project</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>archetype:create-from-project It</name>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/file.txt
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/file.txt b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/file.txt
new file mode 100644
index 0000000..238820c
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/file.txt
@@ -0,0 +1,16 @@
+~~ 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.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/file.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/file.xml b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/file.xml
new file mode 100644
index 0000000..f133f0e
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/file.xml
@@ -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.
+-->
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/toexclude/file.txt
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/toexclude/file.txt b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/toexclude/file.txt
new file mode 100644
index 0000000..238820c
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/toexclude/file.txt
@@ -0,0 +1,16 @@
+~~ 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.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/toexclude/file.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/toexclude/file.xml b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/toexclude/file.xml
new file mode 100644
index 0000000..f133f0e
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/resources/toexclude/file.xml
@@ -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.
+-->
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/toexclude/file.txt
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/toexclude/file.txt b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/toexclude/file.txt
new file mode 100644
index 0000000..238820c
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/toexclude/file.txt
@@ -0,0 +1,16 @@
+~~ 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.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/toexclude/file.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/toexclude/file.xml b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/toexclude/file.xml
new file mode 100644
index 0000000..f133f0e
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/main/toexclude/file.xml
@@ -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.
+-->
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/toexclude/file.txt
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/toexclude/file.txt b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/toexclude/file.txt
new file mode 100644
index 0000000..238820c
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/toexclude/file.txt
@@ -0,0 +1,16 @@
+~~ 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.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/toexclude/file.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/toexclude/file.xml b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/toexclude/file.xml
new file mode 100644
index 0000000..f133f0e
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/src/toexclude/file.xml
@@ -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.
+-->
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/toexclude/file.txt
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/toexclude/file.txt b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/toexclude/file.txt
new file mode 100644
index 0000000..238820c
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/toexclude/file.txt
@@ -0,0 +1,16 @@
+~~ 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.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/toexclude/file.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/toexclude/file.xml b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/toexclude/file.xml
new file mode 100644
index 0000000..f133f0e
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/toexclude/file.xml
@@ -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.
+-->
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/verify.bsh
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/verify.bsh b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/verify.bsh
new file mode 100644
index 0000000..1021842
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project-exclude-patterns/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.*;
+
+File archetype = new File( basedir, "target/generated-sources/archetype/src/main/resources/archetype-resources/" );
+
+// ARCHETYPE-513
+String[] excluded = new String[] { "/", "src/", "src/main/", "src/main/resources/" };
+for ( String exclude : excluded )
+{
+    File app = new File( archetype, exclude + "toexclude" );
+    if ( app.exists() )
+    {
+        throw new Exception( app + " folder exists when it should have been excluded." );
+    }
+}
+
+String[] included = new String[] { "file.txt", "file.xml" };
+for ( String include : included )
+{
+    File app = new File( archetype, "src/main/resources/" + include );
+    if ( !app.isFile() )
+    {
+        throw new Exception( app + " file does not exist when it should have been included." );
+    }
+}
+
+return true;

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project/archetype.properties
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project/archetype.properties b/maven-archetype-plugin/src/it/projects/create-from-project/archetype.properties
new file mode 100644
index 0000000..8fb65f9
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project/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.
+
+AppName App
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project/invoker.properties
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project/invoker.properties b/maven-archetype-plugin/src/it/projects/create-from-project/invoker.properties
new file mode 100644
index 0000000..27ec90f
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project/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 org.apache.maven.plugins:maven-archetype-plugin:${project.version}:create-from-project -Darchetype.properties=archetype.properties

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project/pom.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project/pom.xml b/maven-archetype-plugin/src/it/projects/create-from-project/pom.xml
new file mode 100644
index 0000000..7a173a0
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project/pom.xml
@@ -0,0 +1,30 @@
+<!--
+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>create-from-project</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>archetype:create-from-project It</name>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project/src/main/java/foo/bar/App.java
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project/src/main/java/foo/bar/App.java b/maven-archetype-plugin/src/it/projects/create-from-project/src/main/java/foo/bar/App.java
new file mode 100644
index 0000000..5d59afd
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project/src/main/java/foo/bar/App.java
@@ -0,0 +1,32 @@
+package foo.bar;
+
+/*
+ * 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!
+ * package foo.bar from foo/bar directory
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/create-from-project/verify.bsh
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/create-from-project/verify.bsh b/maven-archetype-plugin/src/it/projects/create-from-project/verify.bsh
new file mode 100644
index 0000000..84a5f1e
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/create-from-project/verify.bsh
@@ -0,0 +1,38 @@
+
+/*
+ * 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.*;
+
+File archetype = new File( basedir, "target/generated-sources/archetype" );
+
+File pom = new File( archetype, "pom.xml" );
+if ( !pom.isFile() )
+{
+    throw new Exception( pom + " file is missing or not a file." );
+}
+
+// ARCHETYPE-462 filter file name with archetype.properties properties
+File app = new File( archetype, "src/main/resources/archetype-resources/src/main/java/__AppName__.java" );
+if ( !app.isFile() )
+{
+    throw new Exception( app + " file is missing or not a file." );
+}
+
+return true;

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/generate-basic/invoker.properties
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/generate-basic/invoker.properties b/maven-archetype-plugin/src/it/projects/generate-basic/invoker.properties
new file mode 100644
index 0000000..2637cc8
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/generate-basic/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 = org.apache.maven.plugins:maven-archetype-plugin:${project.version}:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.1 -DgroupId=com.company -DartifactId=project -Dversion=1.0-SNAPSHOT -Dpackage=com.company.project

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/generate-basic/verify.bsh
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/generate-basic/verify.bsh b/maven-archetype-plugin/src/it/projects/generate-basic/verify.bsh
new file mode 100644
index 0000000..91c5425
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/generate-basic/verify.bsh
@@ -0,0 +1,29 @@
+
+/*
+ * 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.*;
+
+File pom = new File( basedir, "project/pom.xml" );
+if ( !pom.isFile() )
+{
+    throw new Exception( "No project created from archetype." );
+}
+
+return true;

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/property-setting-cli/invoker.properties
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/property-setting-cli/invoker.properties b/maven-archetype-plugin/src/it/projects/property-setting-cli/invoker.properties
new file mode 100644
index 0000000..a8853a6
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/property-setting-cli/invoker.properties
@@ -0,0 +1,17 @@
+# 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

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/property-setting-cli/pom.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/property-setting-cli/pom.xml b/maven-archetype-plugin/src/it/projects/property-setting-cli/pom.xml
new file mode 100644
index 0000000..42fec0c
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/property-setting-cli/pom.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.
+-->
+
+<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>property-setting-cli</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>maven-archetype</packaging>
+
+  <name>property-setting-cli</name>
+  <description>ARCHETYPE-349: checks that a CLI property overrides a required property default, even when the default value contains a property reference</description>
+
+  <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>
+            <ignoreEOLStyle>true</ignoreEOLStyle>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/property-setting-cli/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/property-setting-cli/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven-archetype-plugin/src/it/projects/property-setting-cli/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 0000000..a1170a4
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/property-setting-cli/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,30 @@
+<?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="archetype1">
+  <requiredProperties>
+    <requiredProperty key="foo">
+      <defaultValue>${some.name}</defaultValue>
+    </requiredProperty>
+  </requiredProperties>
+</archetype-descriptor>

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/property-setting-cli/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/property-setting-cli/src/main/resources/archetype-resources/pom.xml b/maven-archetype-plugin/src/it/projects/property-setting-cli/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 0000000..423aade
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/property-setting-cli/src/main/resources/archetype-resources/pom.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.
+-->
+
+<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>${groupId}</groupId>
+  <artifactId>${artifactId}</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <properties>
+    <foo>${foo}</foo><!-- foo is an archetypes' required property -->
+  </properties>
+</project>
+

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/property-setting-cli/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/property-setting-cli/src/test/resources/projects/basic/archetype.properties b/maven-archetype-plugin/src/it/projects/property-setting-cli/src/test/resources/projects/basic/archetype.properties
new file mode 100644
index 0000000..c4298cb
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/property-setting-cli/src/test/resources/projects/basic/archetype.properties
@@ -0,0 +1,23 @@
+~~ 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
+# should override default archetype value (even if it contains an inner property ${...}: ARCHETYPE-349
+foo=bar
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/2ac48e1c/maven-archetype-plugin/src/it/projects/property-setting-cli/src/test/resources/projects/basic/goal.txt
----------------------------------------------------------------------
diff --git a/maven-archetype-plugin/src/it/projects/property-setting-cli/src/test/resources/projects/basic/goal.txt b/maven-archetype-plugin/src/it/projects/property-setting-cli/src/test/resources/projects/basic/goal.txt
new file mode 100644
index 0000000..e69de29


Mime
View raw message