6
0
Files
maven-archetype/0001-Avoid-reliance-on-groovy.patch

111 lines
4.3 KiB
Diff

From a2bb8e7fe0d80943ab561343b0ab14de08f84b1b Mon Sep 17 00:00:00 2001
From: Mat Booth <mat.booth@redhat.com>
Date: Thu, 9 Jul 2020 17:13:18 +0100
Subject: [PATCH 1/2] Avoid reliance on groovy
---
archetype-common/pom.xml | 26 -------------------
.../DefaultFilesetArchetypeGenerator.java | 23 ++--------------
pom.xml | 7 -----
3 files changed, 2 insertions(+), 54 deletions(-)
diff --git a/archetype-common/pom.xml b/archetype-common/pom.xml
index 4a726102..b4406e1e 100644
--- a/archetype-common/pom.xml
+++ b/archetype-common/pom.xml
@@ -47,32 +47,6 @@
<groupId>org.apache.maven.archetype</groupId>
<artifactId>archetype-descriptor</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.groovy</groupId>
- <artifactId>groovy</artifactId>
- </dependency>
- <!-- additional groovy modules -->
- <dependency>
- <groupId>org.apache.groovy</groupId>
- <artifactId>groovy-json</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.groovy</groupId>
- <artifactId>groovy-templates</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.groovy</groupId>
- <artifactId>groovy-xml</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.groovy</groupId>
- <artifactId>groovy-yaml</artifactId>
- <scope>runtime</scope>
- </dependency>
- <!-- /additional groovy modules -->
<dependency>
<groupId>org.apache.ivy</groupId>
<artifactId>ivy</artifactId>
diff --git a/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java b/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java
index 1e613531..edb40cf2 100644
--- a/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java
+++ b/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java
@@ -42,8 +42,6 @@ import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
-import groovy.lang.Binding;
-import groovy.lang.GroovyShell;
import org.apache.maven.archetype.ArchetypeGenerationRequest;
import org.apache.maven.archetype.common.ArchetypeArtifactManager;
import org.apache.maven.archetype.common.ArchetypeFilesResolver;
@@ -226,25 +224,8 @@ public class DefaultFilesetArchetypeGenerator implements FilesetArchetypeGenerat
String postGenerationScript = archetypeArtifactManager.getPostGenerationScript(archetypeFile);
if (postGenerationScript != null) {
- LOGGER.info("Executing " + Constants.ARCHETYPE_POST_GENERATION_SCRIPT + " post-generation script");
-
- Binding binding = new Binding();
-
- final Properties archetypeGeneratorProperties = new Properties();
- archetypeGeneratorProperties.putAll(System.getProperties());
-
- if (request.getProperties() != null) {
- archetypeGeneratorProperties.putAll(request.getProperties());
- }
-
- for (Map.Entry<Object, Object> entry : archetypeGeneratorProperties.entrySet()) {
- binding.setVariable(entry.getKey().toString(), entry.getValue());
- }
-
- binding.setVariable("request", request);
-
- GroovyShell shell = new GroovyShell(binding);
- shell.evaluate(postGenerationScript);
+ LOGGER.info("Skipping " + Constants.ARCHETYPE_POST_GENERATION_SCRIPT
+ + " post-generation script");
}
// ----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 3196edd2..e6d41c00 100644
--- a/pom.xml
+++ b/pom.xml
@@ -83,13 +83,6 @@
<dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.apache.groovy</groupId>
- <artifactId>groovy-bom</artifactId>
- <version>4.0.26</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
--
2.49.0