Switch to apache-jsp for jetty-osgi
This commit is contained in:
parent
21d590a74a
commit
c0aef8975d
|
@ -26,6 +26,7 @@
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<instructions>
|
<instructions>
|
||||||
|
<Bundle-Description>Jetty-specific ServletContainerInitializer for Jasper</Bundle-Description>
|
||||||
<Export-Package>org.eclipse.jetty.apache.jsp.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"</Export-Package>
|
<Export-Package>org.eclipse.jetty.apache.jsp.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"</Export-Package>
|
||||||
<Require-Capability>osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)"</Require-Capability>
|
<Require-Capability>osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)"</Require-Capability>
|
||||||
<Provide-Capability>osgi.serviceloader; osgi.serviceloader=javax.servlet.ServletContainerInitializer</Provide-Capability>
|
<Provide-Capability>osgi.serviceloader; osgi.serviceloader=javax.servlet.ServletContainerInitializer</Provide-Capability>
|
||||||
|
@ -35,6 +36,29 @@
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>artifact-jar</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>test-jar</id>
|
||||||
|
<goals>
|
||||||
|
<goal>test-jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
|
|
@ -39,10 +39,31 @@
|
||||||
<!-- Orbit JSP Deps -->
|
<!-- Orbit JSP Deps -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>jetty-jsp</artifactId>
|
<artifactId>apache-jsp</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||||
|
<artifactId>javax.servlet.jsp.jstl</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.glassfish.web</groupId>
|
||||||
|
<artifactId>javax.servlet.jsp.jstl</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mortbay.jasper</groupId>
|
||||||
|
<artifactId>apache-el</artifactId>
|
||||||
|
<version>8.0.9-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
<!--
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.el</groupId>
|
||||||
|
<artifactId>javax.el-api</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
-->
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
@ -96,7 +117,7 @@
|
||||||
javax.el;version="[3.0,3.1)",
|
javax.el;version="[3.0,3.1)",
|
||||||
javax.servlet;version="[3.1,3.2)",
|
javax.servlet;version="[3.1,3.2)",
|
||||||
javax.servlet.resources;version="[3.1,3.2)",
|
javax.servlet.resources;version="[3.1,3.2)",
|
||||||
javax.servlet.jsp.resources;version="[3.1,3.2)",
|
javax.servlet.jsp.resources;version="[2.3,4)",
|
||||||
javax.servlet.jsp;version="[2.3,2.4)",
|
javax.servlet.jsp;version="[2.3,2.4)",
|
||||||
javax.servlet.jsp.el;version="[2.3,2.4)",
|
javax.servlet.jsp.el;version="[2.3,2.4)",
|
||||||
javax.servlet.jsp.tagext;version="[2.3,2.4)",
|
javax.servlet.jsp.tagext;version="[2.3,2.4)",
|
||||||
|
@ -104,16 +125,20 @@
|
||||||
javax.servlet.jsp.jstl.fmt;version="1.2";resolution:=optional,
|
javax.servlet.jsp.jstl.fmt;version="1.2";resolution:=optional,
|
||||||
javax.servlet.jsp.jstl.sql;version="1.2";resolution:=optional,
|
javax.servlet.jsp.jstl.sql;version="1.2";resolution:=optional,
|
||||||
javax.servlet.jsp.jstl.tlv;version="1.2";resolution:=optional,
|
javax.servlet.jsp.jstl.tlv;version="1.2";resolution:=optional,
|
||||||
org.apache.jasper;version="[2.3.2,2.4)";resolution:=optional,
|
org.apache.el;version="[8.0.9,9)";resolution:=optional,
|
||||||
org.apache.jasper.compiler;version="[2.3.2,2.4)";resolution:=optional,
|
org.apache.el.lang;version="[8.0.9,9)";resolution:=optional,
|
||||||
org.apache.jasper.compiler.tagplugin;version="[2.3.2,2.4)";resolution:=optional,
|
org.apache.el.stream;version="[8.0.9,9)";resolution:=optional,
|
||||||
org.apache.jasper.runtime;version="[2.3.2,2.4)";resolution:=optional,
|
org.apache.el.util;version="[8.0.9,9)";resolution:=optional,
|
||||||
org.apache.jasper.security;version="[2.3.2,2.4)";resolution:=optional,
|
org.apache.el.parser;version="[8.0.9,9)";resolution:=optional,
|
||||||
org.apache.jasper.servlet;version="[2.3.2,2.4)";resolution:=optional,
|
org.apache.jasper;version="[8.0.9,9)";resolution:=optional,
|
||||||
org.apache.jasper.tagplugins.jstl;version="[2.3.2,2.4)";resolution:=optional,
|
org.apache.jasper.compiler;version="[8.0.9,9)";resolution:=optional,
|
||||||
org.apache.jasper.util;version="[2.3.2,2.4)";resolution:=optional,
|
org.apache.jasper.compiler.tagplugin;version="[8.0.9,9)";resolution:=optional,
|
||||||
org.apache.jasper.xmlparser;version="[2.3.2,2.4)";resolution:=optional,
|
org.apache.jasper.runtime;version="[8.0.9,9)";resolution:=optional,
|
||||||
org.glassfish.jsp.api;version="[2.3.2,2.4)";resolution:=optional,
|
org.apache.jasper.security;version="[8.0.9,9)";resolution:=optional,
|
||||||
|
org.apache.jasper.servlet;version="[8.0.9,9)";resolution:=optional,
|
||||||
|
org.apache.jasper.tagplugins.jstl;version="[8.0.9,9)";resolution:=optional,
|
||||||
|
org.apache.jasper.util;version="[8.0.9,9)";resolution:=optional,
|
||||||
|
org.apache.jasper.xmlparser;version="[8.0.9,9)";resolution:=optional,
|
||||||
org.apache.taglibs.standard;version="1.2";resolution:=optional,
|
org.apache.taglibs.standard;version="1.2";resolution:=optional,
|
||||||
org.apache.taglibs.standard.extra.spath;version="1.2";resolution:=optional,
|
org.apache.taglibs.standard.extra.spath;version="1.2";resolution:=optional,
|
||||||
org.apache.taglibs.standard.functions;version="1.2";resolution:=optional,
|
org.apache.taglibs.standard.functions;version="1.2";resolution:=optional,
|
||||||
|
@ -137,6 +162,7 @@
|
||||||
org.apache.taglibs.standard.tag.rt.xml;version="1.2";resolution:=optional,
|
org.apache.taglibs.standard.tag.rt.xml;version="1.2";resolution:=optional,
|
||||||
org.apache.taglibs.standard.tei;version="1.2";resolution:=optional,
|
org.apache.taglibs.standard.tei;version="1.2";resolution:=optional,
|
||||||
org.apache.taglibs.standard.tlv;version="1.2";resolution:=optional,
|
org.apache.taglibs.standard.tlv;version="1.2";resolution:=optional,
|
||||||
|
org.apache.tomcat;version="[8.0.9,9)";resolution:=optional,
|
||||||
org.osgi.*,
|
org.osgi.*,
|
||||||
org.xml.*;resolution:=optional,
|
org.xml.*;resolution:=optional,
|
||||||
org.xml.sax.*;resolution:=optional,
|
org.xml.sax.*;resolution:=optional,
|
||||||
|
@ -146,7 +172,7 @@
|
||||||
javax.xml.parser;resolution:=optional
|
javax.xml.parser;resolution:=optional
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
<_nouses>true</_nouses>
|
<_nouses>true</_nouses>
|
||||||
<DynamicImport-Package>org.apache.jasper.*;version="2.3"</DynamicImport-Package>
|
<DynamicImport-Package>org.apache.jasper.*;version="8.0.9",org.apache.el.*;version="8.0.9"</DynamicImport-Package>
|
||||||
</instructions>
|
</instructions>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -27,10 +27,15 @@ import java.util.Set;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import javax.servlet.jsp.JspFactory;
|
||||||
|
|
||||||
import org.eclipse.jetty.deploy.DeploymentManager;
|
import org.eclipse.jetty.deploy.DeploymentManager;
|
||||||
|
import org.eclipse.jetty.osgi.boot.JettyBootstrapActivator;
|
||||||
import org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration;
|
import org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration;
|
||||||
import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelper;
|
import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelper;
|
||||||
import org.eclipse.jetty.osgi.boot.utils.TldBundleDiscoverer;
|
import org.eclipse.jetty.osgi.boot.utils.TldBundleDiscoverer;
|
||||||
|
import org.eclipse.jetty.util.log.Log;
|
||||||
|
import org.eclipse.jetty.util.log.Logger;
|
||||||
import org.osgi.framework.Bundle;
|
import org.osgi.framework.Bundle;
|
||||||
import org.osgi.framework.FrameworkUtil;
|
import org.osgi.framework.FrameworkUtil;
|
||||||
|
|
||||||
|
@ -39,15 +44,24 @@ import org.osgi.framework.FrameworkUtil;
|
||||||
/**
|
/**
|
||||||
* ContainerTldBundleDiscoverer
|
* ContainerTldBundleDiscoverer
|
||||||
*
|
*
|
||||||
|
* Finds bundles that are considered as on the container classpath that
|
||||||
|
* contain tlds.
|
||||||
*
|
*
|
||||||
* Use a System property to define bundles that contain tlds that need to
|
* The System property org.eclipse.jetty.osgi.tldbundles is a comma
|
||||||
* be treated by jasper as if they were on the jetty container's classpath.
|
* separated list of exact symbolic names of bundles that have container classpath
|
||||||
|
* tlds.
|
||||||
*
|
*
|
||||||
* The value of the property is evaluated against the DeploymentManager
|
* The DeploymentManager context attribute "org.eclipse.jetty.server.webapp.containerIncludeBundlePattern"
|
||||||
* context attribute "org.eclipse.jetty.server.webapp.containerIncludeBundlePattern",
|
* can be used to define a pattern of symbolic names of bundles that contain container
|
||||||
* which defines a pattern of matching bundle names.
|
* classpath tlds.
|
||||||
*
|
*
|
||||||
* The bundle locations are converted to URLs for jasper's use.
|
* The matching bundles are converted to URLs that are put onto a special classloader that acts as the
|
||||||
|
* parent classloader for contexts deployed by the jetty Server instance (see ServerInstanceWrapper).
|
||||||
|
*
|
||||||
|
* It also discovers the bundle that contains the jstl taglib and adds it into the
|
||||||
|
* "org.eclipse.jetty.server.webapp.containerIncludeBundlePattern" (if it is not already there) so
|
||||||
|
* that the WebInfOSGiConfiguration class will add the jstl taglib bundle into the list of container
|
||||||
|
* resources.
|
||||||
*
|
*
|
||||||
* Eg:
|
* Eg:
|
||||||
* -Dorg.eclipse.jetty.osgi.tldbundles=org.springframework.web.servlet,com.opensymphony.module.sitemesh
|
* -Dorg.eclipse.jetty.osgi.tldbundles=org.springframework.web.servlet,com.opensymphony.module.sitemesh
|
||||||
|
@ -55,15 +69,19 @@ import org.osgi.framework.FrameworkUtil;
|
||||||
*/
|
*/
|
||||||
public class ContainerTldBundleDiscoverer implements TldBundleDiscoverer
|
public class ContainerTldBundleDiscoverer implements TldBundleDiscoverer
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private static final Logger LOG = Log.getLogger(ContainerTldBundleDiscoverer.class);
|
||||||
|
|
||||||
|
|
||||||
|
private static String DEFAULT_JSP_FACTORY_IMPL_CLASS = "org.apache.jasper.runtime.JspFactoryImpl";
|
||||||
/**
|
/**
|
||||||
* Comma separated list of names of bundles that contain tld files that should be
|
* Default name of a class that belongs to the jstl bundle. From that class
|
||||||
* discoved by jasper as if they were on the container's classpath.
|
* we locate the corresponding bundle and register it as a bundle that
|
||||||
* Eg:
|
* contains tld files.
|
||||||
* -Djetty.osgi.tldbundles=org.springframework.web.servlet,com.opensymphony.module.sitemesh
|
|
||||||
*/
|
*/
|
||||||
public static final String SYS_PROP_TLD_BUNDLES = "org.eclipse.jetty.osgi.tldbundles";
|
private static String DEFAULT_JSTL_BUNDLE_CLASS = "org.apache.taglibs.standard.tag.el.core.WhenTag";
|
||||||
|
|
||||||
|
|
||||||
|
private Bundle jstlBundle = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the System property "org.eclipse.jetty.osgi.tldbundles" for names of
|
* Check the System property "org.eclipse.jetty.osgi.tldbundles" for names of
|
||||||
|
@ -73,18 +91,17 @@ public class ContainerTldBundleDiscoverer implements TldBundleDiscoverer
|
||||||
*/
|
*/
|
||||||
public URL[] getUrlsForBundlesWithTlds(DeploymentManager deploymentManager, BundleFileLocatorHelper locatorHelper) throws Exception
|
public URL[] getUrlsForBundlesWithTlds(DeploymentManager deploymentManager, BundleFileLocatorHelper locatorHelper) throws Exception
|
||||||
{
|
{
|
||||||
// naive way of finding those bundles.
|
if (!isJspAvailable())
|
||||||
// lots of assumptions: for example we assume a single version of each
|
{
|
||||||
// bundle that would contain tld files.
|
return new URL[0];
|
||||||
// this is probably good enough as those tlds are loaded system-wide on
|
}
|
||||||
// jetty.
|
|
||||||
// to do better than this we need to do it on a per webapp basis.
|
if (jstlBundle == null)
|
||||||
// probably using custom properties in the ContextHandler service
|
jstlBundle = findJstlBundle();
|
||||||
// and mirroring those in the MANIFEST.MF
|
|
||||||
|
|
||||||
Bundle[] bundles = FrameworkUtil.getBundle(ContainerTldBundleDiscoverer.class).getBundleContext().getBundles();
|
Bundle[] bundles = FrameworkUtil.getBundle(ContainerTldBundleDiscoverer.class).getBundleContext().getBundles();
|
||||||
HashSet<URL> urls = new HashSet<URL>();
|
HashSet<URL> urls = new HashSet<URL>();
|
||||||
String tmp = System.getProperty(SYS_PROP_TLD_BUNDLES); //comma separated exact names
|
String tmp = System.getProperty(OSGiWebInfConfiguration.SYS_PROP_TLD_BUNDLES); //comma separated exact names
|
||||||
List<String> sysNames = new ArrayList<String>();
|
List<String> sysNames = new ArrayList<String>();
|
||||||
if (tmp != null)
|
if (tmp != null)
|
||||||
{
|
{
|
||||||
|
@ -93,13 +110,33 @@ public class ContainerTldBundleDiscoverer implements TldBundleDiscoverer
|
||||||
sysNames.add(tokenizer.nextToken());
|
sysNames.add(tokenizer.nextToken());
|
||||||
}
|
}
|
||||||
tmp = (String) deploymentManager.getContextAttribute(OSGiWebInfConfiguration.CONTAINER_BUNDLE_PATTERN); //bundle name patterns
|
tmp = (String) deploymentManager.getContextAttribute(OSGiWebInfConfiguration.CONTAINER_BUNDLE_PATTERN); //bundle name patterns
|
||||||
|
|
||||||
Pattern pattern = (tmp==null? null : Pattern.compile(tmp));
|
Pattern pattern = (tmp==null? null : Pattern.compile(tmp));
|
||||||
|
|
||||||
|
//check that the jstl bundle is not already included in the pattern, and include it if it is not because
|
||||||
|
//subsequent classes such as OSGiWebInfConfiguration use this pattern to determine which jars are
|
||||||
|
//considered to be on the container classpath
|
||||||
|
if (jstlBundle != null)
|
||||||
|
{
|
||||||
|
if (pattern == null)
|
||||||
|
{
|
||||||
|
pattern = Pattern.compile(jstlBundle.getSymbolicName());
|
||||||
|
deploymentManager.setContextAttribute(OSGiWebInfConfiguration.CONTAINER_BUNDLE_PATTERN, jstlBundle.getSymbolicName());
|
||||||
|
}
|
||||||
|
else if (!(pattern.matcher(jstlBundle.getSymbolicName()).matches()))
|
||||||
|
{
|
||||||
|
String s = tmp+"|"+jstlBundle.getSymbolicName();
|
||||||
|
pattern = Pattern.compile(s);
|
||||||
|
deploymentManager.setContextAttribute(OSGiWebInfConfiguration.CONTAINER_BUNDLE_PATTERN, s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (Bundle bundle : bundles)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
if (sysNames.contains(bundle.getSymbolicName()))
|
if (sysNames.contains(bundle.getSymbolicName()))
|
||||||
convertBundleLocationToURL(locatorHelper, bundle, urls);
|
convertBundleLocationToURL(locatorHelper, bundle, urls);
|
||||||
|
else if (pattern != null && pattern.matcher(bundle.getSymbolicName()).matches())
|
||||||
if (pattern != null && pattern.matcher(bundle.getSymbolicName()).matches())
|
|
||||||
convertBundleLocationToURL(locatorHelper, bundle, urls);
|
convertBundleLocationToURL(locatorHelper, bundle, urls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,6 +144,79 @@ public class ContainerTldBundleDiscoverer implements TldBundleDiscoverer
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check that jsp is on the classpath
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isJspAvailable()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
getClass().getClassLoader().loadClass("org.apache.jasper.servlet.JspServlet");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOG.warn("Unable to locate the JspServlet: jsp support unavailable.", e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Some versions of JspFactory do Class.forName, which probably won't work in an
|
||||||
|
* OSGi environment.
|
||||||
|
*/
|
||||||
|
public void fixJspFactory ()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Class<javax.servlet.ServletContext> servletContextClass = javax.servlet.ServletContext.class;
|
||||||
|
// bug #299733
|
||||||
|
JspFactory fact = JspFactory.getDefaultFactory();
|
||||||
|
if (fact == null)
|
||||||
|
{ // bug #299733
|
||||||
|
// JspFactory does a simple
|
||||||
|
// Class.getForName("org.apache.jasper.runtime.JspFactoryImpl")
|
||||||
|
// however its bundles does not import the jasper package
|
||||||
|
// so it fails. let's help things out:
|
||||||
|
fact = (JspFactory) JettyBootstrapActivator.class.getClassLoader().loadClass(DEFAULT_JSP_FACTORY_IMPL_CLASS).newInstance();
|
||||||
|
JspFactory.setDefaultFactory(fact);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOG.warn("Unable to set the JspFactory: jsp support incomplete.", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find the bundle that contains a jstl implementation class, which assumes that
|
||||||
|
* the jstl taglibs will be inside the same bundle.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Bundle findJstlBundle ()
|
||||||
|
{
|
||||||
|
Class<?> jstlClass = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
jstlClass = JSTLBundleDiscoverer.class.getClassLoader().loadClass(DEFAULT_JSTL_BUNDLE_CLASS);
|
||||||
|
}
|
||||||
|
catch (ClassNotFoundException e)
|
||||||
|
{
|
||||||
|
LOG.info("jstl not on classpath", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jstlClass != null)
|
||||||
|
//get the bundle containing jstl
|
||||||
|
return FrameworkUtil.getBundle(jstlClass);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolves a bundle that contains tld files as a URL. The URLs are
|
* Resolves a bundle that contains tld files as a URL. The URLs are
|
||||||
* used by jasper to discover the tld files.
|
* used by jasper to discover the tld files.
|
||||||
|
|
|
@ -20,9 +20,11 @@ package org.eclipse.jetty.osgi.boot.jasper;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.servlet.Servlet;
|
import javax.servlet.Servlet;
|
||||||
import javax.servlet.jsp.JspContext;
|
import javax.servlet.jsp.JspContext;
|
||||||
|
@ -30,7 +32,6 @@ import javax.servlet.jsp.JspFactory;
|
||||||
|
|
||||||
import org.apache.jasper.Constants;
|
import org.apache.jasper.Constants;
|
||||||
import org.apache.jasper.compiler.Localizer;
|
import org.apache.jasper.compiler.Localizer;
|
||||||
import org.apache.jasper.xmlparser.ParserUtils;
|
|
||||||
import org.eclipse.jetty.deploy.DeploymentManager;
|
import org.eclipse.jetty.deploy.DeploymentManager;
|
||||||
import org.eclipse.jetty.osgi.boot.JettyBootstrapActivator;
|
import org.eclipse.jetty.osgi.boot.JettyBootstrapActivator;
|
||||||
import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelper;
|
import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelper;
|
||||||
|
@ -86,9 +87,11 @@ public class JSTLBundleDiscoverer implements TldBundleDiscoverer
|
||||||
*/
|
*/
|
||||||
private static String DEFAULT_JSP_FACTORY_IMPL_CLASS = "org.apache.jasper.runtime.JspFactoryImpl";
|
private static String DEFAULT_JSP_FACTORY_IMPL_CLASS = "org.apache.jasper.runtime.JspFactoryImpl";
|
||||||
|
|
||||||
|
private static final Set<URL> __tldBundleCache = new HashSet<URL>();
|
||||||
|
|
||||||
public JSTLBundleDiscoverer()
|
public JSTLBundleDiscoverer()
|
||||||
{
|
{
|
||||||
fixupDtdResolution();
|
//fixupDtdResolution();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -102,6 +105,7 @@ public class JSTLBundleDiscoverer implements TldBundleDiscoverer
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Class<javax.servlet.ServletContext> servletContextClass = javax.servlet.ServletContext.class;
|
||||||
// bug #299733
|
// bug #299733
|
||||||
JspFactory fact = JspFactory.getDefaultFactory();
|
JspFactory fact = JspFactory.getDefaultFactory();
|
||||||
if (fact == null)
|
if (fact == null)
|
||||||
|
@ -143,7 +147,7 @@ public class JSTLBundleDiscoverer implements TldBundleDiscoverer
|
||||||
{
|
{
|
||||||
|
|
||||||
ArrayList<URL> urls = new ArrayList<URL>();
|
ArrayList<URL> urls = new ArrayList<URL>();
|
||||||
HashSet<Class<?>> classesToAddToTheTldBundles = new HashSet<Class<?>>();
|
Class<?> jstlClass = null;
|
||||||
|
|
||||||
// Look for the jstl bundle
|
// Look for the jstl bundle
|
||||||
// We assume the jstl's tlds are defined there.
|
// We assume the jstl's tlds are defined there.
|
||||||
|
@ -151,18 +155,21 @@ public class JSTLBundleDiscoverer implements TldBundleDiscoverer
|
||||||
// So we can look for this class using this bundle's classloader:
|
// So we can look for this class using this bundle's classloader:
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Class<?> jstlClass = JSTLBundleDiscoverer.class.getClassLoader().loadClass(DEFAULT_JSTL_BUNDLE_CLASS);
|
jstlClass = JSTLBundleDiscoverer.class.getClassLoader().loadClass(DEFAULT_JSTL_BUNDLE_CLASS);
|
||||||
|
|
||||||
classesToAddToTheTldBundles.add(jstlClass);
|
|
||||||
}
|
}
|
||||||
catch (ClassNotFoundException e)
|
catch (ClassNotFoundException e)
|
||||||
{
|
{
|
||||||
LOG.info("jstl not on classpath", e);
|
LOG.info("jstl not on classpath", e);
|
||||||
}
|
}
|
||||||
for (Class<?> cl : classesToAddToTheTldBundles)
|
|
||||||
|
if (jstlClass != null)
|
||||||
{
|
{
|
||||||
Bundle tldBundle = FrameworkUtil.getBundle(cl);
|
//get the bundle containing jstl
|
||||||
|
Bundle tldBundle = FrameworkUtil.getBundle(jstlClass);
|
||||||
File tldBundleLocation = locatorHelper.getBundleInstallLocation(tldBundle);
|
File tldBundleLocation = locatorHelper.getBundleInstallLocation(tldBundle);
|
||||||
|
|
||||||
|
System.err.println("jstl bundle: "+tldBundle);
|
||||||
|
System.err.println("jstl bundle location: "+tldBundleLocation);
|
||||||
if (tldBundleLocation != null && tldBundleLocation.isDirectory())
|
if (tldBundleLocation != null && tldBundleLocation.isDirectory())
|
||||||
{
|
{
|
||||||
// try to find the jar files inside this folder
|
// try to find the jar files inside this folder
|
||||||
|
@ -170,6 +177,7 @@ public class JSTLBundleDiscoverer implements TldBundleDiscoverer
|
||||||
{
|
{
|
||||||
if (f.getName().endsWith(".jar") && f.isFile())
|
if (f.getName().endsWith(".jar") && f.isFile())
|
||||||
{
|
{
|
||||||
|
System.err.println("Tld jar in dir: "+f.toURI());
|
||||||
urls.add(f.toURI().toURL());
|
urls.add(f.toURI().toURL());
|
||||||
}
|
}
|
||||||
else if (f.isDirectory() && f.getName().equals("lib"))
|
else if (f.isDirectory() && f.getName().equals("lib"))
|
||||||
|
@ -178,6 +186,7 @@ public class JSTLBundleDiscoverer implements TldBundleDiscoverer
|
||||||
{
|
{
|
||||||
if (f2.getName().endsWith(".jar") && f2.isFile())
|
if (f2.getName().endsWith(".jar") && f2.isFile())
|
||||||
{
|
{
|
||||||
|
System.err.println("Tld jar in lib dir: "+f2.toURI());
|
||||||
urls.add(f2.toURI().toURL());
|
urls.add(f2.toURI().toURL());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,9 +196,20 @@ public class JSTLBundleDiscoverer implements TldBundleDiscoverer
|
||||||
}
|
}
|
||||||
else if (tldBundleLocation != null)
|
else if (tldBundleLocation != null)
|
||||||
{
|
{
|
||||||
|
System.err.println("Tld bundle uri: "+tldBundleLocation.toURI());
|
||||||
urls.add(tldBundleLocation.toURI().toURL());
|
urls.add(tldBundleLocation.toURI().toURL());
|
||||||
|
|
||||||
|
String pattern = (String)deployer.getContextAttribute("org.eclipse.jetty.server.webapp.containerIncludeBundlePattern");
|
||||||
|
pattern = (pattern==null?"":pattern);
|
||||||
|
if (!pattern.contains(tldBundle.getSymbolicName()))
|
||||||
|
{
|
||||||
|
pattern += "|"+tldBundle.getSymbolicName();
|
||||||
|
deployer.setContextAttribute("org.eclipse.jetty.server.webapp.containerIncludeBundlePattern", pattern);
|
||||||
|
}
|
||||||
|
System.err.println("PATTERN: "+pattern);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return urls.toArray(new URL[urls.size()]);
|
return urls.toArray(new URL[urls.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +233,8 @@ public class JSTLBundleDiscoverer implements TldBundleDiscoverer
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ParserUtils.setEntityResolver(new MyFixedupEntityResolver());
|
// ParserUtils.setEntityResolver(new MyFixedupEntityResolver());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -227,21 +248,21 @@ public class JSTLBundleDiscoverer implements TldBundleDiscoverer
|
||||||
* Instead of using the ParserUtil's classloader, we use a class that is
|
* Instead of using the ParserUtil's classloader, we use a class that is
|
||||||
* indeed next to the resource for sure.
|
* indeed next to the resource for sure.
|
||||||
*/
|
*/
|
||||||
static class MyFixedupEntityResolver implements EntityResolver
|
//static class MyFixedupEntityResolver implements EntityResolver
|
||||||
{
|
//{
|
||||||
/**
|
/**
|
||||||
* Same values than in ParserUtils...
|
* Same values than in ParserUtils...
|
||||||
*/
|
*/
|
||||||
static final String[] CACHED_DTD_PUBLIC_IDS = { Constants.TAGLIB_DTD_PUBLIC_ID_11, Constants.TAGLIB_DTD_PUBLIC_ID_12,
|
/* static final String[] CACHED_DTD_PUBLIC_IDS = { Constants.TAGLIB_DTD_PUBLIC_ID_11, Constants.TAGLIB_DTD_PUBLIC_ID_12,
|
||||||
Constants.WEBAPP_DTD_PUBLIC_ID_22, Constants.WEBAPP_DTD_PUBLIC_ID_23, };
|
Constants.WEBAPP_DTD_PUBLIC_ID_22, Constants.WEBAPP_DTD_PUBLIC_ID_23, };
|
||||||
|
|
||||||
static final String[] CACHED_DTD_RESOURCE_PATHS = { Constants.TAGLIB_DTD_RESOURCE_PATH_11, Constants.TAGLIB_DTD_RESOURCE_PATH_12,
|
static final String[] CACHED_DTD_RESOURCE_PATHS = { Constants.TAGLIB_DTD_RESOURCE_PATH_11, Constants.TAGLIB_DTD_RESOURCE_PATH_12,
|
||||||
Constants.WEBAPP_DTD_RESOURCE_PATH_22, Constants.WEBAPP_DTD_RESOURCE_PATH_23, };
|
Constants.WEBAPP_DTD_RESOURCE_PATH_22, Constants.WEBAPP_DTD_RESOURCE_PATH_23, };
|
||||||
|
|
||||||
static final String[] CACHED_SCHEMA_RESOURCE_PATHS = { Constants.TAGLIB_SCHEMA_RESOURCE_PATH_20, Constants.TAGLIB_SCHEMA_RESOURCE_PATH_21,
|
static final String[] CACHED_SCHEMA_RESOURCE_PATHS = { Constants.TAGLIB_SCHEMA_RESOURCE_PATH_20, Constants.TAGLIB_SCHEMA_RESOURCE_PATH_21,
|
||||||
Constants.WEBAPP_SCHEMA_RESOURCE_PATH_24, Constants.WEBAPP_SCHEMA_RESOURCE_PATH_25, };
|
Constants.WEBAPP_SCHEMA_RESOURCE_PATH_24, Constants.WEBAPP_SCHEMA_RESOURCE_PATH_25, };*/
|
||||||
|
|
||||||
public InputSource resolveEntity(String publicId, String systemId) throws SAXException
|
/* public InputSource resolveEntity(String publicId, String systemId) throws SAXException
|
||||||
{
|
{
|
||||||
for (int i = 0; i < CACHED_DTD_PUBLIC_IDS.length; i++)
|
for (int i = 0; i < CACHED_DTD_PUBLIC_IDS.length; i++)
|
||||||
{
|
{
|
||||||
|
@ -255,10 +276,10 @@ public class JSTLBundleDiscoverer implements TldBundleDiscoverer
|
||||||
{
|
{
|
||||||
input = JspContext.class.getResourceAsStream(resourcePath);
|
input = JspContext.class.getResourceAsStream(resourcePath);
|
||||||
if (input == null)
|
if (input == null)
|
||||||
{
|
{*/
|
||||||
// if that failed try again with the original code:
|
// if that failed try again with the original code:
|
||||||
// although it is likely not changed.
|
// although it is likely not changed.
|
||||||
input = this.getClass().getResourceAsStream(resourcePath);
|
/* input = this.getClass().getResourceAsStream(resourcePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (input == null) { throw new SAXException(Localizer.getMessage("jsp.error.internal.filenotfound", resourcePath)); }
|
if (input == null) { throw new SAXException(Localizer.getMessage("jsp.error.internal.filenotfound", resourcePath)); }
|
||||||
|
@ -269,6 +290,6 @@ public class JSTLBundleDiscoverer implements TldBundleDiscoverer
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,17 +18,16 @@
|
||||||
|
|
||||||
package org.eclipse.jetty.osgi.boot.jsp;
|
package org.eclipse.jetty.osgi.boot.jsp;
|
||||||
|
|
||||||
import org.eclipse.jetty.osgi.boot.BundleWebAppProvider;
|
|
||||||
import org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper;
|
import org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper;
|
||||||
import org.eclipse.jetty.osgi.boot.jasper.ContainerTldBundleDiscoverer;
|
import org.eclipse.jetty.osgi.boot.jasper.ContainerTldBundleDiscoverer;
|
||||||
import org.eclipse.jetty.osgi.boot.jasper.JSTLBundleDiscoverer;
|
|
||||||
import org.osgi.framework.BundleActivator;
|
import org.osgi.framework.BundleActivator;
|
||||||
import org.osgi.framework.BundleContext;
|
import org.osgi.framework.BundleContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FragmentActivator
|
* FragmentActivator
|
||||||
*
|
*
|
||||||
* Sets up support for jsp. All relevant jsp jars must also be installed
|
* Sets up support for jsp and jstl. All relevant jsp jars must also be installed
|
||||||
* into the osgi environment.
|
* into the osgi environment.
|
||||||
* <p>
|
* <p>
|
||||||
* Note that as this is part of a bundle fragment, this activator is NOT
|
* Note that as this is part of a bundle fragment, this activator is NOT
|
||||||
|
@ -54,7 +53,6 @@ public class FragmentActivator implements BundleActivator
|
||||||
//set up some classes that will look for bundles with tlds that must be converted
|
//set up some classes that will look for bundles with tlds that must be converted
|
||||||
//to urls and treated as if they are on the Jetty container's classpath so that
|
//to urls and treated as if they are on the Jetty container's classpath so that
|
||||||
//jasper can deal with them
|
//jasper can deal with them
|
||||||
ServerInstanceWrapper.addContainerTldBundleDiscoverer(new JSTLBundleDiscoverer());
|
|
||||||
ServerInstanceWrapper.addContainerTldBundleDiscoverer(new ContainerTldBundleDiscoverer());
|
ServerInstanceWrapper.addContainerTldBundleDiscoverer(new ContainerTldBundleDiscoverer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,10 @@ public class AnnotationConfiguration extends org.eclipse.jetty.annotations.Annot
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public AnnotationConfiguration()
|
||||||
|
{
|
||||||
|
System.err.println("Constructed osgi.AnnotationConfiguration");
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* This parser scans the bundles using the OSGi APIs instead of assuming a jar.
|
* This parser scans the bundles using the OSGi APIs instead of assuming a jar.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -268,6 +268,7 @@ public abstract class AbstractWebAppProvider extends AbstractLifeCycle implement
|
||||||
|
|
||||||
//Sets the location of the war file
|
//Sets the location of the war file
|
||||||
// converts bundleentry: protocol if necessary
|
// converts bundleentry: protocol if necessary
|
||||||
|
System.err.println("WAR : "+BundleFileLocatorHelperFactory.getFactory().getHelper().getLocalURL(url).toString());
|
||||||
_webApp.setWar(BundleFileLocatorHelperFactory.getFactory().getHelper().getLocalURL(url).toString());
|
_webApp.setWar(BundleFileLocatorHelperFactory.getFactory().getHelper().getLocalURL(url).toString());
|
||||||
|
|
||||||
// Set up what has been configured on the provider
|
// Set up what has been configured on the provider
|
||||||
|
|
|
@ -50,7 +50,14 @@ public class OSGiWebInfConfiguration extends WebInfConfiguration
|
||||||
{
|
{
|
||||||
private static final Logger LOG = Log.getLogger(WebInfConfiguration.class);
|
private static final Logger LOG = Log.getLogger(WebInfConfiguration.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Comma separated list of symbolic names of bundles that contain tlds that should be considered
|
||||||
|
* as on the container classpath
|
||||||
|
*/
|
||||||
|
public static final String SYS_PROP_TLD_BUNDLES = "org.eclipse.jetty.osgi.tldbundles";
|
||||||
|
/**
|
||||||
|
* Regex of symbolic names of bundles that should be considered to be on the container classpath
|
||||||
|
*/
|
||||||
public static final String CONTAINER_BUNDLE_PATTERN = "org.eclipse.jetty.server.webapp.containerIncludeBundlePattern";
|
public static final String CONTAINER_BUNDLE_PATTERN = "org.eclipse.jetty.server.webapp.containerIncludeBundlePattern";
|
||||||
public static final String FRAGMENT_AND_REQUIRED_BUNDLES = "org.eclipse.jetty.osgi.fragmentAndRequiredBundles";
|
public static final String FRAGMENT_AND_REQUIRED_BUNDLES = "org.eclipse.jetty.osgi.fragmentAndRequiredBundles";
|
||||||
public static final String FRAGMENT_AND_REQUIRED_RESOURCES = "org.eclipse.jetty.osgi.fragmentAndRequiredResources";
|
public static final String FRAGMENT_AND_REQUIRED_RESOURCES = "org.eclipse.jetty.osgi.fragmentAndRequiredResources";
|
||||||
|
@ -84,7 +91,7 @@ public class OSGiWebInfConfiguration extends WebInfConfiguration
|
||||||
String tmp = (String)context.getAttribute(CONTAINER_BUNDLE_PATTERN);
|
String tmp = (String)context.getAttribute(CONTAINER_BUNDLE_PATTERN);
|
||||||
Pattern pattern = (tmp==null?null:Pattern.compile(tmp));
|
Pattern pattern = (tmp==null?null:Pattern.compile(tmp));
|
||||||
List<String> names = new ArrayList<String>();
|
List<String> names = new ArrayList<String>();
|
||||||
tmp = System.getProperty("org.eclipse.jetty.osgi.tldbundles");
|
tmp = System.getProperty(SYS_PROP_TLD_BUNDLES);
|
||||||
if (tmp != null)
|
if (tmp != null)
|
||||||
{
|
{
|
||||||
StringTokenizer tokenizer = new StringTokenizer(tmp, ", \n\r\t", false);
|
StringTokenizer tokenizer = new StringTokenizer(tmp, ", \n\r\t", false);
|
||||||
|
|
|
@ -97,6 +97,13 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<?> loadClass(String name) throws ClassNotFoundException
|
||||||
|
{
|
||||||
|
System.err.println("LOADING CLASS: "+name);
|
||||||
|
return super.loadClass(name);
|
||||||
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
/**
|
/**
|
||||||
* Returns the <code>Bundle</code> that defined this web-application.
|
* Returns the <code>Bundle</code> that defined this web-application.
|
||||||
|
|
|
@ -130,12 +130,7 @@
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
|
||||||
<artifactId>jetty-jsp-fragment</artifactId>
|
|
||||||
<version>2.3.3</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||||
<artifactId>jetty-httpservice</artifactId>
|
<artifactId>jetty-httpservice</artifactId>
|
||||||
|
@ -144,10 +139,11 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||||
<artifactId>javax.servlet-api</artifactId>
|
<artifactId>jetty-osgi-servlet-api</artifactId>
|
||||||
<scope>test</scope>
|
<version>3.1-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
<artifactId>geronimo-jta_1.1_spec</artifactId>
|
<artifactId>geronimo-jta_1.1_spec</artifactId>
|
||||||
|
@ -168,6 +164,12 @@
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mortbay.jasper</groupId>
|
||||||
|
<artifactId>apache-el</artifactId>
|
||||||
|
<version>8.0.9-SNAPSHOT</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- Jetty Deps -->
|
<!-- Jetty Deps -->
|
||||||
|
@ -341,6 +343,15 @@
|
||||||
<classifier>webbundle</classifier>
|
<classifier>webbundle</classifier>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty.tests</groupId>
|
||||||
|
<artifactId>test-spec-webapp</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
<type>war</type>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||||
<artifactId>test-jetty-osgi-context</artifactId>
|
<artifactId>test-jetty-osgi-context</artifactId>
|
||||||
|
|
|
@ -88,14 +88,11 @@ public class TestJettyOSGiBootCore
|
||||||
res.add(mavenBundle().groupId( "org.apache.aries" ).artifactId( "org.apache.aries.util" ).versionAsInProject().start());
|
res.add(mavenBundle().groupId( "org.apache.aries" ).artifactId( "org.apache.aries.util" ).versionAsInProject().start());
|
||||||
res.add(mavenBundle().groupId( "org.apache.aries.spifly" ).artifactId( "org.apache.aries.spifly.dynamic.bundle" ).versionAsInProject().start());
|
res.add(mavenBundle().groupId( "org.apache.aries.spifly" ).artifactId( "org.apache.aries.spifly.dynamic.bundle" ).versionAsInProject().start());
|
||||||
|
|
||||||
res.add(mavenBundle().groupId( "javax.servlet" ).artifactId( "javax.servlet-api" ).versionAsInProject().noStart());
|
res.add(mavenBundle().groupId( "org.eclipse.jetty.toolchain" ).artifactId( "jetty-osgi-servlet-api" ).versionAsInProject().noStart());
|
||||||
res.add(mavenBundle().groupId( "javax.annotation" ).artifactId( "javax.annotation-api" ).versionAsInProject().noStart());
|
res.add(mavenBundle().groupId( "javax.annotation" ).artifactId( "javax.annotation-api" ).versionAsInProject().noStart());
|
||||||
res.add(mavenBundle().groupId( "org.apache.geronimo.specs" ).artifactId( "geronimo-jta_1.1_spec" ).version("1.1.1").noStart());
|
res.add(mavenBundle().groupId( "org.apache.geronimo.specs" ).artifactId( "geronimo-jta_1.1_spec" ).version("1.1.1").noStart());
|
||||||
res.add(mavenBundle().groupId( "org.eclipse.jetty.orbit" ).artifactId( "javax.mail.glassfish" ).version( "1.4.1.v201005082020" ).noStart());
|
res.add(mavenBundle().groupId( "org.eclipse.jetty.orbit" ).artifactId( "javax.mail.glassfish" ).version( "1.4.1.v201005082020" ).noStart());
|
||||||
|
|
||||||
|
|
||||||
res.add(mavenBundle().groupId( "org.eclipse.jetty.toolchain" ).artifactId( "jetty-schemas" ).versionAsInProject().noStart());
|
|
||||||
|
|
||||||
res.add(mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-deploy" ).versionAsInProject().noStart());
|
res.add(mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-deploy" ).versionAsInProject().noStart());
|
||||||
res.add(mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-server" ).versionAsInProject().noStart());
|
res.add(mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-server" ).versionAsInProject().noStart());
|
||||||
res.add(mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-servlet" ).versionAsInProject().noStart());
|
res.add(mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-servlet" ).versionAsInProject().noStart());
|
||||||
|
@ -123,6 +120,32 @@ public class TestJettyOSGiBootCore
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<Option> consoleDependencies()
|
||||||
|
{
|
||||||
|
List<Option> res = new ArrayList<Option>();
|
||||||
|
res.add(systemProperty("osgi.console").value("6666"));
|
||||||
|
res.add(systemProperty("osgi.console.enable.builtin").value("true"));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static List<Option> jspDependencies()
|
||||||
|
{
|
||||||
|
List<Option> res = new ArrayList<Option>();
|
||||||
|
|
||||||
|
//jetty jsp bundles
|
||||||
|
res.add(mavenBundle().groupId("org.eclipse.jetty.toolchain").artifactId("jetty-schemas").versionAsInProject());
|
||||||
|
res.add(mavenBundle().groupId("org.eclipse.jetty.orbit").artifactId("javax.servlet.jsp.jstl").versionAsInProject());
|
||||||
|
res.add(mavenBundle().groupId("org.mortbay.jasper").artifactId("apache-el").versionAsInProject());
|
||||||
|
res.add(mavenBundle().groupId("org.mortbay.jasper").artifactId("apache-jsp").versionAsInProject());
|
||||||
|
res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("apache-jsp").versionAsInProject());
|
||||||
|
res.add(mavenBundle().groupId("org.glassfish.web").artifactId("javax.servlet.jsp.jstl").versionAsInProject());
|
||||||
|
res.add(mavenBundle().groupId("org.eclipse.jetty.orbit").artifactId("org.eclipse.jdt.core").versionAsInProject());
|
||||||
|
res.add(mavenBundle().groupId("org.eclipse.jetty.osgi").artifactId("jetty-osgi-boot-jsp").versionAsInProject().noStart());
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
public static List<Option> httpServiceJetty()
|
public static List<Option> httpServiceJetty()
|
||||||
{
|
{
|
||||||
List<Option> res = new ArrayList<Option>();
|
List<Option> res = new ArrayList<Option>();
|
||||||
|
|
|
@ -111,14 +111,7 @@ public class TestJettyOSGiBootWebAppAsService
|
||||||
{
|
{
|
||||||
List<Option> res = new ArrayList<Option>();
|
List<Option> res = new ArrayList<Option>();
|
||||||
|
|
||||||
//jsp bundles
|
res.addAll(TestJettyOSGiBootCore.jspDependencies());
|
||||||
res.add(mavenBundle().groupId("javax.servlet.jsp").artifactId("javax.servlet.jsp-api").versionAsInProject());
|
|
||||||
res.add(mavenBundle().groupId("org.eclipse.jetty.orbit").artifactId("javax.servlet.jsp.jstl").versionAsInProject());
|
|
||||||
res.add(mavenBundle().groupId("org.glassfish.web").artifactId("javax.servlet.jsp.jstl").versionAsInProject());
|
|
||||||
res.add(mavenBundle().groupId("org.glassfish").artifactId("javax.el").versionAsInProject());
|
|
||||||
res.add(mavenBundle().groupId("org.eclipse.jetty.orbit").artifactId("org.eclipse.jdt.core").versionAsInProject());
|
|
||||||
res.add(mavenBundle().groupId("org.eclipse.jetty.toolchain").artifactId("jetty-jsp-fragment").versionAsInProject().noStart());
|
|
||||||
res.add(mavenBundle().groupId("org.eclipse.jetty.osgi").artifactId("jetty-osgi-boot-jsp").versionAsInProject().noStart());
|
|
||||||
|
|
||||||
// a bundle that registers a webapp as a service for the jetty osgi core
|
// a bundle that registers a webapp as a service for the jetty osgi core
|
||||||
// to pick up and deploy
|
// to pick up and deploy
|
||||||
|
|
|
@ -0,0 +1,179 @@
|
||||||
|
//
|
||||||
|
// ========================================================================
|
||||||
|
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
// All rights reserved. This program and the accompanying materials
|
||||||
|
// are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
// and Apache License v2.0 which accompanies this distribution.
|
||||||
|
//
|
||||||
|
// The Eclipse Public License is available at
|
||||||
|
// http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
//
|
||||||
|
// The Apache License v2.0 is available at
|
||||||
|
// http://www.opensource.org/licenses/apache2.0.php
|
||||||
|
//
|
||||||
|
// You may elect to redistribute this code under either of these licenses.
|
||||||
|
// ========================================================================
|
||||||
|
//
|
||||||
|
|
||||||
|
package org.eclipse.jetty.osgi.test;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
|
||||||
|
import static org.ops4j.pax.exam.CoreOptions.options;
|
||||||
|
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import org.eclipse.jetty.client.HttpClient;
|
||||||
|
import org.eclipse.jetty.client.api.ContentResponse;
|
||||||
|
import org.eclipse.jetty.http.HttpStatus;
|
||||||
|
import org.eclipse.jetty.osgi.boot.OSGiServerConstants;
|
||||||
|
import org.junit.Ignore;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.ops4j.pax.exam.Configuration;
|
||||||
|
import org.ops4j.pax.exam.CoreOptions;
|
||||||
|
import org.ops4j.pax.exam.Option;
|
||||||
|
import org.ops4j.pax.exam.junit.PaxExam;
|
||||||
|
import org.osgi.framework.BundleContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pax-Exam to make sure the jetty-osgi-boot can be started along with the
|
||||||
|
* httpservice web-bundle. Then make sure we can deploy an OSGi service on the
|
||||||
|
* top of this.
|
||||||
|
*/
|
||||||
|
@RunWith(PaxExam.class)
|
||||||
|
@Ignore
|
||||||
|
public class TestJettyOSGiBootWithAnnotations
|
||||||
|
{
|
||||||
|
private static final String LOG_LEVEL = "WARN";
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
BundleContext bundleContext = null;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public static Option[] configure()
|
||||||
|
{
|
||||||
|
|
||||||
|
ArrayList<Option> options = new ArrayList<Option>();
|
||||||
|
options.add(CoreOptions.junitBundles());
|
||||||
|
options.addAll(configureJettyHomeAndPort("jetty-selector.xml"));
|
||||||
|
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.xml.*", "javax.activation.*"));
|
||||||
|
options.add(CoreOptions.systemPackages("com.sun.org.apache.xalan.internal.res","com.sun.org.apache.xml.internal.utils",
|
||||||
|
"com.sun.org.apache.xml.internal.utils", "com.sun.org.apache.xpath.internal",
|
||||||
|
"com.sun.org.apache.xpath.internal.jaxp", "com.sun.org.apache.xpath.internal.objects"));
|
||||||
|
|
||||||
|
options.addAll(TestJettyOSGiBootCore.coreJettyDependencies());
|
||||||
|
options.addAll(Arrays.asList(options(systemProperty("pax.exam.logging").value("none"))));
|
||||||
|
options.addAll(Arrays.asList(options(systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value(LOG_LEVEL))));
|
||||||
|
options.addAll(Arrays.asList(options(systemProperty("org.eclipse.jetty.LEVEL").value(LOG_LEVEL))));
|
||||||
|
//options.addAll(TestJettyOSGiBootCore.consoleDependencies());
|
||||||
|
options.addAll(jspDependencies());
|
||||||
|
|
||||||
|
return options.toArray(new Option[options.size()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<Option> configureJettyHomeAndPort(String jettySelectorFileName)
|
||||||
|
{
|
||||||
|
File etcFolder = new File("src/test/config/etc");
|
||||||
|
String etc = "file://" + etcFolder.getAbsolutePath();
|
||||||
|
List<Option> options = new ArrayList<Option>();
|
||||||
|
String xmlConfigs = etc + "/jetty.xml;"
|
||||||
|
+ etc
|
||||||
|
+ "/"
|
||||||
|
+ jettySelectorFileName
|
||||||
|
+ ";"
|
||||||
|
+ etc
|
||||||
|
+ "/jetty-ssl.xml;"
|
||||||
|
+ etc
|
||||||
|
+ "/jetty-https.xml;"
|
||||||
|
+ etc
|
||||||
|
+ "/jetty-deployer.xml;"
|
||||||
|
+ etc
|
||||||
|
+ "/jetty-testrealm.xml";
|
||||||
|
|
||||||
|
options.add(systemProperty(OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS).value(xmlConfigs));
|
||||||
|
options.add(systemProperty("jetty.port").value(String.valueOf(TestJettyOSGiBootCore.DEFAULT_JETTY_HTTP_PORT)));
|
||||||
|
options.add(systemProperty("jetty.home").value(etcFolder.getParentFile().getAbsolutePath()));
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<Option> jspDependencies()
|
||||||
|
{
|
||||||
|
List<Option> res = new ArrayList<Option>();
|
||||||
|
res.addAll(TestJettyOSGiBootCore.jspDependencies());
|
||||||
|
|
||||||
|
//test webapp bundle
|
||||||
|
res.add(mavenBundle().groupId("org.eclipse.jetty.tests").artifactId("test-spec-webapp").classifier("webbundle").versionAsInProject());
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Ignore
|
||||||
|
@Test
|
||||||
|
public void assertAllBundlesActiveOrResolved()
|
||||||
|
{
|
||||||
|
TestOSGiUtil.assertAllBundlesActiveOrResolved(bundleContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
// at the moment can't run httpservice with jsp at the same time.
|
||||||
|
// that is a regression in jetty-9
|
||||||
|
@Ignore
|
||||||
|
@Test
|
||||||
|
public void testHttpService() throws Exception
|
||||||
|
{
|
||||||
|
TestOSGiUtil.testHttpServiceGreetings(bundleContext, "http", TestJettyOSGiBootCore.DEFAULT_JETTY_HTTP_PORT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Ignore
|
||||||
|
@Test
|
||||||
|
public void testJspDump() throws Exception
|
||||||
|
{
|
||||||
|
HttpClient client = new HttpClient();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
client.start();
|
||||||
|
ContentResponse response = client.GET("http://127.0.0.1:" + TestJettyOSGiBootCore.DEFAULT_JETTY_HTTP_PORT + "/jsp/dump.jsp");
|
||||||
|
assertEquals(HttpStatus.OK_200, response.getStatus());
|
||||||
|
|
||||||
|
String content = new String(response.getContent());
|
||||||
|
assertTrue(content.contains("<tr><th>ServletPath:</th><td>/jsp/dump.jsp</td></tr>"));
|
||||||
|
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
client.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testIndex() throws Exception
|
||||||
|
{
|
||||||
|
HttpClient client = new HttpClient();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
client.start();
|
||||||
|
ContentResponse response = client.GET("http://127.0.0.1:" + TestJettyOSGiBootCore.DEFAULT_JETTY_HTTP_PORT + "/index.html");
|
||||||
|
//assertEquals(HttpStatus.OK_200, response.getStatus());
|
||||||
|
|
||||||
|
String content = new String(response.getContent());
|
||||||
|
System.err.println(content);
|
||||||
|
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
client.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -52,7 +52,7 @@ import org.osgi.framework.BundleContext;
|
||||||
@RunWith(PaxExam.class)
|
@RunWith(PaxExam.class)
|
||||||
public class TestJettyOSGiBootWithJsp
|
public class TestJettyOSGiBootWithJsp
|
||||||
{
|
{
|
||||||
private static final String LOG_LEVEL = "WARN";
|
private static final String LOG_LEVEL = "INFO";
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
BundleContext bundleContext = null;
|
BundleContext bundleContext = null;
|
||||||
|
@ -73,7 +73,7 @@ public class TestJettyOSGiBootWithJsp
|
||||||
options.addAll(Arrays.asList(options(systemProperty("pax.exam.logging").value("none"))));
|
options.addAll(Arrays.asList(options(systemProperty("pax.exam.logging").value("none"))));
|
||||||
options.addAll(Arrays.asList(options(systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value(LOG_LEVEL))));
|
options.addAll(Arrays.asList(options(systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value(LOG_LEVEL))));
|
||||||
options.addAll(Arrays.asList(options(systemProperty("org.eclipse.jetty.LEVEL").value(LOG_LEVEL))));
|
options.addAll(Arrays.asList(options(systemProperty("org.eclipse.jetty.LEVEL").value(LOG_LEVEL))));
|
||||||
|
options.addAll(Arrays.asList(options(systemProperty("org.eclipse.jetty.annotations.LEVEL").value("DEBUG"))));
|
||||||
options.addAll(jspDependencies());
|
options.addAll(jspDependencies());
|
||||||
return options.toArray(new Option[options.size()]);
|
return options.toArray(new Option[options.size()]);
|
||||||
}
|
}
|
||||||
|
@ -106,26 +106,19 @@ public class TestJettyOSGiBootWithJsp
|
||||||
public static List<Option> jspDependencies()
|
public static List<Option> jspDependencies()
|
||||||
{
|
{
|
||||||
List<Option> res = new ArrayList<Option>();
|
List<Option> res = new ArrayList<Option>();
|
||||||
|
res.addAll(TestJettyOSGiBootCore.jspDependencies());
|
||||||
//jetty jsp bundles
|
|
||||||
res.add(mavenBundle().groupId("javax.servlet.jsp").artifactId("javax.servlet.jsp-api").versionAsInProject());
|
|
||||||
res.add(mavenBundle().groupId("org.eclipse.jetty.orbit").artifactId("javax.servlet.jsp.jstl").versionAsInProject());
|
|
||||||
res.add(mavenBundle().groupId("org.glassfish.web").artifactId("javax.servlet.jsp.jstl").versionAsInProject());
|
|
||||||
res.add(mavenBundle().groupId("org.glassfish").artifactId("javax.el").versionAsInProject());
|
|
||||||
res.add(mavenBundle().groupId("org.eclipse.jetty.orbit").artifactId("org.eclipse.jdt.core").versionAsInProject());
|
|
||||||
res.add(mavenBundle().groupId("org.eclipse.jetty.toolchain").artifactId("jetty-jsp-fragment").versionAsInProject().noStart());
|
|
||||||
res.add(mavenBundle().groupId("org.eclipse.jetty.osgi").artifactId("jetty-osgi-boot-jsp").versionAsInProject().noStart());
|
|
||||||
|
|
||||||
//test webapp bundle
|
//test webapp bundle
|
||||||
res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("test-jetty-webapp").classifier("webbundle").versionAsInProject());
|
res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("test-jetty-webapp").classifier("webbundle").versionAsInProject());
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore
|
||||||
public void assertAllBundlesActiveOrResolved()
|
public void assertAllBundlesActiveOrResolved()
|
||||||
{
|
{
|
||||||
|
TestOSGiUtil.debugBundles(bundleContext);
|
||||||
TestOSGiUtil.assertAllBundlesActiveOrResolved(bundleContext);
|
TestOSGiUtil.assertAllBundlesActiveOrResolved(bundleContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,16 +135,15 @@ public class TestJettyOSGiBootWithJsp
|
||||||
@Test
|
@Test
|
||||||
public void testJspDump() throws Exception
|
public void testJspDump() throws Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
HttpClient client = new HttpClient();
|
HttpClient client = new HttpClient();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
client.start();
|
client.start();
|
||||||
ContentResponse response = client.GET("http://127.0.0.1:" + TestJettyOSGiBootCore.DEFAULT_JETTY_HTTP_PORT + "/jsp/dump.jsp");
|
ContentResponse response = client.GET("http://127.0.0.1:" + TestJettyOSGiBootCore.DEFAULT_JETTY_HTTP_PORT + "/jsp/jstl.jsp");
|
||||||
assertEquals(HttpStatus.OK_200, response.getStatus());
|
assertEquals(HttpStatus.OK_200, response.getStatus());
|
||||||
|
|
||||||
String content = new String(response.getContent());
|
String content = new String(response.getContent());
|
||||||
assertTrue(content.contains("<tr><th>ServletPath:</th><td>/jsp/dump.jsp</td></tr>"));
|
assertTrue(content.contains("JSTL Example"));
|
||||||
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -540,7 +540,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mortbay.jasper</groupId>
|
<groupId>org.mortbay.jasper</groupId>
|
||||||
<artifactId>apache-jsp</artifactId>
|
<artifactId>apache-jsp</artifactId>
|
||||||
<version>8.0.9.M2</version>
|
<version>8.0.9-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -18,6 +18,69 @@
|
||||||
<skip>true</skip>
|
<skip>true</skip>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<descriptors>
|
||||||
|
<descriptor>src/main/assembly/config.xml</descriptor>
|
||||||
|
<descriptor>src/main/assembly/web-bundle.xml</descriptor>
|
||||||
|
</descriptors>
|
||||||
|
<archive>
|
||||||
|
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<!-- also make this webapp an osgi bundle -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.felix</groupId>
|
||||||
|
<artifactId>maven-bundle-plugin</artifactId>
|
||||||
|
<extensions>true</extensions>
|
||||||
|
<configuration>
|
||||||
|
<supportedProjectTypes>
|
||||||
|
<supportedProjectType>war</supportedProjectType>
|
||||||
|
</supportedProjectTypes>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>bundle-manifest</id>
|
||||||
|
<phase>process-classes</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>manifest</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<instructions>
|
||||||
|
<Bundle-SymbolicName>org.eclipse.jetty.tests.test-spec-webapp</Bundle-SymbolicName>
|
||||||
|
<Import-Package>javax.servlet.jsp.*;version="[2.2.0, 3.0)",javax.transaction.*;version="[1.1, 2.0)", javax.servlet.*;version="3.0",org.eclipse.jetty.*;version="9.2",*</Import-Package>
|
||||||
|
<Export-Package>!com.acme*</Export-Package>
|
||||||
|
<Web-ContextPath>/</Web-ContextPath>
|
||||||
|
<Bundle-ClassPath>.,WEB-INF/classes,WEB-INF/lib</Bundle-ClassPath>
|
||||||
|
</instructions>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-antrun-plugin</artifactId>
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
<executions>
|
<executions>
|
||||||
|
@ -65,7 +128,7 @@
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<!-- plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>2.2-beta-3</version>
|
<version>2.2-beta-3</version>
|
||||||
|
@ -82,7 +145,7 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>jetty-maven-plugin</artifactId>
|
<artifactId>jetty-maven-plugin</artifactId>
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
|
||||||
|
<id>webbundle</id>
|
||||||
|
<formats>
|
||||||
|
<format>jar</format>
|
||||||
|
</formats>
|
||||||
|
<includeBaseDirectory>false</includeBaseDirectory>
|
||||||
|
<fileSets>
|
||||||
|
<fileSet>
|
||||||
|
<directory>${basedir}/${project.build.directory}/${project.build.finalName}/</directory>
|
||||||
|
<outputDirectory></outputDirectory>
|
||||||
|
<includes>
|
||||||
|
<include>**/*.*</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
</fileSets>
|
||||||
|
</assembly>
|
Loading…
Reference in New Issue