You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ma...@apache.org on 2017/06/10 11:26:04 UTC

[19/50] archiva git commit: jetty.xml ready, do not force encoding in encoding servlet

jetty.xml ready, do not force encoding in encoding servlet

Signed-off-by: olivier lamy <ol...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/archiva/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva/commit/dc97f3ef
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/dc97f3ef
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/dc97f3ef

Branch: refs/heads/citest
Commit: dc97f3ef8cf530e8d72057038f9138b0eec9213d
Parents: e9376ee
Author: olivier lamy <ol...@apache.org>
Authored: Sat May 13 09:02:07 2017 +1000
Committer: olivier lamy <ol...@apache.org>
Committed: Sat May 13 09:02:07 2017 +1000

----------------------------------------------------------------------
 archiva-jetty/src/main/conf/jetty.xml           | 336 ++++++-------------
 .../indexing/DownloadRemoteIndexTaskTest.java   |   7 +-
 .../src/main/webapp/WEB-INF/web.xml             |   2 +-
 3 files changed, 111 insertions(+), 234 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva/blob/dc97f3ef/archiva-jetty/src/main/conf/jetty.xml
----------------------------------------------------------------------
diff --git a/archiva-jetty/src/main/conf/jetty.xml b/archiva-jetty/src/main/conf/jetty.xml
index 2881f23..77a8abb 100644
--- a/archiva-jetty/src/main/conf/jetty.xml
+++ b/archiva-jetty/src/main/conf/jetty.xml
@@ -30,215 +30,126 @@
 
 <Configure id="Server" class="org.eclipse.jetty.server.Server">
 
-    <!-- =========================================================== -->
-    <!-- Server Thread Pool                                          -->
-    <!-- =========================================================== -->
-    <Set name="ThreadPool">
-      <!-- Default bounded blocking threadpool 
-      -->
-      <New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
-        <Set name="minThreads">10</Set>
-        <Set name="maxThreads">250</Set>
-      </New>
 
-      <!-- Optional Java 5 bounded threadpool with job queue 
-      <New class="org.eclipse.jetty.util.thread.ExecutorThreadPool">
-        <Set name="corePoolSize">250</Set>
-        <Set name="maximumPoolSize">250</Set>
-      </New>
-      -->
-    </Set>
+  <Arg name="threadpool">
+    <New id="threadpool" class="org.eclipse.jetty.util.thread.QueuedThreadPool">
+      <Arg name="minThreads" type="int">10</Arg>
+      <Arg name="maxThreads" type="int">200</Arg>
+      <Arg name="idleTimeout" type="int">60000</Arg>
+      <Set name="detailedDump">false</Set>
+    </New>
+  </Arg>
 
-    <!-- =========================================================== -->
-    <!-- Set connectors                                              -->
-    <!-- =========================================================== -->
-    <!-- One of each type!                                           -->
-    <!-- =========================================================== -->
+  <Call name="addBean">
+    <Arg>
+      <New class="org.eclipse.jetty.util.thread.ScheduledExecutorScheduler"/>
+    </Arg>
+  </Call>
 
-    <!-- Use this connector for many frequently idle connections
-         and for threadless continuations.
-    -->    
-    <Call name="addConnector">
-      <Arg>
-          <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
-            <Set name="host"><SystemProperty name="jetty.host"/></Set>
-            <Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>
-            <Set name="maxIdleTime">30000</Set>
-            <Set name="Acceptors">2</Set>
-            <Set name="statsOn">false</Set>
-            <Set name="confidentialPort">8443</Set>
-            <Set name="lowResourcesConnections">5000</Set>
-            <Set name="lowResourcesMaxIdleTime">5000</Set>
-          </New>
-      </Arg>
-    </Call>
+  <!-- =========================================================== -->
+  <!-- Set connectors                                              -->
+  <!-- =========================================================== -->
+  <!-- One of each type!                                           -->
+  <!-- =========================================================== -->
 
-    <!-- Use this connector if NIO is not available. 
-    <Call name="addConnector">
-      <Arg>
-          <New class="org.mortbay.jetty.bio.SocketConnector">
-            <Set name="port">8081</Set>
-            <Set name="maxIdleTime">50000</Set>
-            <Set name="lowResourceMaxIdleTime">1500</Set>
-          </New>
-      </Arg>
-    </Call>
-    -->
+  <!-- Use this connector for many frequently idle connections
+       and for threadless continuations.
+  -->
+  <New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
+    <Set name="secureScheme">https</Set>
+    <Set name="securePort"><Property name="jetty.secure.port" default="8443" /></Set>
+    <Set name="outputBufferSize">32768</Set>
+    <Set name="requestHeaderSize">8192</Set>
+    <Set name="responseHeaderSize">8192</Set>
+    <Set name="headerCacheSize">512</Set>
 
