]> source.dussan.org Git - archiva.git/commitdiff
upgrade to cxf 3.0.3
authorOlivier Lamy <olamy@apache.org>
Fri, 6 Feb 2015 12:30:09 +0000 (23:30 +1100)
committerOlivier Lamy <olamy@apache.org>
Fri, 6 Feb 2015 12:30:36 +0000 (23:30 +1100)
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/CopyArtifactTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/PingServiceTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RemoteRepositoriesServiceTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java
archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java
archiva-modules/archiva-web/archiva-webapp/pom.xml
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/BypassSecuritySystem.java
pom.xml

index b56d3adf6f4cd79aba916f15d8366e503462d65b..39781728d6141c6dc8bf5926de11716d78dc972f 100644 (file)
     <!-- normally not needed but here for wadl feature currently in cxf -->
     <dependency>
       <groupId>org.apache.cxf</groupId>
-      <artifactId>cxf-bundle-jaxrs</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>org.eclipse.jetty</groupId>
-          <artifactId>jetty-server</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>commons-logging</groupId>
-          <artifactId>commons-logging</artifactId>
-        </exclusion>
-      </exclusions>
+      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
     </dependency>
 
   </dependencies>
index c63241d2af355a70ce8c0d94e07ef8ac03c6c739..1fafc81be48b44f8a42ac5a85bd712f4ca14d4c4 100644 (file)
     </dependency>
     <dependency>
       <groupId>org.apache.cxf</groupId>
-      <artifactId>cxf-bundle-jaxrs</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>org.eclipse.jetty</groupId>
-          <artifactId>jetty-server</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.codehaus.jettison</groupId>
-          <artifactId>jettison</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.geronimo.specs</groupId>
-          <artifactId>geronimo-servlet_2.5_spec</artifactId>
-        </exclusion>
-      </exclusions>
+      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-rs-extension-providers</artifactId>
     </dependency>
+
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-rs-client</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+
+
     <dependency>
       <groupId>org.apache.archiva.redback</groupId>
       <artifactId>redback-rest-services</artifactId>
       <scope>test</scope>
     </dependency>
 
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jul-to-slf4j</artifactId>
+      <scope>test</scope>
+    </dependency>
+
     <dependency>
       <groupId>org.hsqldb</groupId>
       <artifactId>hsqldb</artifactId>
index 526d40662e8fc158954bb1fa0d93bdd2b2c6014b..abfdf827c5aa09975ce53e041810aabae08e555b 100644 (file)
@@ -18,12 +18,9 @@ package org.apache.archiva.rest.services;
  * under the License.
  */
 
-import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.rest.api.model.ArtifactTransferRequest;
 import org.apache.archiva.rest.api.services.RepositoriesService;
-import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
-import org.apache.cxf.jaxrs.client.ServerWebApplicationException;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -79,7 +76,7 @@ public class CopyArtifactTest
         }
     }
 
-    @Test( expected = ServerWebApplicationException.class )
+    @Test( expected = Exception.class )
     public void copyNonExistingArtifact()
         throws Throwable
     {
@@ -95,9 +92,9 @@ public class CopyArtifactTest
             artifactTransferRequest.setTargetRepositoryId( TARGET_REPO_ID );
             RepositoriesService repositoriesService = getRepositoriesService( authorizationHeader );
 
-            Boolean res = repositoriesService.copyArtifact( artifactTransferRequest );
+            repositoriesService.copyArtifact( artifactTransferRequest );
         }
