You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2019/11/16 14:01:57 UTC
[maven-war-plugin] 01/01: [MWAR-352] web.xml not being replaced by
plugin configuration
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MWAR-352
in repository https://gitbox.apache.org/repos/asf/maven-war-plugin.git
commit ce5d96eecc5bd41015a0401b1cefc8a5ce261bf7
Author: rfscholte <rf...@apache.org>
AuthorDate: Sat Nov 16 15:01:47 2019 +0100
[MWAR-352] web.xml not being replaced by plugin configuration
---
src/it/MWAR-352_custom-webXml/pom.xml | 46 ++++++++++++++++++++++
.../src/main/webapp/WEB-INF/web.xml | 22 +++++++++++
.../src/main/webconfig/release/web.xml | 22 +++++++++++
src/it/MWAR-352_custom-webXml/verify.groovy | 23 +++++++++++
4 files changed, 113 insertions(+)
diff --git a/src/it/MWAR-352_custom-webXml/pom.xml b/src/it/MWAR-352_custom-webXml/pom.xml
new file mode 100644
index 0000000..12905e2
--- /dev/null
+++ b/src/it/MWAR-352_custom-webXml/pom.xml
@@ -0,0 +1,46 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.war.its</groupId>
+ <artifactId>mwar-352</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <webXml>src/main/webconfig/release/web.xml</webXml>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/src/it/MWAR-352_custom-webXml/src/main/webapp/WEB-INF/web.xml b/src/it/MWAR-352_custom-webXml/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..d8f4f21
--- /dev/null
+++ b/src/it/MWAR-352_custom-webXml/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+<web-app>
+ <!-- from src/main/webapp/WEB-INF/web.xml -->
+</web-app>
diff --git a/src/it/MWAR-352_custom-webXml/src/main/webconfig/release/web.xml b/src/it/MWAR-352_custom-webXml/src/main/webconfig/release/web.xml
new file mode 100644
index 0000000..a7b8744
--- /dev/null
+++ b/src/it/MWAR-352_custom-webXml/src/main/webconfig/release/web.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+<web-app>
+ <!-- from src/main/webconfig/release/web.xml -->
+</web-app>
diff --git a/src/it/MWAR-352_custom-webXml/verify.groovy b/src/it/MWAR-352_custom-webXml/verify.groovy
new file mode 100644
index 0000000..753bf84
--- /dev/null
+++ b/src/it/MWAR-352_custom-webXml/verify.groovy
@@ -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.
+ */
+
+def warFile = new java.util.jar.JarFile( new File(basedir,"target/mwar-352-1.0-SNAPSHOT.war"), false)
+def webXml = warFile.getEntry('WEB-INF/web.xml')
+assert webXml != null
+assert warFile.getInputStream( webXml).text.contains('from src/main/webconfig/release/web.xml')