title: How do I get the eclipse-jetty plugin to scan for and recognize websocket classes?
body: <p>I'm attempting to start a simple java maven webapp from eclipse Indigo containing only one class, a basic annotated websocket.  I would like annotation scanning to identify and register the class automatically using the sourceforge eclipse-jetty <a href="http://sourceforge.net/projects/eclipse-jetty/" rel="nofollow">plugin</a> which is configured to use my own local jetty distribution 9.1.1.v20140108.  Code for the websocket is as follows:</p>
  
  <pre><code>package com.myapp.websocket_sample;
  
  import java.io.IOException;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
  import java.util.Collections;
  import java.util.HashSet;
  import java.util.Set;
  
  import javax.websocket.EncodeException;
  import javax.websocket.OnClose;
  import javax.websocket.OnMessage;
  import javax.websocket.OnOpen;
  import javax.websocket.Session;
  import javax.websocket.server.ServerEndpoint;
  
  @ServerEndpoint(value = "/ws/broadcast", encoders = {}, decoders = {})
  public class TestWebsocket {
      private static final Set&lt;Session&gt; sessions = Collections.synchronizedSet(new HashSet&lt;Session&gt;());
      private static final Logger logger = LoggerFactory.getLogger(TestWebsocket.class);
  
      public TestWebsocket() {
          logger.info("Initializing websocket.");
      }
  
      @OnOpen
      public void onOpen(final Session session) {
          logger.info("Opening new websocket session.");
          sessions.add(session);
      }
  
      @OnClose
      public void onClose(final Session session) {
          logger.info("Closing new websocket session.");
          sessions.remove(session);
      }
  
      @OnMessage
      public void onMessage(final String message, final Session client) throws IOException, EncodeException {
          logger.info("Got message {}.", message);
          for (final Session session : sessions) {
              session.getBasicRemote().sendObject(message);
          }
      }
  }
  </code></pre>
  
  <p>When starting under eclipse-jetty, the websocket class is apparently not being identified and scanned by jetty.  In looking at the (auto-generated) jetty.xml used by eclipse-jetty plugin, the class appears to be on the extraClasspath option.  </p>
  
  <pre><code>&lt;Set name="handler"&gt;
      &lt;New class="org.eclipse.jetty.webapp.WebAppContext"&gt;
          &lt;Arg type="String"&gt;src/main/webapp&lt;/Arg&gt;
          &lt;Arg type="String"&gt;/ws-sample&lt;/Arg&gt;
          &lt;Set name="extraClasspath"&gt;C:/Users/padolan/AppData/Local/eclipse-workspaces/websockets/websocket-sample/target/classes;C:/Users/padolan/.m2/repository/javax/websocket/javax.websocket-api/1.0/javax.websocket-api-1.0.jar;C:/Users/padolan/.m2/repository/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar&lt;/Set&gt;
      &lt;/New&gt;
  &lt;/Set&gt;
  </code></pre>
  
  <p>I can take the same project (built as a war file using maven), copy it to the jetty distribution's webapps folder, and start it using the jetty start.jar like so, and the websocket is picked up and made available:</p>
  
  <pre><code>java -jar start.jar --module=webapp,websocket
  </code></pre>
  
  <p>I suspect I need to add some special jetty configuration or additional classes to the classpath of the eclipse-jetty plugin to get it to pick up the annotated websocket class, but I'm not sure what that should be.  Any suggestions?</p>