-    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-    <!-- To add a HTTPS SSL listener                                     -->
-    <!-- see jetty-ssl.xml to add an ssl connector. use                  -->
-    <!-- java -jar start.jar etc/jetty.xml etc/jetty-ssl.xml             -->
-    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-    
-    <!-- =========================================================== -->
-    <!-- Set up global session ID manager                            -->
-    <!-- =========================================================== -->
-    <!--
-    <Set name="sessionIdManager">
-      <New class="org.mortbay.jetty.servlet.HashSessionIdManager">
-        <Set name="workerName">node1</Set>
-      </New>
-    </Set>
-    -->
+  </New>
 
-    <!-- =========================================================== -->
-    <!-- Set handler Collection Structure                            --> 
-    <!-- =========================================================== -->
-    <Set name="handler">
-      <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
-        <Set name="handlers">
-         <Array type="org.eclipse.jetty.server.Handler">
-           <Item>
-             <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
-           </Item>
-           <Item>
-             <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
-           </Item>
-           <Item>
-             <New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler"/>
-           </Item>
-         </Array>
-        </Set>
+  <Call name="addConnector">
+    <Arg>
+      <New class="org.eclipse.jetty.server.ServerConnector">
+        <Arg name="server"><Ref refid="Server" /></Arg>
+        <Arg name="factories">
+          <Array type="org.eclipse.jetty.server.ConnectionFactory">
+            <Item>
+              <New class="org.eclipse.jetty.server.HttpConnectionFactory">
+                <Arg name="config"><Ref refid="httpConfig" /></Arg>
+              </New>
+            </Item>
+          </Array>
+        </Arg>
+        <Set name="host"><Property name="jetty.host" /></Set>
+        <Set name="port"><Property name="jetty.port" default="8080" /></Set>
+        <Set name="idleTimeout">30000</Set>
       </New>
-    </Set>
-    
-    <!-- =========================================================== -->
-    <!-- Configure the context deployer                              -->
-    <!-- A context deployer will deploy contexts described in        -->
-    <!-- configuration files discovered in a directory.              -->
-    <!-- The configuration directory can be scanned for hot          -->
-    <!-- deployments at the configured scanInterval.                 -->
-    <!--                                                             -->
-    <!-- This deployer is configured to deploy contexts configured   -->
-    <!-- in the $JETTY_HOME/contexts directory                       -->
-    <!--                                                             -->
-    <!-- =========================================================== -->
-    <Call name="addLifeCycle">
-      <Arg>
-        <New class="org.eclipse.jetty.deploy.ContextDeployer">
-          <Set name="contexts"><Ref id="Contexts"/></Set>
-          <Set name="configurationDir"><SystemProperty name="jetty.home" default="."/>/contexts</Set>
-          <Set name="scanInterval">1</Set>
-        </New>
-      </Arg>
-    </Call>
-
-    <!-- =========================================================== -->
-    <!-- Configure the webapp deployer.                              -->
-    <!-- A webapp  deployer will deploy standard webapps discovered  -->
-    <!-- in a directory at startup, without the need for additional  -->
-    <!-- configuration files.    It does not support hot deploy or   -->
-    <!-- non standard contexts (see ContextDeployer above).          -->
-    <!--                                                             -->
-    <!-- This deployer is configured to deploy webapps from the      -->
-    <!-- $JETTY_HOME/webapps directory                               -->
-    <!--                                                             -->
-    <!-- Normally only one type of deployer need be used.            -->
-    <!--                                                             -->
-    <!-- =========================================================== -->
-    <Call name="addLifeCycle">
-      <Arg>
-        <New class="org.eclipse.jetty.deploy.WebAppDeployer">
-          <Set name="contexts"><Ref id="Contexts"/></Set>
-          <Set name="webAppDir"><SystemProperty name="jetty.home" default="."/>/apps</Set>
-            <Set name="parentLoaderPriority">false</Set>
-            <Set name="extract">true</Set>
-            <Set name="allowDuplicates">false</Set>
-        </New>
-      </Arg>
-    </Call>
+    </Arg>
+  </Call>
 