-        catch ( ServerWebApplicationException e )
+        catch ( Exception e )
         {
             assertTrue( StringUtils.contains( e.getMessage(), "cannot find artifact" ) );
             throw e;
index 2786a25d0f17f377c783a311b0379bf6bb78bce6..7fb242e9572951dd055830f68978e0563e8bc1c4 100644 (file)
@@ -20,11 +20,12 @@ package org.apache.archiva.rest.services;
  */
 
 import org.apache.archiva.rest.api.services.PingService;
-import org.apache.cxf.jaxrs.client.ServerWebApplicationException;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.junit.Ignore;
 import org.junit.Test;
 
+import javax.ws.rs.ForbiddenException;
+
 /**
  * @author Olivier Lamy
  * @since 1.4-M1
@@ -45,7 +46,7 @@ public class PingServiceTest
         assertEquals( "Yeah Baby It rocks!", res );
     }
 
-    @Test( expected = ServerWebApplicationException.class )
+    @Test( expected = ForbiddenException.class )
     public void pingWithAuthzFailed()
         throws Exception
     {
@@ -55,9 +56,9 @@ public class PingServiceTest
             String res = getPingService().pingWithAuthz();
             fail( "not in exception" );
         }
-        catch ( ServerWebApplicationException e )
+        catch ( ForbiddenException e )
         {
-            assertEquals( 403, e.getStatus() );
+            assertEquals( 403, e.getResponse().getStatus() );
             throw e;
         }
     }
index 4d7d78c2131c32d7e474fbe57d38e7f51eb11436..db857719f15bd2ec86a00b7b4dd4ae3a11156585 100644 (file)
@@ -21,10 +21,10 @@ package org.apache.archiva.rest.services;
 
 import org.apache.archiva.admin.model.beans.RemoteRepository;
 import org.apache.archiva.rest.api.services.RemoteRepositoriesService;
-import org.apache.cxf.jaxrs.client.ServerWebApplicationException;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.junit.Test;
 
+import javax.ws.rs.ForbiddenException;
 import java.util.List;
 
 /**
@@ -35,7 +35,7 @@ public class RemoteRepositoriesServiceTest
 {
 
 
-    @Test (expected = ServerWebApplicationException.class)
+    @Test( expected = ForbiddenException.class )
     public void listRemoteRepositoriesKarmaFailed()
         throws Exception
     {
@@ -44,9 +44,9 @@ public class RemoteRepositoriesServiceTest
         {
             assertFalse( service.getRemoteRepositories().isEmpty() );
         }
-        catch ( ServerWebApplicationException e )
+        catch ( ForbiddenException e )
         {
-            assertEquals( 403, e.getStatus() );
+            assertEquals( 403, e.getResponse().getStatus() );
             throw e;
         }
     }
index 12070c3ac680b6c6d8f1d7c2da4214a12908705a..51c1bff85f58489bd31f460a16450addf39fee8d 100644 (file)
@@ -29,13 +29,14 @@ import org.apache.archiva.rest.api.services.BrowseService;
 import org.apache.archiva.rest.api.services.ManagedRepositoriesService;
 import org.apache.archiva.rest.api.services.RepositoriesService;
 import org.apache.commons.io.FileUtils;
-import org.apache.cxf.jaxrs.client.ServerWebApplicationException;
-import static org.assertj.core.api.Assertions.assertThat;
 import org.junit.Test;
 
+import javax.ws.rs.ForbiddenException;
 import java.io.File;
 import java.util.List;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 /**
  * @author Olivier Lamy
  */
@@ -43,7 +44,7 @@ public class RepositoriesServiceTest
     extends AbstractArchivaRestTest
 {
 
-    @Test ( expected = ServerWebApplicationException.class )
+    @Test( expected = ForbiddenException.class )
     public void scanRepoKarmaFailed()
         throws Exception
     {
@@ -52,9 +53,9 @@ public class RepositoriesServiceTest
         {
             service.scanRepository( "id", true );
         }
-        catch ( ServerWebApplicationException e )
+        catch ( ForbiddenException e )
         {
-            assertEquals( 403, e.getStatus() );
+            assertEquals( 403, e.getResponse().getStatus() );
             throw e;
         }
     }
@@ -79,7 +80,7 @@ public class RepositoriesServiceTest
         assertTrue( service.scanRepository( repoId, true ) );
     }
 
-    @Test ( expected = ServerWebApplicationException.class )
+    @Test( expected = ForbiddenException.class )
     public void deleteArtifactKarmaFailed()
         throws Exception
     {
@@ -96,15 +97,15 @@ public class RepositoriesServiceTest
 
             repositoriesService.deleteArtifact( artifact );
         }
-        catch ( ServerWebApplicationException e )
+        catch ( ForbiddenException e )
         {
-            assertEquals( 403, e.getStatus() );
+            assertEquals( 403, e.getResponse().getStatus() );
             throw e;
 
         }
     }
 
-    @Test ( expected = ServerWebApplicationException.class )
+    @Test( expected = ForbiddenException.class )
     public void deleteWithRepoNull()
         throws Exception
     {
@@ -121,9 +122,9 @@ public class RepositoriesServiceTest
 
             repositoriesService.deleteArtifact( artifact );
         }
-        catch ( ServerWebApplicationException e )
+        catch ( ForbiddenException e )
         {
-            assertEquals( "not http 400 status", 400, e.getStatus() );
+            assertEquals( "not http 400 status", 400, e.getResponse().getStatus() );
             throw e;
         }
     }
