diff --git a/jetty-maven-plugin/pom.xml b/jetty-maven-plugin/pom.xml index 41b0ac4e32a..09c9de5480e 100644 --- a/jetty-maven-plugin/pom.xml +++ b/jetty-maven-plugin/pom.xml @@ -129,11 +129,6 @@ maven-artifact-transfer 0.9.1 - - javax.enterprise - cdi-api - 1.2 - org.eclipse.jetty jetty-util diff --git a/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/invoker.properties b/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/invoker.properties new file mode 100644 index 00000000000..e0222d4d54e --- /dev/null +++ b/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/invoker.properties @@ -0,0 +1 @@ +invoker.goals = test \ No newline at end of file diff --git a/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/pom.xml b/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/pom.xml new file mode 100644 index 00000000000..932bac3b7fb --- /dev/null +++ b/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/pom.xml @@ -0,0 +1,105 @@ + + + 4.0.0 + + + org.eclipse.jetty.its + it-parent-pom + 0.0.1-SNAPSHOT + + + jetty-run-mojo-jsp + war + + Jetty :: Simple :: Webapp + + + ${project.build.directory}/jetty-run-mojo-jsp.txt + + + + + org.slf4j + slf4j-simple + + + + org.eclipse.jetty + jetty-servlet + provided + + + + org.eclipse.jetty + jetty-maven-plugin + tests + test-jar + test + + + + org.junit.jupiter + junit-jupiter-engine + test + + + + + + + + + + org.apache.maven.plugins + maven-war-plugin + + false + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + ${jetty.port.file} + Counter accessed 1 times. + /jsp/bean1.jsp + ${project.groupId}:${project.artifactId} + + + org.eclipse.jetty:jetty-maven-plugin + + + + + org.eclipse.jetty + jetty-maven-plugin + + + start-jetty + test-compile + + start + + + + + jetty.port.file + ${jetty.port.file} + + + true + ${basedir}/src/config/jetty.xml + + + + + + + + + diff --git a/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/postbuild.groovy b/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/postbuild.groovy new file mode 100644 index 00000000000..4c4b42e2f2f --- /dev/null +++ b/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/postbuild.groovy @@ -0,0 +1,22 @@ +/* + * 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. + */ +File buildLog = new File( basedir, 'build.log' ) +assert buildLog.text.contains( 'Started Jetty Server' ) +assert buildLog.text.contains( 'Running org.eclipse.jetty.maven.plugin.it.TestGetContent') +assert buildLog.text.contains( 'contentCheck') diff --git a/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/src/config/jetty.xml b/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/src/config/jetty.xml new file mode 100644 index 00000000000..4fb92bbea50 --- /dev/null +++ b/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/src/config/jetty.xml @@ -0,0 +1,40 @@ + + + + + + https + + 32768 + 8192 + 8192 + 4096 + + + + + + + + + + + + + + + + + + + + + + + + 0 + 30000 + + + + diff --git a/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/src/main/java/com/acme/Counter.java b/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/src/main/java/com/acme/Counter.java new file mode 100644 index 00000000000..3c87fc55cfa --- /dev/null +++ b/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/src/main/java/com/acme/Counter.java @@ -0,0 +1,41 @@ +// +// ======================================================================== +// Copyright (c) 1995-2019 Mort Bay Consulting Pty. Ltd. +// ------------------------------------------------------------------------ +// All rights reserved. This program and the accompanying materials +// are made available under the terms of the Eclipse Public License v1.0 +// and Apache License v2.0 which accompanies this distribution. +// +// The Eclipse Public License is available at +// http://www.eclipse.org/legal/epl-v10.html +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// + +package com.acme; + +@SuppressWarnings("serial") +public class Counter implements java.io.Serializable +{ + int counter=0; + String last; + + public int getCount() + { + counter++; + return counter; + } + + public void setLast(String uri) { + last=uri; + } + + public String getLast() { + return last; + } +} + diff --git a/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/src/main/webapp/WEB-INF/web.xml b/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000000..5a6d2867874 --- /dev/null +++ b/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,7 @@ + + + Jetty Simple Webapp run-mojo-jsp + diff --git a/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/src/main/webapp/jsp/bean1.jsp b/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/src/main/webapp/jsp/bean1.jsp new file mode 100644 index 00000000000..02a13d85e56 --- /dev/null +++ b/jetty-maven-plugin/src/it/jetty-run-mojo-jsp/src/main/webapp/jsp/bean1.jsp @@ -0,0 +1,13 @@ + +<%@ page session="true"%> + + + +

JSP1.2 Beans: 1

+ +Counter accessed times.
+Counter last accessed by
+ + + + diff --git a/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/it/TestGetContent.java b/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/it/TestGetContent.java index c3deb8d3bb1..37b2bb1b643 100644 --- a/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/it/TestGetContent.java +++ b/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/it/TestGetContent.java @@ -64,9 +64,15 @@ public class TestGetContent System.out.println( "pingServlet ok" ); } String contentCheck = System.getProperty( "contentCheck" ); + String pathToCheck = System.getProperty( "pathToCheck" ); if(StringUtils.isNotBlank( contentCheck ) ) { - String response = httpClient.GET( "http://localhost:" + port ).getContentAsString(); + String url = "http://localhost:" + port; + if(pathToCheck!=null) + { + url += pathToCheck; + } + String response = httpClient.GET( url ).getContentAsString(); assertTrue(response.contains(contentCheck), "it test " + System.getProperty( "maven.it.name" ) + ", response not contentCheck: " + contentCheck + ", response:" + response); System.out.println( "contentCheck" ); diff --git a/pom.xml b/pom.xml index c26bcf0d602..98577729b01 100644 --- a/pom.xml +++ b/pom.xml @@ -156,7 +156,11 @@ - + + + javax.enterprise:cdi-api + +