You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2019/01/19 07:55:28 UTC

[maven-archetype] branch master updated: ARCHETYPE-536 Update Groovy dependency and enable Groovy Grape in archetype-post-generate.groovy script (by including Ivy dependency)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 11cb603  ARCHETYPE-536 Update Groovy dependency and enable Groovy Grape in archetype-post-generate.groovy script (by including Ivy dependency)
11cb603 is described below

commit 11cb603da9d3da813c0a34a9e2532cc2c85f940b
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Sat Jan 19 00:35:31 2019 +0100

    ARCHETYPE-536 Update Groovy dependency and enable Groovy Grape in archetype-post-generate.groovy script (by including Ivy dependency)
---
 archetype-common/pom.xml                           | 15 ++++++-
 .../ARCHETYPE-536_groovy-grape/archetype/pom.xml   | 45 +++++++++++++++++++
 .../META-INF/archetype-post-generate.groovy        | 30 +++++++++++++
 .../META-INF/maven/archetype-metadata.xml          | 31 ++++++++++++++
 .../src/main/resources/archetype-resources/pom.xml | 31 ++++++++++++++
 .../ARCHETYPE-536_groovy-grape/invoker.properties  | 23 ++++++++++
 .../it/projects/ARCHETYPE-536_groovy-grape/pom.xml | 50 ++++++++++++++++++++++
 .../ARCHETYPE-536_groovy-grape/project.properties  | 27 ++++++++++++
 .../ARCHETYPE-536_groovy-grape/verify.groovy       | 25 +++++++++++
 9 files changed, 276 insertions(+), 1 deletion(-)

diff --git a/archetype-common/pom.xml b/archetype-common/pom.xml
index 163676b..078024e 100644
--- a/archetype-common/pom.xml
+++ b/archetype-common/pom.xml
@@ -53,7 +53,20 @@
     <dependency>
       <groupId>org.codehaus.groovy</groupId>
       <artifactId>groovy</artifactId>
-      <version>1.8.3</version>
+      <version>2.4.16</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.ivy</groupId>
+      <artifactId>ivy</artifactId>
+      <version>2.4.0</version>
+      <scope>runtime</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>*</groupId>
+          <artifactId>*</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>net.sourceforge.jchardet</groupId>
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/archetype/pom.xml b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/archetype/pom.xml
new file mode 100644
index 0000000..33497a6
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/archetype/pom.xml
@@ -0,0 +1,45 @@
+<!--
+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>
+    <groupId>org.apache.maven.plugins.archetype.its</groupId>
+    <artifactId>archetype536-parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>archetype536-archetype</artifactId>
+  <packaging>maven-archetype</packaging>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-archetype-plugin</artifactId>
+        <configuration>
+          <archetypeDirectory>src/main/resources</archetypeDirectory>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/archetype/src/main/resources/META-INF/archetype-post-generate.groovy b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/archetype/src/main/resources/META-INF/archetype-post-generate.groovy
new file mode 100644
index 0000000..138dcc4
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/archetype/src/main/resources/META-INF/archetype-post-generate.groovy
@@ -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.
+ */
+
+def rootDir = new File(request.getOutputDirectory() + "/" + request.getArtifactId())
+def textFile = new File(rootDir, "test.txt")
+
+// use commons-code as example to include an external library
+@Grab(group='commons-codec', module='commons-codec', version='1.11')
+def test = "Test Text"
+def textHexString = org.apache.commons.codec.binary.Hex.encodeHexString(test.getBytes("UTF-8"))
+
+textFile.newWriter("UTF-8").withWriter { w ->
+  w << textHexString
+}
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 0000000..b7b97a4
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/archetype/src/main/resources/META-INF/maven/archetype-metadata.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.
+-->
+
+<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="ARCHETYPE-536">
+
+  <requiredProperties>
+    <requiredProperty key="projectName"/>
+  </requiredProperties>
+
+</archetype-descriptor>
\ No newline at end of file
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/archetype/src/main/resources/archetype-resources/pom.xml b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/archetype/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 0000000..4f81a0f
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/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>
+  <packaging>pom</packaging>
+  
+</project>
\ No newline at end of file
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/invoker.properties b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/invoker.properties
new file mode 100644
index 0000000..aaa45c6
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/invoker.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.
+
+invoker.goals.1 = install
+invoker.project.1 = archetype
+
+invoker.goals.2 = org.apache.maven.plugins:maven-archetype-plugin:${project.version}:generate
+invoker.systemPropertiesFile = project.properties
+
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/pom.xml b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/pom.xml
new file mode 100644
index 0000000..118b2dd
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/pom.xml
@@ -0,0 +1,50 @@
+<!--
+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>archetype536-parent</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  
+  <build>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.archetype</groupId>
+        <artifactId>archetype-packaging</artifactId>
+        <version>@project.version@</version>
+      </extension>
+    </extensions>
+    
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-archetype-plugin</artifactId>
+          <version>@project.version@</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/project.properties b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/project.properties
new file mode 100644
index 0000000..64404f5
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/project.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.
+
+archetypeGroupId=org.apache.maven.plugins.archetype.its
+archetypeArtifactId=archetype536-archetype
+archetypeVersion=1.0-SNAPSHOT
+
+groupId=com.company
+artifactId=myArtifactId
+version=1.0-SNAPSHOT
+package=com.company.project
+
+projectName=myName
diff --git a/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/verify.groovy b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/verify.groovy
new file mode 100644
index 0000000..6473181
--- /dev/null
+++ b/maven-archetype-plugin/src/it/projects/ARCHETYPE-536_groovy-grape/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.
+ */
+
+def textFile = new File(basedir, "myArtifactId/test.txt")
+
+assert textFile.exists()
+
+def hexString = textFile.getText("UTF-8")
+assert hexString == "546573742054657874"