Author: struberg
Date: Fri Apr 26 20:15:55 2019
New Revision: 1858225
URL: http://svn.apache.org/viewvc?rev=1858225&view=rev
Log:
OWB-1285 adding a jetty9 plugin
Thanks to Stephen Connolly (stephenc) for this module!
Added:
openwebbeans/trunk/webbeans-jetty9/ (with props)
openwebbeans/trunk/webbeans-jetty9/README.asciidoc
openwebbeans/trunk/webbeans-jetty9/pom.xml (with props)
openwebbeans/trunk/webbeans-jetty9/src/
openwebbeans/trunk/webbeans-jetty9/src/it/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/pom.xml (with props)
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
(with props)
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
(with props)
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/beans.xml
(with props)
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/jetty-web.xml
(with props)
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/web.xml
(with props)
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/web/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/web/jetty9/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/web/jetty9/test/
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
(with props)
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/pom.xml (with
props)
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
(with props)
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
(with props)
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/webapp/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/webapp/WEB-INF/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/webapp/WEB-INF/beans.xml
(with props)
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/webapp/WEB-INF/web.xml
(with props)
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/web/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/web/jetty9/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/web/jetty9/test/
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
(with props)
openwebbeans/trunk/webbeans-jetty9/src/it/settings.xml (with props)
openwebbeans/trunk/webbeans-jetty9/src/main/
openwebbeans/trunk/webbeans-jetty9/src/main/config/
openwebbeans/trunk/webbeans-jetty9/src/main/config/etc/
openwebbeans/trunk/webbeans-jetty9/src/main/config/etc/apache-owb.xml
(with props)
openwebbeans/trunk/webbeans-jetty9/src/main/config/modules/
openwebbeans/trunk/webbeans-jetty9/src/main/config/modules/apache-owb.mod
(with props)
openwebbeans/trunk/webbeans-jetty9/src/main/java/
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettyDecorator.java
(with props)
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettySecurityFilter.java
(with props)
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettySecurityService.java
(with props)
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettyUtil.java
(with props)
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettyWebPlugin.java
(with props)
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/OwbConfiguration.java
(with props)
openwebbeans/trunk/webbeans-jetty9/src/main/resources/
openwebbeans/trunk/webbeans-jetty9/src/main/resources/META-INF/
openwebbeans/trunk/webbeans-jetty9/src/main/resources/META-INF/services/
openwebbeans/trunk/webbeans-jetty9/src/main/resources/META-INF/services/org.apache.webbeans.spi.plugins.OpenWebBeansPlugin
openwebbeans/trunk/webbeans-jetty9/src/main/resources/META-INF/web-fragment.xml
(with props)
openwebbeans/trunk/webbeans-jetty9/src/site/
openwebbeans/trunk/webbeans-jetty9/src/site/site.xml (with props)
openwebbeans/trunk/webbeans-jetty9/src/test/
openwebbeans/trunk/webbeans-jetty9/src/test/java/
openwebbeans/trunk/webbeans-jetty9/src/test/java/org/
openwebbeans/trunk/webbeans-jetty9/src/test/java/org/apache/
openwebbeans/trunk/webbeans-jetty9/src/test/java/org/apache/webbeans/
openwebbeans/trunk/webbeans-jetty9/src/test/java/org/apache/webbeans/web/
openwebbeans/trunk/webbeans-jetty9/src/test/java/org/apache/webbeans/web/jetty9/
openwebbeans/trunk/webbeans-jetty9/src/test/java/org/apache/webbeans/web/jetty9/test/
openwebbeans/trunk/webbeans-jetty9/src/test/java/org/apache/webbeans/web/jetty9/test/JettyNormalScopeProxyFactoryTest.java
(with props)
openwebbeans/trunk/webbeans-jetty9/src/test/java/org/apache/webbeans/web/jetty9/test/MySessionScoped.java
(with props)
openwebbeans/trunk/webbeans-jetty9/src/test/java/org/apache/webbeans/web/jetty9/test/MyWrapper.java
(with props)
Modified:
openwebbeans/trunk/pom.xml
Modified: openwebbeans/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/pom.xml?rev=1858225&r1=1858224&r2=1858225&view=diff
==============================================================================
--- openwebbeans/trunk/pom.xml (original)
+++ openwebbeans/trunk/pom.xml Fri Apr 26 20:15:55 2019
@@ -70,6 +70,8 @@
<geronimo_interceptor.version>1.0</geronimo_interceptor.version>
<geronimo_validation.version>1.1</geronimo_validation.version>
<tomcat7.version>7.0.73</tomcat7.version>
+ <!-- jetty 9.4.13+ broke session persistence:
https://github.com/eclipse/jetty.project/issues/3597 -->
+ <jetty.version>9.4.12.v20180830</jetty.version>
<myfaces.version>2.3.0</myfaces.version>
<xbean.version>4.13</xbean.version>
<arquillian.version>1.1.13.Final</arquillian.version>
@@ -540,7 +542,8 @@
<module>webbeans-ejb</module>
<module>webbeans-ee</module>
<module>webbeans-tomcat7</module>
- <module>webbeans-jms</module>
+ <module>webbeans-jetty9</module>
+ <module>webbeans-jms</module>
<module>webbeans-jsf</module>
<module>webbeans-el22</module>
<module>webbeans-resource</module>
Propchange: openwebbeans/trunk/webbeans-jetty9/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr 26 20:15:55 2019
@@ -0,0 +1,12 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore
+
Added: openwebbeans/trunk/webbeans-jetty9/README.asciidoc
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/README.asciidoc?rev=1858225&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-jetty9/README.asciidoc (added)
+++ openwebbeans/trunk/webbeans-jetty9/README.asciidoc Fri Apr 26 20:15:55 2019
@@ -0,0 +1,218 @@
+== Jetty 9 Module for Apache OpenWebBeans
+
+There are two ways to use Apache OpenWebBeans with Jetty 9.
+You can:
+
+* Exclude the Apache OpenWebBeans implementation from your `.war` file, this
is known as a skinny `.war`
+* Include the Apache OpenWebBeans implementation in your `.war` file, this is
known as a fat `.war`
+
+=== Fat `.war`
+
+Bundle the Apache OpenWebBeans `.jar` files in your `WEB-INF/lib`.
+
+Add (or augment your existing) `WEB-INF/jetty-web.xml`:
+
+[source,xml]
+----
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://www.eclipse.org/jetty/configure_9_3.dtd">
+<Configure id="wac" class="org.eclipse.jetty.webapp.WebAppContext">
+ <Call name="prependServerClass">
+ <Arg>-org.eclipse.jetty.util.Decorator</Arg>
+ </Call>
+ <Call name="prependServerClass">
+ <Arg>-org.eclipse.jetty.util.DecoratedObjectFactory</Arg>
+ </Call>
+ <Call name="prependServerClass">
+ <Arg>-org.eclipse.jetty.server.handler.ContextHandler</Arg>
+ </Call>
+ <Call name="prependServerClass">
+ <Arg>-org.eclipse.jetty.servlet.ServletContextHandler$Context</Arg>
+ </Call>
+ <Call name="prependServerClass">
+ <Arg>-org.eclipse.jetty.servlet.ServletContextHandler</Arg>
+ </Call>
+ <Call name="prependServerClass">
+ <Arg>-org.eclipse.jetty.webapp.WebAppContext</Arg>
+ </Call>
+ <Get id="wal" name="classLoader"/>
+ <Get id="objf" name="objectFactory">
+ <Call name="addDecorator">
+ <Arg>
+ <New class="org.apache.webbeans.web.jetty9.JettyDecorator">
+ <Arg><Ref refid="wal"/></Arg>
+ </New>
+ </Arg>
+ </Call>
+ </Get>
+</Configure>
+----
+
+Add the listener to your `WEB-INF/web.xml`:
+
+[source,xml]
+----
+<web-app id="owb-it" version="3.0"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+ ...
+ <listener>
+
<listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
+ </listener>
+ ...
+</web-app>
+----
+
+The resulting `.war` will run on vanilla Jetty
+
+=== Skinny `.war`
+
+In this case you exclude the Apache OpenWebBeans `.jar` files from your
`WEB-INF/lib` and do nothing with deploytment descriptors or adding listeners.
+
+You will need to configure your target Jetty to activate Apache OpenWebBeans.
+This depends on your target Jetty.
+
+NOTE: A regression in Jetty 9.4.13
(link:https://github.com/eclipse/jetty.project/issues/3597[#3597]) means that
skinny `.war` deployments will not be able to persist session scoped context.
+The recommendation is to use fat `.war` deployments if you need to use a
version of Jetty with this regression.
+
+=== Standard Jetty Deployment
+
+Should just be a case of adding the module to your Jetty Home and then
activating it.
+
+[source,shell]
+----
+export JETTY_BASE=...
+export JETTY_HOME=...
+
+# Add the module to your Jetty Home
+cd "${JETTY_HOME}"
+curl -O
https://repo1.maven.org/maven2/org/apache/openwebbeans/openwebbeans-jetty9/2.0.11/openwebbeans-jetty9-2.0.11-config.jar
+unzip openwebbeans-jetty9-2.0.11-config.jar
+rm openwebbeans-jetty9-2.0.11-config.jar
+cd "${JETTY_BASE}"
+
+# Add the module to your Jetty Base
+java -jar "${JETTY_HOME}/start.jar" --add-to-start=apache-owb
apache-owb.version=2.0.11
+
+ALERT: There are enabled module(s) with licenses.
+The following 1 module(s):
+ + contains software not provided by the Eclipse Foundation!
+ + contains software not covered by the Eclipse Public License!
+ + has not been audited for compliance with its license
+
+ Module: apache-owb
+ + Apache OpenWebBeans is an open source project hosted by the Apache
Software Foundation and released under the Apache 2.0 license.
+ + https://openwebbeans.apache.org/
+ + http://www.apache.org/licenses/LICENSE-2.0.html
+
+Proceed (y/N)? y
+INFO : apache-owb initialized in ${jetty.base}/start.ini
+MKDIR : ${jetty.base}/lib/apache-owb
+COPY :
.../.m2/repository/org/apache/openwebbeans/openwebbeans-spi/2.0.11/openwebbeans-spi-2.0.11.jar
to ${jetty.base}/lib/apache-owb/openwebbeans-spi-2.0.11.jar
+COPY :
.../.m2/repository/org/apache/openwebbeans/openwebbeans-impl/2.0.11/openwebbeans-impl-2.0.11.jar
to ${jetty.base}/lib/apache-owb/openwebbeans-impl-2.0.11.jar
+COPY :
.../.m2/repository/org/apache/openwebbeans/openwebbeans-web/2.0.11/openwebbeans-web-2.0.11.jar
to ${jetty.base}/lib/apache-owb/openwebbeans-web-2.0.11.jar
+COPY :
.../.m2/repository/org/apache/openwebbeans/openwebbeans-el22/2.0.11/openwebbeans-el22-2.0.11.jar
to ${jetty.base}/lib/apache-owb/openwebbeans-el22-2.0.11.jar
+COPY :
.../.m2/repository/org/apache/openwebbeans/openwebbeans-jetty9/2.0.11/openwebbeans-jetty9-2.0.11.jar
to ${jetty.base}/lib/apache-owb/openwebbeans-jetty9-2.0.11.jar
+COPY :
.../.m2/repository/org/apache/geronimo/specs/geronimo-jcdi_2.0_spec/1.0/geronimo-jcdi_2.0_spec-1.0.jar
to ${jetty.base}/lib/apache-owb/geronimo-jcdi_2.0_spec-1.0.jar
+COPY :
.../.m2/repository/org/apache/geronimo/specs/geronimo-atinject_1.0_spec/1.0/geronimo-atinject_1.0_spec-1.0.jar
to ${jetty.base}/lib/apache-owb/geronimo-atinject_1.0_spec-1.0.jar
+COPY :
.../.m2/repository/org/apache/geronimo/specs/geronimo-interceptor_1.2_spec/1.0/geronimo-interceptor_1.2_spec-1.0.jar
to ${jetty.base}/lib/apache-owb/geronimo-interceptor_1.2_spec-1.0.jar
+COPY :
.../.m2/repository/org/apache/xbean/xbean-finder-shaded/4.13/xbean-finder-shaded-4.13.jar
to ${jetty.base}/lib/apache-owb/xbean-finder-shaded-4.13.jar
+COPY :
.../.m2/repository/org/apache/xbean/xbean-asm7-shaded/4.13/xbean-asm7-shaded-4.13.jar
to ${jetty.base}/lib/apache-owb/xbean-asm7-shaded-4.13.jar
+INFO : Base directory was modified
+----
+
+==== Jetty Embedded
+
+Just add the `org.apache.webbeans.web.jetty9.OwbConfiguration` to your
context's configuration classes e.g.
+
+[source,java]
+----
+Server jetty;
+WebAppContext ctx;
+
+...
+
+Configuration.ClassList classList =
Configuration.ClassList.serverDefault(jetty);
+classList.addBefore(
+ "org.eclipse.jetty.webapp.JettyWebXmlConfiguration",
+ "org.eclipse.jetty.annotations.AnnotationConfiguration",
+ "org.apache.webbeans.web.jetty9.OwbConfiguration"
+);
+ctx.setConfigurationClasses(classList);
+----
+
+==== Jetty Maven Plugin
+
+NOTE: The following only applies if if you are using a skinny `.war`
+
+Add the dependencies to your `jetty-maven-plugin` definnition and add the
`org.apache.webbeans.web.jetty9.OwbConfiguration` to your context's
configuration classes.
+
+NOTE: This will require you to specify all the configuration classes
+
+[source,xml]
+----
+<plugin>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ ...
+ <dependencies>
+ ...
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-spi</artifactId>
+ <version>${openwebbeans.version}/version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-impl</artifactId>
+ <version>${openwebbeans.version}/version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-web</artifactId>
+ <version>${openwebbeans.version}/version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-jetty9</artifactId>
+ <version>${openwebbeans.version}/version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jcdi_2.0_spec</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-atinject_1.0_spec</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-interceptor_1.2_spec</artifactId>
+ <version>1.0</version>
+ </dependency>
+ ...
+ </dependencies>
+ ...
+ <configuration>
+ ...
+ <webApp>
+ ...
+ <configurationClasses>
+
<configurationClass>org.eclipse.jetty.maven.plugin.MavenWebInfConfiguration</configurationClass>
+
<configurationClass>org.eclipse.jetty.webapp.WebXmlConfiguration</configurationClass>
+
<configurationClass>org.eclipse.jetty.webapp.MetaInfConfiguration</configurationClass>
+
<configurationClass>org.eclipse.jetty.webapp.FragmentConfiguration</configurationClass>
+
<configurationClass>org.eclipse.jetty.plus.webapp.EnvConfiguration</configurationClass>
+
<configurationClass>org.eclipse.jetty.plus.webapp.PlusConfiguration</configurationClass>
+
<configurationClass>org.eclipse.jetty.annotations.AnnotationConfiguration</configurationClass>
+
<configurationClass>org.apache.webbeans.web.jetty9.OwbConfiguration</configurationClass>
+
<configurationClass>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</configurationClass>
+ </configurationClasses>
+ ...
+ </webApp>
+ ...
+ </configuration>
+</plugin>
+----
Added: openwebbeans/trunk/webbeans-jetty9/pom.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/pom.xml?rev=1858225&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-jetty9/pom.xml (added)
+++ openwebbeans/trunk/webbeans-jetty9/pom.xml Fri Apr 26 20:15:55 2019
@@ -0,0 +1,199 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+-->
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans</artifactId>
+ <version>2.0.11-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openwebbeans-jetty9</artifactId>
+ <name>Jetty 9 plugin</name>
+ <description>Apache OpenWebBeans Jetty 9 Web Profile</description>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-bom</artifactId>
+ <version>${jetty.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-plus</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-servlet</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jcdi_2.0_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-atinject_1.0_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-spi</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-web</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-interceptor_1.2_spec</artifactId>
+ <version>1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>apache-jsp</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>apache-jstl</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.6</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.jetty.toolchain</groupId>
+ <artifactId>jetty-assembly-descriptors</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>config</descriptorRef>
+ </descriptorRefs>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>run-its</id>
+ <build>
+ <plugins>
+ <!-- invoke the integration tests under src/it -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <configuration>
+ <debug>false</debug><!-- unless we want to debug
the jetty-maven-plugin-->
+ <projectsDirectory>src/it</projectsDirectory>
+
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+ <settingsFile>src/it/settings.xml</settingsFile>
+ <filterProperties>
+ <jettyVersion>${jetty.version}</jettyVersion>
+ </filterProperties>
+ <pomIncludes>
+ <pomInclude>*/pom.xml</pomInclude>
+ </pomIncludes>
+ <goals>
+ <goal>install</goal>
+ </goals>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>install</goal>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Propchange: openwebbeans/trunk/webbeans-jetty9/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/pom.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/pom.xml?rev=1858225&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/pom.xml (added)
+++ openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/pom.xml Fri Apr 26
20:15:55 2019
@@ -0,0 +1,189 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <!--
+
+ 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.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans</artifactId>
+ <version>@project.version@</version>
+ </parent>
+
+ <groupId>org.apache.openwebbeans.it</groupId>
+ <artifactId>openwebbeans-jetty9-it-fatwar</artifactId>
+ <version>@project.version@</version>
+ <packaging>war</packaging>
+ <name>Jetty 9 plugin IT</name>
+
+ <properties>
+ <jetty.port.it>9081</jetty.port.it>
+ <jstl.version>1.2</jstl.version>
+ <projectStage>Development</projectStage>
+ </properties>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>${httpclient.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-spi</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-impl</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-web</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-jetty9</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jcdi_2.0_spec</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-atinject_1.0_spec</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-interceptor_1.2_spec</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_3.0_spec</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>owbjetty9it</finalName>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>@jettyVersion@</version>
+ </plugin>
+
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>2.11</version>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>verify</id>
+ <goals>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <configuration>
+ <httpConnector>
+ <port>${jetty.port.it}</port>
+ </httpConnector>
+ <webApp>
+ <contextPath>/${project.build.finalName}</contextPath>
+ </webApp>
+ <systemProperties>
+ <systemProperty>
+ <name>org.apache.myfaces.PROJECT_STAGE</name>
+ <value>${projectStage}</value>
+ </systemProperty>
+ <systemProperty>
+ <name>faces.PROJECT_STAGE</name>
+ <value>${projectStage}</value>
+ </systemProperty>
+ </systemProperties>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+
+</project>
Propchange: openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java?rev=1858225&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
(added)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.web.jetty9.test;
+
+import javax.enterprise.context.ApplicationScoped;
+
+/**
+ * Test bean which gets used in the TestServlet.
+ */
+@ApplicationScoped
+public class TestBean
+{
+ int i = 4711;
+
+ public int getI()
+ {
+ return i;
+ }
+
+ public void setI(int i)
+ {
+ this.i = i;
+ }
+}
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java?rev=1858225&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
(added)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.web.jetty9.test;
+
+import javax.inject.Inject;
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import java.io.IOException;
+
+/**
+ * Dummy Servlet which just checks whether CDI injection works
+ */
+public class TestServlet implements Servlet
+{
+
+ @Inject
+ private TestBean tb;
+
+ public void destroy()
+ {
+ // nothing to do
+ }
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ // nothing to do
+ }
+
+ public ServletConfig getServletConfig()
+ {
+ return null;
+ }
+
+ public void service(ServletRequest req, ServletResponse res) throws
ServletException, IOException
+ {
+ if (tb == null || tb.getI() != 4711)
+ {
+ throw new RuntimeException("CDI Injction doesn not work!");
+ }
+ }
+
+ public String getServletInfo()
+ {
+ return null;
+ }
+}
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/beans.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/beans.xml?rev=1858225&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/beans.xml
(added)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/beans.xml
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,20 @@
+<?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.
+-->
+<beans/>
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/beans.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/jetty-web.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/jetty-web.xml?rev=1858225&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/jetty-web.xml
(added)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/jetty-web.xml
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,51 @@
+<?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.
+-->
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://www.eclipse.org/jetty/configure_9_3.dtd">
+<Configure id="wac" class="org.eclipse.jetty.webapp.WebAppContext">
+ <Call name="prependServerClass">
+ <Arg>-org.eclipse.jetty.util.Decorator</Arg>
+ </Call>
+ <Call name="prependServerClass">
+ <Arg>-org.eclipse.jetty.util.DecoratedObjectFactory</Arg>
+ </Call>
+ <Call name="prependServerClass">
+ <Arg>-org.eclipse.jetty.server.handler.ContextHandler</Arg>
+ </Call>
+ <Call name="prependServerClass">
+ <Arg>-org.eclipse.jetty.servlet.ServletContextHandler$Context</Arg>
+ </Call>
+ <Call name="prependServerClass">
+ <Arg>-org.eclipse.jetty.servlet.ServletContextHandler</Arg>
+ </Call>
+ <Call name="prependServerClass">
+ <Arg>-org.eclipse.jetty.webapp.WebAppContext</Arg>
+ </Call>
+ <Get id="wal" name="classLoader"/>
+ <Get id="objf" name="objectFactory">
+ <Call name="addDecorator">
+ <Arg>
+ <New class="org.apache.webbeans.web.jetty9.JettyDecorator">
+ <Arg><Ref refid="wal"/></Arg>
+ </New>
+ </Arg>
+ </Call>
+ </Get>
+</Configure>
+
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/jetty-web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/web.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/web.xml?rev=1858225&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/web.xml
(added)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/web.xml
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,36 @@
+<?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 id="owb-it" version="3.0"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+
<servlet-class>org.apache.webbeans.web.jetty9.test.TestServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>*.test</url-pattern>
+ </servlet-mapping>
+ <listener>
+
<listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
+ </listener>
+</web-app>
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java?rev=1858225&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
(added)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.web.jetty9.test;
+
+
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.DefaultHttpClient;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.lang.StringBuilder;
+
+/**
+ * Simple requests to the jetty installation
+ */
+public class OwbJettyPluginIT
+{
+ @Test
+ public void testJettyRequest() throws Exception
+ {
+ DefaultHttpClient httpclient = new DefaultHttpClient();
+ HttpGet httpGet = new
HttpGet("http://localhost:9081/owbjetty9it/test.test");
+
+ HttpResponse response = httpclient.execute(httpGet);
+
+ // Get the response
+ BufferedReader rd = new BufferedReader
+ (new InputStreamReader(response.getEntity().getContent()));
+
+ StringBuilder builder = new StringBuilder();
+ String line = "";
+ while ((line = rd.readLine()) != null) {
+ builder.append(line);
+ }
+
+ Assert.assertNotNull(response);
+ Assert.assertEquals("Got " + builder.toString(), 200,
response.getStatusLine().getStatusCode());
+ }
+
+}
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/pom.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/pom.xml?rev=1858225&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/pom.xml (added)
+++ openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/pom.xml Fri Apr
26 20:15:55 2019
@@ -0,0 +1,214 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <!--
+
+ 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.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans</artifactId>
+ <version>@project.version@</version>
+ </parent>
+
+ <groupId>org.apache.openwebbeans.it</groupId>
+ <artifactId>openwebbeans-jetty9-it-servletinjection</artifactId>
+ <version>@project.version@</version>
+ <packaging>war</packaging>
+ <name>Jetty 9 plugin IT</name>
+
+ <properties>
+ <jetty.port.it>9081</jetty.port.it>
+ <jstl.version>1.2</jstl.version>
+ <projectStage>Development</projectStage>
+ </properties>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>${httpclient.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jcdi_2.0_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-atinject_1.0_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_3.0_spec</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>owbjetty9it</finalName>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>@jettyVersion@</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-spi</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-impl</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-web</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-jetty9</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jcdi_2.0_spec</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-atinject_1.0_spec</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+
<artifactId>geronimo-interceptor_1.2_spec</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>2.11</version>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>verify</id>
+ <goals>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <configuration>
+ <httpConnector>
+ <port>${jetty.port.it}</port>
+ </httpConnector>
+ <webApp>
+ <contextPath>/${project.build.finalName}</contextPath>
+ <configurationClasses>
+
<configurationClass>org.eclipse.jetty.maven.plugin.MavenWebInfConfiguration</configurationClass>
+
<configurationClass>org.eclipse.jetty.webapp.WebXmlConfiguration</configurationClass>
+
<configurationClass>org.eclipse.jetty.webapp.MetaInfConfiguration</configurationClass>
+
<configurationClass>org.eclipse.jetty.webapp.FragmentConfiguration</configurationClass>
+
<configurationClass>org.eclipse.jetty.plus.webapp.EnvConfiguration</configurationClass>
+
<configurationClass>org.eclipse.jetty.plus.webapp.PlusConfiguration</configurationClass>
+
<configurationClass>org.eclipse.jetty.annotations.AnnotationConfiguration</configurationClass>
+
<configurationClass>org.apache.webbeans.web.jetty9.OwbConfiguration</configurationClass>
+
<configurationClass>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</configurationClass>
+ </configurationClasses>
+ </webApp>
+ <systemProperties>
+ <systemProperty>
+ <name>org.apache.myfaces.PROJECT_STAGE</name>
+ <value>${projectStage}</value>
+ </systemProperty>
+ <systemProperty>
+ <name>faces.PROJECT_STAGE</name>
+ <value>${projectStage}</value>
+ </systemProperty>
+ </systemProperties>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+
+</project>
Propchange: openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java?rev=1858225&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
(added)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.web.jetty9.test;
+
+import javax.enterprise.context.ApplicationScoped;
+
+/**
+ * Test bean which gets used in the TestServlet.
+ */
+@ApplicationScoped
+public class TestBean
+{
+ int i = 4711;
+
+ public int getI()
+ {
+ return i;
+ }
+
+ public void setI(int i)
+ {
+ this.i = i;
+ }
+}
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java?rev=1858225&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
(added)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.web.jetty9.test;
+
+import javax.inject.Inject;
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import java.io.IOException;
+
+/**
+ * Dummy Servlet which just checks whether CDI injection works
+ */
+public class TestServlet implements Servlet
+{
+
+ @Inject
+ private TestBean tb;
+
+ public void destroy()
+ {
+ // nothing to do
+ }
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ // nothing to do
+ }
+
+ public ServletConfig getServletConfig()
+ {
+ return null;
+ }
+
+ public void service(ServletRequest req, ServletResponse res) throws
ServletException, IOException
+ {
+ if (tb == null || tb.getI() != 4711)
+ {
+ throw new RuntimeException("CDI Injction doesn not work!");
+ }
+ }
+
+ public String getServletInfo()
+ {
+ return null;
+ }
+}
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/webapp/WEB-INF/beans.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/webapp/WEB-INF/beans.xml?rev=1858225&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/webapp/WEB-INF/beans.xml
(added)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/webapp/WEB-INF/beans.xml
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,20 @@
+<?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.
+-->
+<beans/>
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/webapp/WEB-INF/beans.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/webapp/WEB-INF/web.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/webapp/WEB-INF/web.xml?rev=1858225&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/webapp/WEB-INF/web.xml
(added)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/webapp/WEB-INF/web.xml
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,33 @@
+<?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 id="owb-it" version="3.0"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+
<servlet-class>org.apache.webbeans.web.jetty9.test.TestServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>*.test</url-pattern>
+ </servlet-mapping>
+</web-app>
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java?rev=1858225&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
(added)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.web.jetty9.test;
+
+
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.DefaultHttpClient;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.lang.StringBuilder;
+
+/**
+ * Simple requests to the jetty installation
+ */
+public class OwbJettyPluginIT
+{
+ @Test
+ public void testJettyRequest() throws Exception
+ {
+ DefaultHttpClient httpclient = new DefaultHttpClient();
+ HttpGet httpGet = new
HttpGet("http://localhost:9081/owbjetty9it/test.test");
+
+ HttpResponse response = httpclient.execute(httpGet);
+
+ // Get the response
+ BufferedReader rd = new BufferedReader
+ (new InputStreamReader(response.getEntity().getContent()));
+
+ StringBuilder builder = new StringBuilder();
+ String line = "";
+ while ((line = rd.readLine()) != null) {
+ builder.append(line);
+ }
+
+ Assert.assertNotNull(response);
+ Assert.assertEquals("Got " + builder.toString(), 200,
response.getStatusLine().getStatusCode());
+ }
+
+}
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openwebbeans/trunk/webbeans-jetty9/src/it/settings.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/settings.xml?rev=1858225&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-jetty9/src/it/settings.xml (added)
+++ openwebbeans/trunk/webbeans-jetty9/src/it/settings.xml Fri Apr 26 20:15:55
2019
@@ -0,0 +1,58 @@
+<?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.
+-->
+
+<settings>
+ <profiles>
+ <profile>
+ <id>it-repo</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <repositories>
+ <repository>
+ <id>local.central</id>
+ <url>@localRepositoryUrl@</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>local.central</id>
+ <url>@localRepositoryUrl@</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ <properties>
+ <jetty.version>@jetty.version@</jetty.version>
+ </properties>
+ </profile>
+ </profiles>
+</settings>
Propchange: openwebbeans/trunk/webbeans-jetty9/src/it/settings.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: openwebbeans/trunk/webbeans-jetty9/src/main/config/etc/apache-owb.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/main/config/etc/apache-owb.xml?rev=1858225&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-jetty9/src/main/config/etc/apache-owb.xml
(added)
+++ openwebbeans/trunk/webbeans-jetty9/src/main/config/etc/apache-owb.xml Fri
Apr 26 20:15:55 2019
@@ -0,0 +1,36 @@
+<?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.
+-->
+<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
"http://www.eclipse.org/jetty/configure_9_3.dtd">
+
+<Configure id="Server" class="org.eclipse.jetty.server.Server">
+ <!-- =========================================================== -->
+ <!-- Add Apache OpenWebBeans Configuring classes to all webapps for this
Server -->
+ <!-- =========================================================== -->
+ <Call class="org.eclipse.jetty.webapp.Configuration$ClassList"
name="setServerDefault">
+ <Arg><Ref refid="Server" /></Arg>
+ <Call name="addBefore">
+ <Arg
name="beforeClass">org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Arg>
+ <Arg>
+ <Array type="String">
+ <Item>org.apache.webbeans.web.jetty9.OwbConfiguration</Item>
+ </Array>
+ </Arg>
+ </Call>
+ </Call>
+
+</Configure>
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/main/config/etc/apache-owb.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: openwebbeans/trunk/webbeans-jetty9/src/main/config/modules/apache-owb.mod
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/main/config/modules/apache-owb.mod?rev=1858225&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-jetty9/src/main/config/modules/apache-owb.mod
(added)
+++ openwebbeans/trunk/webbeans-jetty9/src/main/config/modules/apache-owb.mod
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,39 @@
+DO NOT EDIT - See:
https://www.eclipse.org/jetty/documentation/current/startup-modules.html
+
+[description]
+Jetty setup to support Apache OpenWebBeans for CDI2 inside the webapp
+
+[depend]
+plus
+deploy
+
+[files]
+maven://org.apache.openwebbeans/openwebbeans-spi/${apache-owb.version}|lib/apache-owb/openwebbeans-spi-${apache-owb.version}.jar
+maven://org.apache.openwebbeans/openwebbeans-impl/${apache-owb.version}|lib/apache-owb/openwebbeans-impl-${apache-owb.version}.jar
+maven://org.apache.openwebbeans/openwebbeans-web/${apache-owb.version}|lib/apache-owb/openwebbeans-web-${apache-owb.version}.jar
+maven://org.apache.openwebbeans/openwebbeans-el22/${apache-owb.version}|lib/apache-owb/openwebbeans-el22-${apache-owb.version}.jar
+maven://org.apache.openwebbeans/openwebbeans-jetty9/${apache-owb.version}|lib/apache-owb/openwebbeans-jetty9-${apache-owb.version}.jar
+maven://org.apache.geronimo.specs/geronimo-jcdi_2.0_spec/${geronimo-cdi-spec.version}|lib/apache-owb/geronimo-jcdi_2.0_spec-${geronimo-cdi-spec.version}.jar
+maven://org.apache.geronimo.specs/geronimo-atinject_1.0_spec/${geronimo-atinject-spec.version}|lib/apache-owb/geronimo-atinject_1.0_spec-${geronimo-atinject-spec.version}.jar
+maven://org.apache.geronimo.specs/geronimo-interceptor_1.2_spec/${geronimo-interceptor-spec.version}|lib/apache-owb/geronimo-interceptor_1.2_spec-${geronimo-interceptor-spec.version}.jar
+maven://org.apache.xbean/xbean-finder-shaded/${xbean.version}|lib/apache-owb/xbean-finder-shaded-${xbean.version}.jar
+maven://org.apache.xbean/xbean-asm7-shaded/${xbean.version}|lib/apache-owb/xbean-asm7-shaded-${xbean.version}.jar
+
+[lib]
+lib/apache-owb/*.jar
+
+[xml]
+# Enable annotation scanning webapp configurations
+etc/apache-owb.xml
+
+[license]
+Apache OpenWebBeans is an open source project hosted by the Apache Software
Foundation and released under the Apache 2.0 license.
+https://openwebbeans.apache.org/
+http://www.apache.org/licenses/LICENSE-2.0.html
+
+[ini]
+apache-owb.version?=2.0.11
+geronimo-cdi-spec.version=1.0
+geronimo-atinject-spec.version=1.0
+geronimo-interceptor-spec.version=1.0
+xbean.version=4.13
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/main/config/modules/apache-owb.mod
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettyDecorator.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettyDecorator.java?rev=1858225&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettyDecorator.java
(added)
+++
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettyDecorator.java
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,89 @@
+/*
+ * 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.
+ */
+
+package org.apache.webbeans.web.jetty9;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.eclipse.jetty.util.Decorator;
+import org.eclipse.jetty.util.log.Log;
+import org.eclipse.jetty.util.log.Logger;
+
+/**
+ * Jetty support for OpenWebBeans.
+ */
+public class JettyDecorator implements Decorator
+{
+ private static final Logger log = Log.getLogger(JettyDecorator.class);
+
+ private ClassLoader loader;
+ private Map<Object, Object> objects = new ConcurrentHashMap<>();
+
+ public JettyDecorator(ClassLoader loader)
+ {
+ this.loader = loader;
+ }
+
+ @Override
+ public <T> T decorate(T object)
+ {
+ try
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("Injecting the dependencies for OpenWebBeans, " +
+ "instance : " + object);
+ }
+
+ Object injectorInstance = JettyUtil.inject(object, loader);
+ if (injectorInstance != null)
+ {
+ objects.put(object, injectorInstance);
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn("Error is occured while injecting the OpenWebBeans " +
+ "dependencies for instance " + object, e);
+ }
+ return object;
+ }
+
+ @Override
+ public void destroy(Object instance)
+ {
+ Object injectorInstance = objects.get(instance);
+ if (injectorInstance != null)
+ {
+ try
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("Destroying the OpenWebBeans injector instance");
+ }
+ JettyUtil.destroy(injectorInstance, loader);
+ }
+ catch (Exception e)
+ {
+ log.warn("Erros is occured while destroying the OpenWebBeans
injector instance", e);
+ }
+ }
+ }
+}
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettyDecorator.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettySecurityFilter.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettySecurityFilter.java?rev=1858225&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettySecurityFilter.java
(added)
+++
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettySecurityFilter.java
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.web.jetty9;
+
+import java.io.IOException;
+import java.security.Principal;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+
+public class JettySecurityFilter implements Filter
+{
+ private static ThreadLocal<Principal> principal = new ThreadLocal<>();
+
+ public static Principal getPrincipal()
+ {
+ return principal.get();
+ }
+
+ @Override
+ public void init(FilterConfig filterConfig) throws ServletException
+ {
+ // nothing to do
+ }
+
+ @Override
+ public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException
+ {
+ try
+ {
+ if (request instanceof HttpServletRequest)
+ {
+ Principal p = ((HttpServletRequest)
request).getUserPrincipal();
+ if (p != null)
+ {
+ principal.set(p);
+ }
+ }
+
+ // continue with the request
+ chain.doFilter(request, response);
+ }
+ finally
+ {
+ if (principal.get() != null)
+ {
+ principal.remove();
+ }
+ }
+ }
+
+ @Override
+ public void destroy()
+ {
+ // nothing to do
+ }
+}
Propchange:
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettySecurityFilter.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettySecurityService.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettySecurityService.java?rev=1858225&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettySecurityService.java
(added)
+++
openwebbeans/trunk/webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettySecurityService.java
Fri Apr 26 20:15:55 2019
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.web.jetty9;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Proxy;
+import java.security.Principal;
+
+import org.apache.webbeans.corespi.security.SimpleSecurityService;
+
+/**
+ * Filter which sets the UserPrincipal into a ThreadLocal
+ * to make it injectable via a CDI Producer
+ */
+public class JettySecurityService extends SimpleSecurityService
+{
+
+ private final Principal proxy =
Principal.class.cast(Proxy.newProxyInstance(
+ JettySecurityService.class.getClassLoader(),
+ new Class<?>[]{Principal.class, Unwrap.class}, (proxy, method,
args) ->
+ {
+ try
+ {
+ final Principal principal =
JettySecurityFilter.getPrincipal();
+ if (principal == null)
+ {
+ return null;
+ }
+ if (Unwrap.class == method.getDeclaringClass())
+ {
+ return principal;
+ }
+ return method.invoke(principal, args);
+ }
+ catch (final InvocationTargetException ite)
+ {
+ throw ite.getTargetException();
+ }
+ }));
+
+ @Override
+ public Principal getCurrentPrincipal()
+ {
+ return proxy;
+ }
+
+ public interface Unwrap
+ {
+ Principal get();
+ }
+}