Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Jetty-Maven-Plugin reads jettyXml and still starts default context

Hello list,

I am using Jetty 8.1.4.v20120524 and Maven 3. I have the following configuration in my pom:

      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>8.1.4.v20120524</version>
        <configuration>
          <jettyXml>${project.basedir}/src/main/resources/jetty.xml</jettyXml>
        </configuration>
      </plugin>

In my jetty.xml, I define a context:

    <Set name="handler">
      <New class="org.eclipse.jetty.server.handler.HandlerList">
        <Set name="handlers">
          <Array type="org.eclipse.jetty.server.Handler">
            <Item>
              <New class="org.eclipse.jetty.server.handler.ResourceHandler">
                <Set name="welcomeFiles">
                  <Array type="String"><Item>index.xml,index.xhtml,index.html</Item></Array>
                </Set>
              </New>
            </Item>
            <Item>
              <New id="Contexts" class="org.eclipse.jetty.webapp.WebAppContext">
                <Set name="resourceBase"><SystemProperty name="jetty.home" default="src/main/webapp" /></Set>
                <Set name="contextPath">/</Set>
              </New>
            </Item>
          </Array>
        </Set>
      </New>
    </Set>

This works as expected and starts my application at /:

    INFO:oejs.Server:jetty-8.1.4.v20120524
    INFO:oejsh.ContextHandler:started o.e.j.w.WebAppContext{/,file:/<MY_DIRECTORY>/src/main/webapp/}
    INFO:oejsh.ContextHandler:started o.e.j.w.WebAppContext{/,file:/<MY_DIRECTORY>/src/main/webapp/}

However, after this the jetty-maven-plugin seems to try to start a default context, which fails with class not found - It also tries to bind to "/", which I obviously don't want.

    WARN:oejs.Holder:java.lang.ClassNotFoundException: org.basex.http.rest.RESTServlet
    INFO:oejpw.PlusConfiguration:No Transaction manager found - if your webapp requires one, please configure one.
    INFO:oejsh.ContextHandler:started o.m.j.p.JettyWebAppContext{/,file:/<MY_DIRECTORY>/src/main/webapp/},file:/<MY_DIRECTORY>/src/main/webapp/
    INFO:oejsh.ContextHandler:started o.m.j.p.JettyWebAppContext{/,file:/<MY_DIRECTORY>/src/main/webapp/},file:/<MY_DIRECTORY>/src/main/webapp/
    INFO:oejsh.ContextHandler:started o.m.j.p.JettyWebAppContext{/,file:/<MY_DIRECTORY>/src/main/webapp/},file:/<MY_DIRECTORY>/src/main/webapp/

How can I stop this context to be started? Any help is greatly appreciated.

Please note, that I asked this question also on SO (http://stackoverflow.com/questions/11664682/jetty-maven-plugin-reads-jettyxml-and-still-starts-default-context). I hope this cross-posting is ok with you as I doen't seem to get any answer on SO at all.

Cheers,
Dirk


Back to the top