-    <!-- =========================================================== -->
-    <!-- Configure Request Log                                       -->
-    <!-- Request logs  may be configured for the entire server here, -->
-    <!-- or they can be configured for a specific web app in a       -->
-    <!-- contexts configuration (see $(jetty.home)/contexts/test.xml -->
-    <!-- for an example).                                            -->
-    <!-- =========================================================== -->
-    <Ref id="RequestLog">
-      <Set name="requestLog">
-        <New id="RequestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog">
-          <Set name="filename"><SystemProperty name="jetty.logs" default="./logs"/>/request-yyyy_mm_dd.log</Set>
-          <Set name="filenameDateFormat">yyyyMMdd</Set>
-          <Set name="retainDays">90</Set>
-          <Set name="append">true</Set>
-          <Set name="extended">true</Set>
-          <Set name="logCookies">false</Set>
-          <Set name="LogTimeZone">GMT</Set>
-        </New>
+  <!-- =========================================================== -->
+  <!-- Set handler Collection Structure                            -->
+  <!-- =========================================================== -->
+  <Set name="handler">
+    <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
+      <Set name="handlers">
+        <Array type="org.eclipse.jetty.server.Handler">
+          <Item>
+            <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
+          </Item>
+          <Item>
+            <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
+          </Item>
+        </Array>
       </Set>
-    </Ref>
+    </New>
+  </Set>
 
-    <!-- =========================================================== -->
-    <!-- extra options                                               -->
-    <!-- =========================================================== -->
-    <Set name="stopAtShutdown">true</Set>
-    <Set name="sendServerVersion">true</Set>
-    <Set name="sendDateHeader">true</Set>
-    <Set name="gracefulShutdown">1000</Set>
+  <Call name="setRequestLog">
+    <Arg>
+      <New id="RequestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog">
+        <Set name="filename"><SystemProperty name="jetty.logs" default="./logs"/>/request-yyyy_mm_dd.log</Set>
+        <Set name="filenameDateFormat">yyyyMMdd</Set>
+        <Set name="retainDays">90</Set>
+        <Set name="append">true</Set>
+        <Set name="extended">true</Set>
+        <Set name="logCookies">false</Set>
+        <Set name="LogTimeZone">GMT</Set>
+      </New>
+    </Arg>
+  </Call>
 
+  <Call name="addBean">
+    <Arg>
+      <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
+        <Set name="contexts">
+          <Ref refid="Contexts" />
+        </Set>
+        <Call id="webappprovider" name="addAppProvider">
+          <Arg>
+            <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
+              <Set name="monitoredDirName"><Property name="jetty.base" default="." />/apps</Set>
+              <Set name="configurationClasses">
+                <Array type="java.lang.String">
+                  <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
+                  <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>
+                  <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>
+                  <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>
+                  <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
+                  <Item>org.eclipse.jetty.plus.webapp.PlusConfiguration</Item>
+                  <!--Item>org.eclipse.jetty.annotations.AnnotationConfiguration</Item-->
+                  <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
+                </Array>
+              </Set>
+            </New>
+          </Arg>
+        </Call>
+      </New>
+    </Arg>
+  </Call>
 
- 
- <!-- =========================================================== -->
-  <!-- JNDI java:comp/env                                          -->
-  <!-- To use JNDI with Jetty, you will need to tell your          -->
-  <!-- WebAppContext to process the naming related items in        -->
-  <!-- web.xml. For an example of how to do that, see the test     -->
-  <!-- webapp below. More information can be found at              -->
-  <!-- http://docs.codehaus.org/display/JETTY/Jetty+Wiki           -->
   <!-- =========================================================== -->
