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:00 UTC

[15/50] archiva git commit: upgrade to jetty 9.4 for archiva-rest-services module

upgrade to jetty  9.4 for archiva-rest-services module

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/52147ba0
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/52147ba0
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/52147ba0

Branch: refs/heads/citest
Commit: 52147ba0576c76c8950c3fa44e86d15b97af15a2
Parents: 1acc6e7
Author: olivier lamy <ol...@apache.org>
Authored: Thu May 11 21:38:51 2017 +1000
Committer: olivier lamy <ol...@apache.org>
Committed: Thu May 11 21:38:51 2017 +1000

----------------------------------------------------------------------
 .../archiva-rest/archiva-rest-services/pom.xml  | 23 ++++------
 .../rest/services/DefaultPluginsServices.java   | 44 +++++++++++---------
 .../src/test/resources/log4j2-test.xml          | 11 ++---
 .../archiva-web/archiva-security/pom.xml        |  2 +-
 .../archiva-web/archiva-web-common/pom.xml      |  7 +---
 pom.xml                                         |  7 +---
 6 files changed, 38 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva/blob/52147ba0/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
index cc44422..f77fbc1 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
@@ -37,6 +37,7 @@
     -->
     <redbackTestJdbcUrl>jdbc:hsqldb:mem:redback-test</redbackTestJdbcUrl>
     <redbackTestJdbcDriver>org.hsqldb.jdbcDriver</redbackTestJdbcDriver>
+    <jetty.version>9.4.5.v20170502</jetty.version>
   </properties>
 
   <dependencies>
@@ -384,24 +385,14 @@
     </dependency>
 
     <dependency>
-      <groupId>org.apache.tomcat.embed</groupId>
-      <artifactId>tomcat-embed-core</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.tomcat</groupId>
-      <artifactId>tomcat-juli</artifactId>
-      <scope>test</scope>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-server</artifactId>
+      <version>${jetty.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.apache.tomcat.embed</groupId>
-      <artifactId>tomcat-embed-logging-juli</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.tomcat</groupId>
-      <artifactId>tomcat-jsp-api</artifactId>
-      <scope>test</scope>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-servlet</artifactId>
+      <version>${jetty.version}</version>
     </dependency>
     <dependency>
       <groupId>xerces</groupId>

http://git-wip-us.apache.org/repos/asf/archiva/blob/52147ba0/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultPluginsServices.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultPluginsServices.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultPluginsServices.java
index 4cab81d..208400c 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultPluginsServices.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultPluginsServices.java
@@ -18,26 +18,25 @@ package org.apache.archiva.rest.services;
  * under the License.
  */
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
-import org.springframework.stereotype.Service;
-
-import javax.inject.Inject;
-
 import org.apache.archiva.rest.api.services.PluginsService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.ApplicationContext;
 import org.springframework.core.io.Resource;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Inject;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 
 /**
  * @author Eric Barboni
  * @since 1.4.0
  */
-@Service("pluginsService#rest")
+@Service( "pluginsService#rest" )
 public class DefaultPluginsServices
     implements PluginsService
 {
@@ -46,7 +45,7 @@ public class DefaultPluginsServices
 
     private List<String> adminFeatures = new ArrayList<>();
 
-    private ApplicationContext appCont;
+    private ApplicationContext applicationContext;
 
     private Logger log = LoggerFactory.getLogger( getClass() );
 
@@ -56,11 +55,14 @@ public class DefaultPluginsServices
     public DefaultPluginsServices( ApplicationContext applicationContext )
         throws IOException
     {
-        this.appCont = applicationContext;
+        log.debug( "init DefaultPluginsServices" );
+        this.applicationContext = applicationContext;
 
         // rebuild
-        feed( repositoryType, "repository" );
-        feed( adminFeatures, "features" );
+        repositoryType = feed( "repository" );
+        log.debug( "feed {}:{}", "repository" , repositoryType);
+        adminFeatures = feed( "features" );
+        log.debug( "feed {}:{}", "features", adminFeatures );
         StringBuilder sb = new StringBuilder();
         for ( String repoType : repositoryType )
         {
@@ -81,27 +83,29 @@ public class DefaultPluginsServices
         }
     }
 
-    private void feed( List<String> repository, String key )
+    private List<String> feed( String key )
         throws IOException
     {
         log.info( "Feeding: {}", key );
-        repository.clear();
-        Resource[] xmlResources;
-
-        xmlResources = appCont.getResources( "/**/" + key + "/**/main.js" );
+        Resource[] xmlResources = applicationContext.getResources( "/**/" + key + "/**/main.js" );
+        if (xmlResources == null)
+        {
+            return Collections.emptyList();
+        }
+        List<String> repository = new ArrayList<>( xmlResources.length );
         for ( Resource rc : xmlResources )
         {
             String tmp = rc.getURL().toString();
             tmp = tmp.substring( tmp.lastIndexOf( key ) + key.length() + 1, tmp.length() - 8 );
             repository.add( "archiva/admin/" + key + "/" + tmp + "/main" );
         }
-
+        return repository;
     }
 
     @Override
     public String getAdminPlugins()
         throws ArchivaRestServiceException
     {
-        return  adminPlugins;
+        return adminPlugins;
     }
 }

http://git-wip-us.apache.org/repos/asf/archiva/blob/52147ba0/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml
index a7e0139..4d7c9ab 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml
@@ -19,7 +19,7 @@
   -->
 
 
-<configuration status="debug">
+<configuration> <!-- status="debug" -->
   <appenders>
     <Console name="console" target="SYSTEM_OUT">
       <PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} [%L] [%t] %-5level %logger{3} - %msg%n}" />
