You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2020/06/04 16:35:42 UTC

[maven-war-plugin] 01/04: [MWAR-430] Use MWAR-396_servlet30 as IT for this issue

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

khmarbaise pushed a commit to branch pzygielo-mwar-430
in repository https://gitbox.apache.org/repos/asf/maven-war-plugin.git

commit c5c44a6cade094b74ebfc5ddc616eea9dcbc26fa
Author: Piotrek Żygieło <pz...@users.noreply.github.com>
AuthorDate: Thu Jun 4 18:11:04 2020 +0200

    [MWAR-430] Use MWAR-396_servlet30 as IT for this issue
---
 src/it/MWAR-430_jakarta-servlet/pom.xml    | 66 ++++++++++++++++++++++++++++++
 src/it/MWAR-430_jakarta-servlet/verify.bsh | 49 ++++++++++++++++++++++
 2 files changed, 115 insertions(+)

diff --git a/src/it/MWAR-430_jakarta-servlet/pom.xml b/src/it/MWAR-430_jakarta-servlet/pom.xml
new file mode 100644
index 0000000..8f773b1
--- /dev/null
+++ b/src/it/MWAR-430_jakarta-servlet/pom.xml
@@ -0,0 +1,66 @@
+<?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.its.war</groupId>
+  <artifactId>maven-it-mwar-430</artifactId>
+  <version>1.0</version>
+  <packaging>war</packaging>
+
+  <name>Maven Integration Test :: MWAR-430</name> 
+  <description>Test that no web.xml is required when project depends on Jakarta Servlet 5.0 or newer</description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>jakarta.servlet</groupId>
+      <artifactId>jakarta.servlet-api</artifactId>
+      <version>5.0.0-M1</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.0.3</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.2</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <version>@project.version@</version>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/MWAR-430_jakarta-servlet/verify.bsh b/src/it/MWAR-430_jakarta-servlet/verify.bsh
new file mode 100644
index 0000000..3c7e8b5
--- /dev/null
+++ b/src/it/MWAR-430_jakarta-servlet/verify.bsh
@@ -0,0 +1,49 @@
+/*
+ * 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 java.util.*;
+import java.util.jar.*;
+import java.util.regex.*;
+
+try
+{
+    File explodedDir = new File( basedir, "target/maven-it-mwar-430-1.0" );
+    System.out.println( "Checking for existence of exploded directory " + explodedDir );
+    if ( !explodedDir.exists() )
+    {
+        System.out.println( "FAILURE! The directory " + explodedDir + " does not exist." );
+        return false;
+    }
+    
+    File webInfFile = new File( explodedDir, "WEB-INF/web.xml" );
+    if ( webInfFile.exists() )
+    {
+        System.err.println( "FAILURE! The file web.xml should not be present." );
+        return false;
+    }
+
+}
+catch( Throwable t )
+{
+    t.printStackTrace();
+    return false;
+}
+
+return true;