title: ActiveMQ maven plugin configuration
body: <p>I have a problem with using ActiveMQ in a Spring project.
  I am trying to integrate the ActiveMQ maven plugin into my project to use it in integration tests.
  Here my configuration:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at
  
  http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  --&gt; &lt;!-- START SNIPPET: example --&gt; &lt;beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:amq="http://activemq.apache.org/schema/core"
  xmlns:cam ="http://camel.apache.org/schema/spring"
  xmlns:jetty ="http://mortbay.com/schemas/jetty/1.0"
  xsi:schemaLocation="http://www.springframework.org/schema/beans 
  http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://camel.apache.org/schema/spring 
  http://camel.apache.org/schema/spring/camel-spring.xsd
  http://activemq.apache.org/schema/core 
  http://activemq.apache.org/schema/core/activemq-core-5.5.0.xsd
  http://mortbay.com/schemas/jetty/1.0
  http://jetty.mortbay.org/jetty.xsd"&gt; &lt;!-- this location for the schema doesn't work, I dont know exactly where the schema is located
  xmlns:jetty ="http://mortbay.com/schemas/jetty/1.0"
  http://mortbay.com/schemas/jetty/1.0
  http://jetty.mortbay.org/jetty.xsd   --&gt;
  
  &lt;!-- Allows us to use system properties as variables in this configuration file --&gt;
  &lt;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
       &lt;property name="locations"&gt;
          &lt;value&gt;file:///${activemq.base}/conf/credentials.properties&lt;/value&gt;
       &lt;/property&gt;      
  &lt;/bean&gt;
  
  &lt;amq:broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data"&gt;
  
      &lt;!-- Destination specific policies using destination names or wildcards --&gt;
      &lt;destinationPolicy&gt;
          &lt;policyMap&gt;
              &lt;policyEntries&gt;
                  &lt;policyEntry queue="&gt;" memoryLimit="5mb"/&gt;
                  &lt;policyEntry topic="&gt;" memoryLimit="5mb"&gt;
                    &lt;!-- you can add other policies too such as these
                      &lt;dispatchPolicy&gt;
                          &lt;strictOrderDispatchPolicy/&gt;
                      &lt;/dispatchPolicy&gt;
                      &lt;subscriptionRecoveryPolicy&gt;
                          &lt;lastImageSubscriptionRecoveryPolicy/&gt;
                      &lt;/subscriptionRecoveryPolicy&gt;
                    --&gt;
                  &lt;/policyEntry&gt;
              &lt;/policyEntries&gt;
          &lt;/policyMap&gt;
      &lt;/destinationPolicy&gt;
  
      &lt;!-- Use the following to configure how ActiveMQ is exposed in JMX --&gt;
      &lt;managementContext&gt;
          &lt;managementContext createConnector="false"/&gt;
      &lt;/managementContext&gt;
  
      &lt;!-- The store and forward broker networks ActiveMQ will listen to --&gt;
      &lt;networkConnectors&gt;
          &lt;!-- by default just auto discover the other brokers --&gt;
          &lt;networkConnector name="default-nc" uri="multicast://default"/&gt;
          &lt;!-- Example of a static configuration:
          &lt;networkConnector name="host1 and host2" uri="static://(tcp://host1:61616,tcp://host2:61616)"/&gt;
          --&gt;
      &lt;/networkConnectors&gt;
  
      &lt;persistenceAdapter&gt;
          &lt;amqPersistenceAdapter syncOnWrite="false" directory="${activemq.base}/data" maxFileLength="20 mb"/&gt;
      &lt;/persistenceAdapter&gt;
  
      &lt;!-- Use the following if you wish to configure the journal with JDBC --&gt;
      &lt;!--
      &lt;persistenceAdapter&gt;
          &lt;journaledJDBC dataDirectory="${activemq.base}/data" dataSource="#postgres-ds"/&gt;
      &lt;/persistenceAdapter&gt;
      --&gt;
  
      &lt;!-- Or if you want to use pure JDBC without a journal --&gt;
      &lt;!--
      &lt;persistenceAdapter&gt;
          &lt;jdbcPersistenceAdapter dataSource="#postgres-ds"/&gt;
      &lt;/persistenceAdapter&gt;
      --&gt;
  
      &lt;sslContext&gt;
          &lt;sslContext keyStore="file:${activemq.base}/conf/broker.ks" keyStorePassword="password" trustStore="file:${activemq.base}/conf/broker.ts" trustStorePassword="password"/&gt;
      &lt;/sslContext&gt;
  
      &lt;!--  The maximum about of space the broker will use before slowing down producers --&gt;
      &lt;systemUsage&gt;
          &lt;systemUsage&gt;
              &lt;memoryUsage&gt;
                  &lt;memoryUsage limit="20 mb"/&gt;
              &lt;/memoryUsage&gt;
              &lt;storeUsage&gt;
                  &lt;storeUsage limit="1 gb" name="foo"/&gt;
              &lt;/storeUsage&gt;
              &lt;tempUsage&gt;
                  &lt;tempUsage limit="100 mb"/&gt;
              &lt;/tempUsage&gt;
          &lt;/systemUsage&gt;
      &lt;/systemUsage&gt;
  
  
      &lt;!-- The transport connectors ActiveMQ will listen to --&gt;
      &lt;transportConnectors&gt;
          &lt;!--&lt;transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default"/&gt;--&gt;
          &lt;!--&lt;transportConnector name="default-nc" uri="multicast://default"/&gt;--&gt;
          &lt;transportConnector name="openwire" uri="tcp://localhost:61616" /&gt;
          &lt;transportConnector name="ssl" uri="ssl://localhost:61617"/&gt;
          &lt;transportConnector name="stomp" uri="stomp://localhost:61613"/&gt;
          &lt;transportConnector name="xmpp" uri="xmpp://localhost:61222"/&gt;
      &lt;/transportConnectors&gt;
  
  &lt;/amq:broker&gt;
  
  &lt;!--
  ** Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker
  ** For more details see
  **
  ** http://activemq.apache.org/enterprise-integration-patterns.html
  --&gt;
  &lt;cam:camelContext id="camel"&gt;
  
      &lt;!-- You can use a &lt;package&gt; element for each root package to search for Java routes --&gt;
      &lt;cam:package&gt;org.foo.bar&lt;/cam:package&gt;
  
      &lt;!-- You can use Spring XML syntax to define the routes here using the &lt;route&gt; element --&gt;
      &lt;cam:route&gt;
          &lt;cam:from uri="activemq:example.A"/&gt;
          &lt;cam:to uri="activemq:example.B"/&gt;
      &lt;/cam:route&gt;
  &lt;/cam:camelContext&gt;
  
  &lt;!--
  ** Lets configure some Camel endpoints
  **
  ** http://activemq.apache.org/camel/components.html
  --&gt;
  
  &lt;!-- configure the camel activemq component to use the current broker --&gt;
  &lt;bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" &gt;
      &lt;property name="connectionFactory"&gt;
        &lt;bean class="org.apache.activemq.ActiveMQConnectionFactory"&gt;
          &lt;property name="brokerURL" value="vm://localhost?create=false&amp;amp;waitForStart=10000" /&gt;
          &lt;property name="userName" value="${activemq.username}"/&gt;
          &lt;property name="password" value="${activemq.password}"/&gt;
        &lt;/bean&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  
  
  &lt;!-- Uncomment to create a command agent to respond to message based admin commands on the ActiveMQ.Agent topic --&gt;
  &lt;!--
  &lt;commandAgent xmlns="http://activemq.apache.org/schema/core" brokerUrl="vm://localhost" username="${activemq.username}" password="${activemq.password}"/&gt;
  --&gt;
  
  
  &lt;!-- An embedded servlet engine for serving up the Admin console --&gt;
  &lt;jetty:jetty&gt;
      &lt;connectors&gt;
          &lt;nioConnector port="8161"/&gt;
      &lt;/connectors&gt;
  
      &lt;handlers&gt;
          &lt;webAppContext contextPath="/admin" resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/&gt;
          &lt;webAppContext contextPath="/demo" resourceBase="${activemq.base}/webapps/demo" logUrlOnStart="true"/&gt;
          &lt;webAppContext contextPath="/fileserver" resourceBase="${activemq.base}/webapps/fileserver" logUrlOnStart="true"/&gt;
      &lt;/handlers&gt;
  &lt;/jetty:jetty&gt;
  &lt;!--  This xbean configuration file supports all the standard spring xml configuration options --&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>The problem I have is using the jetty Namespace.
  The schema cannot be found and downloaded: <a href="http://jetty.mortbay.org/jetty.xsd" rel="nofollow">http://jetty.mortbay.org/jetty.xsd</a> 
  Here a link from Apache ActiveMQ:
  <a href="http://activemq.apache.org/complex-single-broker-configuration-stomp-only.html" rel="nofollow">http://activemq.apache.org/complex-single-broker-configuration-stomp-only.html</a></p>
  
  <p>There is not specified any location for this schema.
  The ActiveMQ starts without having the schema location but if I use a schema validator like in Eclipse it tells me that I have an error in the file and the schema location cannot be found.</p>
  
  <p>Any idea where I can find the schema for the jetty element ?</p>