@@ -27,13 +27,10 @@
   </appenders>
   <loggers>
 
-    <logger name="org.codehaus.redback.rest.services" level="error"/>
-
+    <logger name="org.apache.archiva.redback.rest.services" level="error"/>
     <logger name="JPOX" level="error"/>
-
-
-    <logger name="org.springframework" level="error"/>
-
+    <logger name="org.apache.archiva.rest.services" level="info"/>
+    <logger name="org.springframework" level="info"/>
     <logger name="org.apache.commons.configuration" level="error"/>
 
     <root level="info">

http://git-wip-us.apache.org/repos/asf/archiva/blob/52147ba0/archiva-modules/archiva-web/archiva-security/pom.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-security/pom.xml b/archiva-modules/archiva-web/archiva-security/pom.xml
index 66aa53b..1213162 100644
--- a/archiva-modules/archiva-web/archiva-security/pom.xml
+++ b/archiva-modules/archiva-web/archiva-security/pom.xml
@@ -47,7 +47,7 @@
     </dependency>
     <dependency>
       <groupId>javax.servlet</groupId>
-      <artifactId>servlet-api</artifactId>
+      <artifactId>javax.servlet-api</artifactId>
       <scope>provided</scope>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/archiva/blob/52147ba0/archiva-modules/archiva-web/archiva-web-common/pom.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-web-common/pom.xml b/archiva-modules/archiva-web/archiva-web-common/pom.xml
index 6d9c94c..e3b113a 100644
--- a/archiva-modules/archiva-web/archiva-web-common/pom.xml
+++ b/archiva-modules/archiva-web/archiva-web-common/pom.xml
@@ -186,11 +186,6 @@
       <artifactId>audit</artifactId>
     </dependency>
     <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>javax.servlet-api</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
       <groupId>javax.ws.rs</groupId>
       <artifactId>javax.ws.rs-api</artifactId>
     </dependency>
@@ -234,7 +229,7 @@
     </dependency>
     <dependency>
       <groupId>javax.servlet</groupId>
-      <artifactId>servlet-api</artifactId>
+      <artifactId>javax.servlet-api</artifactId>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>

http://git-wip-us.apache.org/repos/asf/archiva/blob/52147ba0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 554c35e..53b389a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1202,13 +1202,8 @@
       </dependency>
       <dependency>
         <groupId>javax.servlet</groupId>
-        <artifactId>servlet-api</artifactId>
-        <version>2.5</version>
-      </dependency>
-      <dependency>
-        <groupId>javax.servlet</groupId>
         <artifactId>javax.servlet-api</artifactId>
-        <version>3.0.1</version>
+        <version>3.1.0</version>
       </dependency>
       <dependency>
         <groupId>org.slf4j</groupId>