index 53cfeb5cc0b661480860a5646408423f70cbc5cb..16c84f23bc3b96ba58e9d11bcdd6217d95d607a7 100644 (file)
@@ -104,6 +104,13 @@ public class SecuritySystemStub
         return result;
     }
 
+    @Override
+    public AuthorizationResult authorize( User user, String permission, String resource )
+        throws AuthorizationException
+    {
+        return null;
+    }
+
     public String getAuthenticatorId()
     {
         return null;
index c12918ef9cb5aa7bf214dd14331dc0534199f302..27b5030231ba5528588c762e447284c6cd8a4e1c 100644 (file)
     </dependency>
     <dependency>
       <groupId>org.apache.cxf</groupId>
-      <artifactId>cxf-bundle-jaxrs</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>org.eclipse.jetty</groupId>
-          <artifactId>jetty-server</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.eclipse.jetty</groupId>
-          <artifactId>jetty-continuation</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.eclipse.jetty</groupId>
-          <artifactId>jetty-http</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.eclipse.jetty</groupId>
-          <artifactId>jetty-io</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.eclipse.jetty</groupId>
-          <artifactId>jetty-util</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.eclipse.jetty</groupId>
-          <artifactId>jetty-security</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.geronimo.specs</groupId>
-          <artifactId>geronimo-servlet_2.5_spec</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.geronimo.specs</groupId>
-          <artifactId>geronimo-javamail_1.4_spec</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.geronimo.specs</groupId>
-          <artifactId>geronimo-stax-api_1.0_spec</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.geronimo.specs</groupId>
-          <artifactId>geronimo-activation_1.1_spec</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.codehaus.jettison</groupId>
-          <artifactId>jettison</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>com.sun.xml.bind</groupId>
-          <artifactId>jaxb-impl</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>javax.xml.bind</groupId>
-          <artifactId>jaxb-api</artifactId>
-        </exclusion>
-      </exclusions>
+      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-rs-extension-providers</artifactId>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
index a8587718b8597aa822874813c6eb43df6b6df8ea..fed66b90ad1626f3496e784f53b79737d1784401 100644 (file)
@@ -82,6 +82,8 @@ public class BypassSecuritySystem
         return new AuthorizationResult( true, session.getUser(), null );
     }
 
+
+
     @Override
     public String getAuthenticatorId()
     {
diff --git a/pom.xml b/pom.xml
index a1406a958eba626a47a2625fb03a464ecf2aba0d..52a69c658f32a0021aabc980486606a8a40a1842 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -71,7 +71,7 @@
     <redback.registry.version>2.4-SNAPSHOT</redback.registry.version>
     <redback.spring-utils.version>2.1</redback.spring-utils.version>
     <redback.taskqueue.version>2.1</redback.taskqueue.version>
-    <slf4j.version>1.7.7</slf4j.version>
+    <slf4j.version>1.7.10</slf4j.version>
     <log4j.version>2.1</log4j.version>
 
     <spring.version>4.1.4.RELEASE</spring.version>
@@ -85,7 +85,7 @@
 
     <sirona.version>0.1-incubating</sirona.version>
 
-    <cxfVersion>2.6.15</cxfVersion>
+    <cxf.version>3.0.3</cxf.version>
     <derbyVersion>10.10.1.1</derbyVersion>
     <httpclient.version>4.3.6</httpclient.version>
     <httpclient.core.version>4.4</httpclient.core.version>
       </dependency>
       <dependency>
         <groupId>org.apache.cxf</groupId>
-        <artifactId>cxf-bundle-jaxrs</artifactId>
-        <version>${cxfVersion}</version>
-        <exclusions>
-          <exclusion>
-            <groupId>org.eclipse.jetty</groupId>
-            <artifactId>jetty-server</artifactId>
-          </exclusion>
-          <exclusion>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-          </exclusion>
-          <exclusion>
-            <groupId>org.codehaus.jettison</groupId>
-            <artifactId>jettison</artifactId>
-          </exclusion>
-        </exclusions>
+        <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+        <version>${cxf.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-rt-rs-client</artifactId>
+        <version>${cxf.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-rt-rs-extension-providers</artifactId>
+        <version>${cxf.version}</version>
       </dependency>
       <dependency>
         <groupId>org.apache.archiva</groupId>
         <version>${slf4j.version}</version>
         <scope>runtime</scope>
       </dependency>
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>jul-to-slf4j</artifactId>
+        <version>${slf4j.version}</version>
+        <scope>test</scope>
+      </dependency>
 
       <dependency>
         <groupId>commons-logging</groupId>