Raising new orbit deps to top level dependencyManagement, and wiring up jetty-osgi with new deps

This commit is contained in:
Joakim Erdfelt 2012-01-31 14:00:47 -07:00
parent 154f4e7ed7
commit c4cf25f51b
7 changed files with 263 additions and 228 deletions

View File

@ -10,7 +10,6 @@
<packaging>pom</packaging> <packaging>pom</packaging>
<properties> <properties>
<assembly-directory>target/distribution</assembly-directory> <assembly-directory>target/distribution</assembly-directory>
<orbit-servlet-api-version>2.5.0.v201103041518</orbit-servlet-api-version>
</properties> </properties>
<build> <build>
<plugins> <plugins>
@ -284,73 +283,6 @@
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<!-- Orbit Deps -->
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.servlet</artifactId>
<version>${orbit-servlet-api-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.annotation</artifactId>
<version>1.1.0.v201108011116</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>org.objectweb.asm</artifactId>
<version>3.1.0.v200803061910</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.activation</artifactId>
<version>1.1.0.v201105071233</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.mail.glassfish</artifactId>
<version>1.4.1.v201005082020</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.transaction</artifactId>
<version>1.1.1.v201105210645</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.el</artifactId>
<version>2.1.0.v201105211819</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.servlet.jsp</artifactId>
<version>2.1.0.v201105211820</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.servlet.jsp.jstl</artifactId>
<version>1.2.0.v201105211821</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>com.sun.el</artifactId>
<version>1.0.0.v201105211818</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>org.apache.jasper.glassfish</artifactId>
<version>2.1.0.v201110031002</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>org.apache.taglibs.standard.glassfish</artifactId>
<version>1.2.0.v201112081803</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
<version>3.7.1</version>
</dependency>
<!-- Standard Jetty Deps --> <!-- Standard Jetty Deps -->
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>

View File

@ -24,24 +24,46 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclipse.osgi</groupId> <groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId> <artifactId>org.eclipse.osgi</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclipse.osgi</groupId> <groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi.services</artifactId> <artifactId>org.eclipse.osgi.services</artifactId>
</dependency>
<!-- Orbit Servlet Deps -->
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.servlet</artifactId>
</dependency>
<!-- Orbit JSP Deps -->
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.el</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mortbay.jetty</groupId> <groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>jsp-2.1-glassfish</artifactId> <artifactId>javax.servlet.jsp</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mortbay.jetty</groupId> <groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>jsp-api-2.1-glassfish</artifactId> <artifactId>javax.servlet.jsp.jstl</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>servlet-api</artifactId> <artifactId>com.sun.el</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>org.apache.jasper.glassfish</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>org.apache.taglibs.standard.glassfish</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -138,16 +138,6 @@
<artifactId>servletbridge</artifactId> <artifactId>servletbridge</artifactId>
<version>${equinox-servletbridge-version}</version> <version>${equinox-servletbridge-version}</version>
</dependency--> </dependency-->
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-2.1-glassfish</artifactId>
<version>${jsp-2.1-glassfish-version}</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-api-2.1-glassfish</artifactId>
<version>${jsp-2.1-glassfish-version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>

View File

@ -11,23 +11,46 @@
<description>Jetty OSGi Integration test</description> <description>Jetty OSGi Integration test</description>
<properties> <properties>
<bundle-symbolic-name>${project.groupId}.boot.test</bundle-symbolic-name> <bundle-symbolic-name>${project.groupId}.boot.test</bundle-symbolic-name>
<jetty-orbit-url>http://download.eclipse.org/jetty/orbit/</jetty-orbit-url>
<assembly-directory>target/distribution</assembly-directory> <assembly-directory>target/distribution</assembly-directory>
<paxexam-version>1.2.0</paxexam-version> <paxexam-version>1.2.0</paxexam-version>
<eclipse-ecj-version>3.6</eclipse-ecj-version>
<orbit-javax-activation-version>${javax-activation-version}.0.v201005080500</orbit-javax-activation-version>
<orbit-javax-annotation-version>1.0.0.v20100513-0750</orbit-javax-annotation-version>
<orbit-javax-el-version>2.1.0.v201004190952</orbit-javax-el-version>
<orbit-javax-mail-glassfish-version>${javax-mail-version}.v201005082020</orbit-javax-mail-glassfish-version>
<orbit-javax-servlet-version>2.5.0.v200910301333</orbit-javax-servlet-version>
<orbit-javax-servlet-jsp-version>2.1.0.v201004190952</orbit-javax-servlet-jsp-version>
<orbit-javax-servlet-jsp-jstl-version>1.2.0.v201004190952</orbit-javax-servlet-jsp-jstl-version>
<orbit-com-sun-el-version>1.0.0.v201004190952</orbit-com-sun-el-version>
<orbit-org-apache-jasper-version>2.1.0.v201007080150</orbit-org-apache-jasper-version>
<orbit-org-apache-taglibs-standard-version>1.2.0.v201004190952</orbit-org-apache-taglibs-standard-version>
<orbit-org-objectweb-asm-version>3.1.0.v200803061910</orbit-org-objectweb-asm-version>
</properties> </properties>
<dependencies> <dependencies>
<!-- Orbit Servlet Deps -->
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.servlet</artifactId>
</dependency>
<!-- Orbit JSP Deps -->
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.el</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.servlet.jsp</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.servlet.jsp.jstl</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>com.sun.el</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>org.apache.jasper.glassfish</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>org.apache.taglibs.standard.glassfish</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
</dependency>
<!-- OSGi Deps -->
<dependency> <dependency>
<groupId>org.eclipse.jetty.osgi</groupId> <groupId>org.eclipse.jetty.osgi</groupId>
<artifactId>jetty-osgi-boot</artifactId> <artifactId>jetty-osgi-boot</artifactId>
@ -46,6 +69,8 @@
<version>${project.version}</version> <version>${project.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- Jetty Deps -->
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId> <artifactId>jetty-webapp</artifactId>
@ -67,6 +92,11 @@
<artifactId>jetty-servlet</artifactId> <artifactId>jetty-servlet</artifactId>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
<scope>runtime</scope>
</dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-xml</artifactId> <artifactId>jetty-xml</artifactId>
@ -94,23 +124,16 @@
<artifactId>jetty-websocket</artifactId> <artifactId>jetty-websocket</artifactId>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<!-- can't use javax.servlet:servlet-api:2.5 it is not a bundle.
the mortbay one is a bundle -->
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5-20081211</version>
<scope>runtime</scope>
</dependency>
<!-- Eclipse OSGi Deps -->
<dependency> <dependency>
<groupId>org.eclipse.osgi</groupId> <groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId> <artifactId>org.eclipse.osgi</artifactId>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclipse.osgi</groupId> <groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi.services</artifactId> <artifactId>org.eclipse.osgi.services</artifactId>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -118,11 +141,6 @@
<artifactId>servlet</artifactId> <artifactId>servlet</artifactId>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
<scope>runtime</scope>
</dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
@ -160,93 +178,77 @@
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.ops4j.pax.exam</groupId> <groupId>org.ops4j.pax.exam</groupId>
<artifactId>maven-paxexam-plugin</artifactId> <artifactId>maven-paxexam-plugin</artifactId>
<version>${paxexam-version}</version> <version>${paxexam-version}</version>
<executions>
<execution>
<id>generate-config</id>
<goals>
<goal>generate-depends-file</goal>
<goal>generate-config</goal>
</goals>
</execution>
</executions>
<configuration>
<options>
<workingDirectory>${project.build.directory}/paxexam</workingDirectory>
</options>
</configuration>
</plugin>
<!-- prepare the orbit jars in the target/distribution folder copied from jetty-distribution/pom.xml -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions> <executions>
<execution> <execution>
<id>generate-config</id>
<goals>
<goal>generate-depends-file</goal>
<goal>generate-config</goal>
</goals>
</execution>
</executions>
<configuration>
<options>
<workingDirectory>${project.build.directory}/paxexam</workingDirectory>
</options>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-orbit-servlet-api-deps</id>
<phase>generate-resources</phase> <phase>generate-resources</phase>
<goals> <goals>
<goal>run</goal> <goal>copy</goal>
</goals> </goals>
<configuration> <configuration>
<tasks> <artifactItems>
<!-- This is the Orbit Downloads Process --> <artifactItem>
<groupId>org.eclipse.jetty.orbit</groupId>
<!-- Step 1: download orbit artifact into orbit-cache (if not present) --> <artifactId>javax.servlet</artifactId>
<property name="orbit-cache" value="${user.home}/.m2/eclipse-orbit" /> <version>${orbit-servlet-api-version}</version>
<overWrite>true</overWrite>
<mkdir dir="${orbit-cache}" /> <outputDirectory>${assembly-directory}/lib</outputDirectory>
<get dest="${orbit-cache}" verbose="true" skipexisting="true"> <destFileName>servlet-api-2.5.jar</destFileName>
<url url="${jetty-orbit-url}/javax.servlet_${orbit-javax-servlet-version}.jar" /> </artifactItem>
<url url="${jetty-orbit-url}/javax.activation_${orbit-javax-activation-version}.jar" /> </artifactItems>
<url url="${jetty-orbit-url}/javax.mail.glassfish_${orbit-javax-mail-glassfish-version}.jar" /> </configuration>
<url url="${jetty-orbit-url}/javax.el_${orbit-javax-el-version}.jar" /> </execution>
<url url="${jetty-orbit-url}/javax.servlet.jsp_${orbit-javax-servlet-jsp-version}.jar" /> <execution>
<url url="${jetty-orbit-url}/javax.servlet.jsp.jstl_${orbit-javax-servlet-jsp-jstl-version}.jar" /> <id>copy-orbit-lib-jndi-deps</id>
<url url="${jetty-orbit-url}/com.sun.el_${orbit-com-sun-el-version}.jar" /> <phase>generate-resources</phase>
<url url="${jetty-orbit-url}/org.apache.jasper.glassfish_${orbit-org-apache-jasper-version}.jar" /> <goals>
<url url="${jetty-orbit-url}/org.apache.taglibs.standard.glassfish_${orbit-org-apache-taglibs-standard-version}.jar" /> <goal>copy-dependencies</goal>
<url url="${jetty-orbit-url}/ecj-${eclipse-ecj-version}.jar" /> </goals>
</get> <configuration>
<includeGroupIds>org.eclipse.jetty.orbit</includeGroupIds>
<!-- Step 2: copy the orbit artifact from orbit-cache to the appropriate lib directory --> <includeArtifactIds>javax.mail.glassfish,javax.activation</includeArtifactIds>
<includeTypes>jar</includeTypes>
<!-- ${jetty.home}/lib/ --> <outputDirectory>${assembly-directory}/lib/jndi</outputDirectory>
<mkdir dir="${assembly-directory}/lib" /> </configuration>
<copy file="${orbit-cache}/javax.servlet_${orbit-javax-servlet-version}.jar" tofile="${assembly-directory}/lib/servlet-api-2.5.jar" /> </execution>
<execution>
<!-- ${jetty.home}/lib/jndi/ --> <id>copy-orbit-lib-jsp-deps</id>
<mkdir dir="${assembly-directory}/lib/jndi" /> <phase>generate-resources</phase>
<copy todir="${assembly-directory}/lib/jndi"> <goals>
<fileset dir="${orbit-cache}"> <goal>copy-dependencies</goal>
<include name="javax.activation_${orbit-javax-activation-version}.jar" /> </goals>
<include name="javax.mail.glassfish_${orbit-javax-mail-glassfish-version}.jar" /> <configuration>
</fileset> <includeGroupIds>org.eclipse.jetty.orbit</includeGroupIds>
</copy> <includeArtifactIds>com.sun.el,javax.el,javax.servlet.jsp,javax.servlet.jsp.jstl,org.apache.jasper.glassfish,org.apache.taglibs.standard.glassfish,org.eclipse.jdt.core</includeArtifactIds>
<includeTypes>jar</includeTypes>
<!-- ${jetty.home}/lib/jsp/ --> <outputDirectory>${assembly-directory}/lib/jsp</outputDirectory>
<mkdir dir="${assembly-directory}/lib/jsp" />
<copy todir="${assembly-directory}/lib/jsp">
<fileset dir="${orbit-cache}">
<include name="javax.el_${orbit-javax-el-version}.jar" />
<include name="javax.servlet.jsp_${orbit-javax-servlet-jsp-version}.jar" />
<include name="javax.servlet.jsp.jstl_${orbit-javax-servlet-jsp-jstl-version}.jar" />
<include name="com.sun.el_${orbit-com-sun-el-version}.jar" />
<include name="org.apache.jasper.glassfish_${orbit-org-apache-jasper-version}.jar" />
<include name="org.apache.taglibs.standard.glassfish_${orbit-org-apache-taglibs-standard-version}.jar" />
<include name="ecj-${eclipse-ecj-version}.jar" />
</fileset>
<!--fileset dir="${orbit-cache}/${eclipse-drop}">
<include name="ecj-${eclipse-ecj-version}.jar" />
</fileset-->
</copy>
</tasks>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId> <artifactId>maven-eclipse-plugin</artifactId>
@ -260,7 +262,6 @@
</sourceExcludes> </sourceExcludes>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View File

@ -14,8 +14,7 @@
// ======================================================================== // ========================================================================
package org.eclipse.jetty.osgi.boot; package org.eclipse.jetty.osgi.boot;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.CoreOptions.*;
import static org.ops4j.pax.exam.CoreOptions.options;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -61,17 +60,18 @@ public class TestJettyOSGiBootCore
* Jetty-osgi including webapp support and also jetty-client. * Jetty-osgi including webapp support and also jetty-client.
* Sets the system property jetty.home.bunde=org.eclipse.jetty.osgi.boot * Sets the system property jetty.home.bunde=org.eclipse.jetty.osgi.boot
* to use the jetty server configuration embedded in * to use the jetty server configuration embedded in
* @return *
* @return list of options
*/ */
public static List<Option> provisionCoreJetty() public static List<Option> provisionCoreJetty()
{ {
return Arrays.asList(options( return Arrays.asList(options(
//get the jetty home config from the osgi boot bundle. // get the jetty home config from the osgi boot bundle.
PaxRunnerOptions.vmOptions("-Djetty.port=9876 -D" + DefaultJettyAtJettyHomeHelper.SYS_PROP_JETTY_HOME_BUNDLE + "=org.eclipse.jetty.osgi.boot"), PaxRunnerOptions.vmOptions("-Djetty.port=9876 -D" + DefaultJettyAtJettyHomeHelper.SYS_PROP_JETTY_HOME_BUNDLE + "=org.eclipse.jetty.osgi.boot"),
// CoreOptions.equinox(), // CoreOptions.equinox(),
mavenBundle().groupId( "org.mortbay.jetty" ).artifactId( "servlet-api" ).versionAsInProject().noStart(), mavenBundle().groupId( "org.eclipse.jetty.orbit" ).artifactId( "javax.servlet" ).versionAsInProject().noStart(),
mavenBundle().groupId( "org.eclipse.osgi" ).artifactId( "org.eclipse.osgi" ).versionAsInProject().noStart(), mavenBundle().groupId( "org.eclipse.osgi" ).artifactId( "org.eclipse.osgi" ).versionAsInProject().noStart(),
mavenBundle().groupId( "org.eclipse.osgi" ).artifactId( "org.eclipse.osgi.services" ).versionAsInProject().noStart(), mavenBundle().groupId( "org.eclipse.osgi" ).artifactId( "org.eclipse.osgi.services" ).versionAsInProject().noStart(),
@ -85,10 +85,11 @@ public class TestJettyOSGiBootCore
mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-io" ).versionAsInProject().noStart(), mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-io" ).versionAsInProject().noStart(),
mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-continuation" ).versionAsInProject().noStart(), mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-continuation" ).versionAsInProject().noStart(),
mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-security" ).versionAsInProject().noStart(), mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-security" ).versionAsInProject().noStart(),
mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-websocket" ).versionAsInProject().noStart(),
mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-servlets" ).versionAsInProject().noStart(),
mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-client" ).versionAsInProject().noStart() mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-client" ).versionAsInProject().noStart()
)); ));
} }
@Inject @Inject
@ -154,6 +155,7 @@ public class TestJettyOSGiBootCore
HttpService http = (HttpService)bundleContext.getService(sr); HttpService http = (HttpService)bundleContext.getService(sr);
http.registerServlet("/greetings", new HttpServlet() { http.registerServlet("/greetings", new HttpServlet() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Override
protected void doGet(HttpServletRequest req, protected void doGet(HttpServletRequest req,
HttpServletResponse resp) throws ServletException, HttpServletResponse resp) throws ServletException,
IOException { IOException {

View File

@ -14,8 +14,7 @@
// ======================================================================== // ========================================================================
package org.eclipse.jetty.osgi.boot; package org.eclipse.jetty.osgi.boot;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.CoreOptions.*;
import static org.ops4j.pax.exam.CoreOptions.options;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
@ -32,7 +31,6 @@ import org.eclipse.jetty.http.HttpMethods;
import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.http.HttpStatus;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.Inject; import org.ops4j.pax.exam.Inject;
import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.container.def.PaxRunnerOptions; import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
@ -48,10 +46,12 @@ import org.osgi.framework.BundleContext;
@RunWith( JUnit4TestRunner.class ) @RunWith( JUnit4TestRunner.class )
public class TestJettyOSGiBootWithJsp public class TestJettyOSGiBootWithJsp
{ {
private static final boolean LOGGING_ENABLED = false;
private static final boolean REMOTE_DEBUGGING = false;
@Inject @Inject
BundleContext bundleContext = null; BundleContext bundleContext = null;
@Configuration @Configuration
public static Option[] configure() public static Option[] configure()
{ {
@ -59,29 +59,48 @@ public class TestJettyOSGiBootWithJsp
ArrayList<Option> options = new ArrayList<Option>(); ArrayList<Option> options = new ArrayList<Option>();
options.addAll(TestJettyOSGiBootCore.provisionCoreJetty()); options.addAll(TestJettyOSGiBootCore.provisionCoreJetty());
// Enable Logging
if(LOGGING_ENABLED) {
options.addAll(Arrays.asList(options(
// install log service using pax runners profile abstraction (there are more profiles, like DS)
// logProfile(),
// this is how you set the default log level when using pax logging (logProfile)
systemProperty( "org.ops4j.pax.logging.DefaultServiceLog.level" ).value( "INFO" )
)));
}
// Remote JDWP Debugging
if(REMOTE_DEBUGGING) {
options.addAll(Arrays.asList(options(
// this just adds all what you write here to java vm argumenents of the (new) osgi process.
PaxRunnerOptions.vmOption( "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006" )
)));
}
// Standard Options
options.addAll(Arrays.asList(options( options.addAll(Arrays.asList(options(
// install log service using pax runners profile abstraction (there are more profiles, like DS) PaxRunnerOptions.vmOption("-Djetty.port=9876 -D" + OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS +
//logProfile(), "=etc/jetty.xml;" + testrealm.getAbsolutePath()),
// this is how you set the default log level when using pax logging (logProfile)
//systemProperty( "org.ops4j.pax.logging.DefaultServiceLog.level" ).value( "INFO" ),
// this just adds all what you write here to java vm argumenents of the (new) osgi process. /* orbit deps */
// PaxRunnerOptions.vmOption( "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006" ), mavenBundle().groupId( "org.eclipse.jetty.orbit" ).artifactId( "javax.servlet.jsp" ).versionAsInProject(),
mavenBundle().groupId( "org.eclipse.jetty.orbit" ).artifactId( "javax.servlet.jsp.jstl" ).versionAsInProject(),
mavenBundle().groupId( "org.eclipse.jetty.orbit" ).artifactId( "javax.el" ).versionAsInProject(),
mavenBundle().groupId( "org.eclipse.jetty.orbit" ).artifactId( "com.sun.el" ).versionAsInProject(),
mavenBundle().groupId( "org.eclipse.jetty.orbit" ).artifactId( "org.apache.jasper.glassfish" ).versionAsInProject(),
mavenBundle().groupId( "org.eclipse.jetty.orbit" ).artifactId( "org.apache.taglibs.standard.glassfish" ).versionAsInProject(),
mavenBundle().groupId( "org.eclipse.jetty.orbit" ).artifactId( "org.eclipse.jdt.core" ).versionAsInProject(),
PaxRunnerOptions.vmOption("-Djetty.port=9876 -D" + OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS + /* jetty-osgi deps */
"=etc/jetty.xml;" + testrealm.getAbsolutePath()), mavenBundle().groupId( "org.eclipse.jetty.osgi" ).artifactId( "jetty-osgi-boot" ).versionAsInProject().start(),
mavenBundle().groupId( "org.eclipse.jetty.osgi" ).artifactId( "jetty-osgi-boot-jsp" ).versionAsInProject().start(),
mavenBundle().groupId( "org.eclipse.jetty.osgi" ).artifactId( "jetty-osgi-boot" ).versionAsInProject(), mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "test-jetty-webapp" ).classifier("webbundle").versionAsInProject()
mavenBundle().groupId( "org.eclipse.jetty.osgi" ).artifactId( "jetty-osgi-boot-jsp" ).versionAsInProject(),
mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-websocket" ).versionAsInProject(),
mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-servlets" ).versionAsInProject(),
mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "test-jetty-webapp" ).classifier("webbundle").versionAsInProject(),
//the jsp bundles downloaded from eclipse orbit website and the ecj jar.
// CoreOptions.provision( PaxRunnerOptions.scanDir( "jasper" ) ),
CoreOptions.provision( PaxRunnerOptions.scanDir( "target/distribution/lib/jsp" ) )
// mavenBundle().groupId( "org.eclipse.equinox.http" ).artifactId( "servlet" ).versionAsInProject().start()
))); )));
return options.toArray(new Option[options.size()]); return options.toArray(new Option[options.size()]);
} }

69
pom.xml
View File

@ -13,6 +13,7 @@
<properties> <properties>
<javax-activation-version>1.1</javax-activation-version> <javax-activation-version>1.1</javax-activation-version>
<javax-mail-version>1.4.1</javax-mail-version> <javax-mail-version>1.4.1</javax-mail-version>
<orbit-servlet-api-version>2.5.0.v201103041518</orbit-servlet-api-version>
<javax-servlet-jsp-version>2.1.v20100127</javax-servlet-jsp-version> <javax-servlet-jsp-version>2.1.v20100127</javax-servlet-jsp-version>
<javax-transaction-version>1.1.1</javax-transaction-version> <javax-transaction-version>1.1.1</javax-transaction-version>
<jetty.url>http://www.eclipse.org/jetty</jetty.url> <jetty.url>http://www.eclipse.org/jetty</jetty.url>
@ -362,6 +363,74 @@
</modules> </modules>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<!-- Orbit Deps -->
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.servlet</artifactId>
<version>${orbit-servlet-api-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.annotation</artifactId>
<version>1.1.0.v201108011116</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>org.objectweb.asm</artifactId>
<version>3.1.0.v200803061910</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.activation</artifactId>
<version>1.1.0.v201105071233</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.mail.glassfish</artifactId>
<version>1.4.1.v201005082020</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.transaction</artifactId>
<version>1.1.1.v201105210645</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.el</artifactId>
<version>2.1.0.v201105211819</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.servlet.jsp</artifactId>
<version>2.1.0.v201105211820</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.servlet.jsp.jstl</artifactId>
<version>1.2.0.v201105211821</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>com.sun.el</artifactId>
<version>1.0.0.v201105211818</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>org.apache.jasper.glassfish</artifactId>
<version>2.1.0.v201110031002</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>org.apache.taglibs.standard.glassfish</artifactId>
<version>1.2.0.v201112081803</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
<version>3.7.1</version>
</dependency>
<!-- Old Deps -->
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId> <artifactId>servlet-api</artifactId>