Created
November 18, 2012 15:47
-
-
Save tf0054/4105923 to your computer and use it in GitHub Desktop.
jetty for static files and proxy for solr.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>org.example</groupId> | |
| <artifactId>hello-world</artifactId> | |
| <version>0.1-SNAPSHOT</version> | |
| <packaging>jar</packaging> | |
| <name>Jetty HelloWorld</name> | |
| <properties> | |
| <jettyVersion>8.1.3.v20120416</jettyVersion> | |
| </properties> | |
| <dependencies> | |
| <dependency> | |
| <groupId>org.eclipse.jetty</groupId> | |
| <artifactId>jetty-server</artifactId> | |
| <version>${jettyVersion}</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.eclipse.jetty</groupId> | |
| <artifactId>jetty-servlets</artifactId> | |
| <version>${jettyVersion}</version> | |
| </dependency> | |
| </dependencies> | |
| <build> | |
| <plugins> | |
| <plugin> | |
| <!-- This plugin is needed for the servlet example --> | |
| <groupId>org.mortbay.jetty</groupId> | |
| <artifactId>jetty-maven-plugin</artifactId> | |
| <version>${jettyVersion}</version> | |
| <!-- | |
| <configuration> | |
| <systemProperties> | |
| <systemProperty> | |
| <name>logback.configurationFile</name> | |
| <value>./src/etc/logback.xml</value> | |
| </systemProperty> | |
| </systemProperties> | |
| </configuration> | |
| <dependencies> | |
| <dependency> | |
| <groupId>org.slf4j</groupId> | |
| <artifactId>slf4j-api</artifactId> | |
| <version>1.6.4</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>ch.qos.logback</groupId> | |
| <artifactId>logback-classic</artifactId> | |
| <version>1.0.3</version> | |
| </dependency> | |
| </dependencies> | |
| --> | |
| </plugin> | |
| <plugin> | |
| <groupId>org.codehaus.mojo</groupId> | |
| <artifactId>exec-maven-plugin</artifactId> | |
| <version>1.1</version> | |
| <executions> | |
| <execution><goals><goal>java</goal></goals></execution> | |
| </executions> | |
| <configuration> | |
| <mainClass>org.example.HelloWorld</mainClass> | |
| </configuration> | |
| </plugin> | |
| </plugins> | |
| </build> | |
| </project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="ISO-8859-1"?> | |
| <web-app | |
| 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_2_5.xsd" | |
| version="2.5"> | |
| <!-- | |
| <listener> | |
| <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> | |
| </listener> | |
| --> | |
| <servlet> | |
| <servlet-name>Hello</servlet-name> | |
| <servlet-class>org.example.HelloServlet</servlet-class> | |
| </servlet> | |
| <servlet-mapping> | |
| <servlet-name>Hello</servlet-name> | |
| <url-pattern>/hello/*</url-pattern> | |
| </servlet-mapping> | |
| <servlet> | |
| <servlet-name>static</servlet-name> | |
| <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class> | |
| <init-param> | |
| <param-name>pathInfoOnly</param-name> | |
| <param-value>true</param-value> | |
| </init-param> | |
| </servlet> | |
| <servlet-mapping> | |
| <servlet-name>static</servlet-name> | |
| <url-pattern>/*</url-pattern> | |
| </servlet-mapping> | |
| <servlet> | |
| <servlet-name>LocalSolrProxy</servlet-name> | |
| <servlet-class>org.eclipse.jetty.servlets.ProxyServlet$Transparent</servlet-class> | |
| <load-on-startup>1</load-on-startup> | |
| <init-param> | |
| <param-name>ProxyTo</param-name><param-value>http://localhost:8983/</param-value> | |
| </init-param> | |
| <init-param> | |
| <param-name>Prefix</param-name><param-value>/</param-value> | |
| </init-param> | |
| </servlet> | |
| <servlet-mapping> | |
| <servlet-name>LocalSolrProxy</servlet-name> | |
| <url-pattern>/solr/*</url-pattern> | |
| </servlet-mapping> | |
| </web-app> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment