From e84b84e09c990bea9438a5cfbc89e1e2e2ccd0e4 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 19 Jul 2022 11:46:20 -0500 Subject: [PATCH] Have jetty-ee#-maven-plugin manage the deployer environment as well --- .../org/eclipse/jetty/ee10/maven/plugin/JettyHomeForker.java | 4 +++- .../org/eclipse/jetty/ee9/maven/plugin/JettyHomeForker.java | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/jetty-ee10/jetty-ee10-maven-plugin/src/main/java/org/eclipse/jetty/ee10/maven/plugin/JettyHomeForker.java b/jetty-ee10/jetty-ee10-maven-plugin/src/main/java/org/eclipse/jetty/ee10/maven/plugin/JettyHomeForker.java index cda36d4342d..1dda799b333 100644 --- a/jetty-ee10/jetty-ee10-maven-plugin/src/main/java/org/eclipse/jetty/ee10/maven/plugin/JettyHomeForker.java +++ b/jetty-ee10/jetty-ee10-maven-plugin/src/main/java/org/eclipse/jetty/ee10/maven/plugin/JettyHomeForker.java @@ -363,13 +363,15 @@ public class JettyHomeForker extends AbstractForker IO.copy(jarStream, fileStream); } - //copy in the maven.xml webapp file + // copy in the maven.xml webapp file try (InputStream mavenXmlStream = getClass().getClassLoader().getResourceAsStream("maven-ee10.xml"); FileOutputStream fileStream = new FileOutputStream(webappPath.resolve("maven-ee10.xml").toFile())) { IO.copy(mavenXmlStream, fileStream); } + Files.writeString(webappPath.resolve("maven-ee10.properties"), "environment=ee10"); + //copy in the maven.mod file try (InputStream mavenModStream = getClass().getClassLoader().getResourceAsStream("ee10-maven.mod"); FileOutputStream fileStream = new FileOutputStream(modulesPath.resolve("ee10-maven.mod").toFile())) diff --git a/jetty-ee9/jetty-ee9-maven-plugin/src/main/java/org/eclipse/jetty/ee9/maven/plugin/JettyHomeForker.java b/jetty-ee9/jetty-ee9-maven-plugin/src/main/java/org/eclipse/jetty/ee9/maven/plugin/JettyHomeForker.java index 919f4cb9a6a..32112e6d70d 100644 --- a/jetty-ee9/jetty-ee9-maven-plugin/src/main/java/org/eclipse/jetty/ee9/maven/plugin/JettyHomeForker.java +++ b/jetty-ee9/jetty-ee9-maven-plugin/src/main/java/org/eclipse/jetty/ee9/maven/plugin/JettyHomeForker.java @@ -370,6 +370,8 @@ public class JettyHomeForker extends AbstractForker IO.copy(mavenXmlStream, fileStream); } + Files.writeString(webappPath.resolve("maven-ee9.properties"), "environment=ee9"); + //copy in the maven.mod file try (InputStream mavenModStream = getClass().getClassLoader().getResourceAsStream("ee9-maven.mod"); FileOutputStream fileStream = new FileOutputStream(modulesPath.resolve("ee9-maven.mod").toFile()))