-
-
-  <!-- Configuring <resource-ref> and <resource-env-ref>s          -->
-  <!--                                                             -->
-  <!-- The following are examples of setting up a resource that   -->
-  <!-- can be referenced in a web.xml file as a <resource-ref> or  -->
-  <!-- a <resource-env-ref>. The first argument is the name of the -->
-  <!-- resource relative to java:comp/env and must be the SAME as  -->
-  <!-- the <res-ref-name> or <resource-env-ref-name> in web.xml.   -->
-  <!-- The second argument is the construction of the resource     -->
-  <!-- object. Any object at all can be configured.                -->
-
-
-  <!-- These examples set up a javax.sql.DataSource around an      -->
-  <!-- XADataSource that is provided by the Derby relational db.   -->
-  <!-- The DataSource wrapper that is registered in JNDI is        -->
-  <!--  provided by Atomikos, and works with the Atomikos          -->
-  <!-- transaction manager configured further below. To use these  -->
-  <!-- examples, download Atomikos http://www.atomikos.com and     -->
-  <!-- Derby http://db.apache.org/derby                            -->
-
-
-  <!-- Configuring Transactions                                    -->
-  <!--                                                             -->
-  <!-- The following is a example of a setting up a JTA            -->
-  <!-- transaction manager that can be referenced by looking up    -->
-  <!-- java:comp/UserTransaction. Note that this is just an        -->
-  <!-- example and if you uncomment it, you will need to download  -->
-  <!-- the atomikos jar (see http://www.atomikos.com/download.html)-->
-  <!-- You can configure any transaction manager that implements   -->
-  <!-- javax.transaction.UserTransaction.                          -->
+  <!-- extra options                                               -->
+  <!-- =========================================================== -->
+  <Set name="stopAtShutdown">true</Set>
 
 
   <Call name="setAttribute">
@@ -287,30 +198,6 @@
     </Arg>
   </New>
 
-  <!-- Users / Security Database -->
-  <!--
-  <New id="users" class="org.eclipse.jetty.plus.jndi.Resource">
-    <Arg>jdbc/users</Arg>
-    <Arg>
-      <New class="org.apache.derby.jdbc.EmbeddedDataSource">
-        <Set name="DatabaseName"><SystemProperty name="appserver.base" default=".."/>/data/databases/users</Set>
-        <Set name="user">sa</Set>
-        <Set name="createDatabase">create</Set>
-      </New>
-    </Arg>
-  </New>
-
-  <New id="usersShutdown" class="org.eclipse.jetty.plus.jndi.Resource">
-    <Arg>jdbc/usersShutdown</Arg>
-    <Arg>
-      <New class="org.apache.derby.jdbc.EmbeddedDataSource">
-        <Set name="DatabaseName"><SystemProperty name="appserver.base" default=".."/>/data/databases/users</Set>
-        <Set name="user">sa</Set>
-        <Set name="shutdownDatabase">shutdown</Set>
-      </New>
-    </Arg>
-  </New>
-  -->
   <New id="users" class="org.eclipse.jetty.plus.jndi.Resource">
     <Arg>jdbc/users</Arg>
     <Arg>
@@ -341,14 +228,5 @@
   </New>
 
 
-  <!--
-  <New id="ArchivaWebAppContext" class="org.eclipse.jetty.webapp.WebAppContext">
-    <Arg><Ref id="Handlers"/></Arg>
-    <Arg><SystemProperty name="jetty.home" default="."/>/apps/archiva</Arg>
-    <Arg>/</Arg>
-    <Set name="extractWAR">false</Set>
-    <Set name="throwUnavailableOnStartupException">true</Set>
-  </New>
-  -->
 
 </Configure>

http://git-wip-us.apache.org/repos/asf/archiva/blob/dc97f3ef/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java
index 09fdf5a..7e95b4f 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java
@@ -18,11 +18,11 @@ package org.apache.archiva.scheduler.indexing;
  * under the License.
  */
 
-import junit.framework.TestCase;
 import org.apache.archiva.admin.model.beans.RemoteRepository;
 import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
 import org.apache.archiva.common.utils.FileUtil;
+import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.maven.index.FlatSearchRequest;
@@ -30,14 +30,12 @@ import org.apache.maven.index.FlatSearchResponse;
 import org.apache.maven.index.MAVEN;
 import org.apache.maven.index.NexusIndexer;
 import org.apache.maven.index.expr.StringSearchExpression;
-import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.HttpConnectionFactory;
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.server.ServerConnector;
 import org.eclipse.jetty.servlet.DefaultServlet;
 import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
-import static org.assertj.core.api.Assertions.assertThat;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -52,7 +50,8 @@ import java.io.File;
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.concurrent.TimeUnit;
-import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
+
+import static org.assertj.core.api.Assertions.assertThat;
 
 /**
  * @author Olivier Lamy

http://git-wip-us.apache.org/repos/asf/archiva/blob/dc97f3ef/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml
index e1ac74b..72d2deb 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml
@@ -51,7 +51,7 @@
     </init-param>
     <init-param>
       <param-name>forceEncoding</param-name>
-      <param-value>true</param-value>
+      <param-value>false</param-value>
     </init-param>
   </filter>