From dd311845e13f46062251744f7cc2cfd21e2e5cf4 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Fri, 30 Dec 2016 15:35:19 +0100 Subject: [PATCH] Use JPA as default and only database backend Remove the JDO dependencies and set the JPA implementation as only database alternative and default implementation. Uses the same database as JDO before. --- .../archiva-base/archiva-indexer/pom.xml | 5 ++ .../archiva-base/archiva-proxy/pom.xml | 6 ++ .../archiva-repository-admin-default/pom.xml | 6 ++ .../archiva-scheduler-indexing/pom.xml | 6 ++ .../archiva-rest-services/pom.xml | 12 ++++ ...edbackRuntimeConfigurationServiceTest.java | 8 +-- .../META-INF/spring-context-test.xml | 2 +- .../archiva-web/archiva-web-common/pom.xml | 12 ++++ .../resources/META-INF/spring-context.xml | 2 +- .../archiva/web/rss/SecuritySystemStub.java | 4 +- .../spring-context-artifacts-download.xml | 1 - .../resources/spring-context-test-common.xml | 2 +- .../resources/META-INF/spring-context.xml | 2 +- .../webapp/WEB-INF/applicationContext.xml | 59 +++++++++---------- .../src/main/webapp/WEB-INF/web.xml | 6 -- .../src/test/tomcat/log4j2-test.xml | 9 ++- .../test/tomcat/tomcat-context-archiva.xml | 7 +-- .../archiva-web/archiva-webdav/pom.xml | 5 ++ .../spring-context-servlet-security-test.xml | 2 +- .../src/test/resources/spring-context.xml | 2 +- pom.xml | 11 ++++ 21 files changed, 110 insertions(+), 59 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-indexer/pom.xml b/archiva-modules/archiva-base/archiva-indexer/pom.xml index 6996bdd96..99b4bc2ac 100644 --- a/archiva-modules/archiva-base/archiva-indexer/pom.xml +++ b/archiva-modules/archiva-base/archiva-indexer/pom.xml @@ -168,6 +168,11 @@ xercesImpl test + + org.hsqldb + hsqldb + test + diff --git a/archiva-modules/archiva-base/archiva-proxy/pom.xml b/archiva-modules/archiva-base/archiva-proxy/pom.xml index 0cc6cb785..c5ccbdfa0 100644 --- a/archiva-modules/archiva-base/archiva-proxy/pom.xml +++ b/archiva-modules/archiva-base/archiva-proxy/pom.xml @@ -209,6 +209,12 @@ assertj-core test + + org.hsqldb + hsqldb + test + + diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml index 1bca20bb3..cfee935fa 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml @@ -235,6 +235,12 @@ test + + org.hsqldb + hsqldb + test + + diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml index f1c74aef9..bad98fcce 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml @@ -177,6 +177,12 @@ test + + org.hsqldb + hsqldb + test + + 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 39bafe6e7..3436e6af6 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 @@ -315,6 +315,12 @@ test ${redback.version} + + org.apache.archiva.redback + redback-keys-jpa + test + ${redback.version} + org.apache.archiva @@ -322,6 +328,12 @@ test + + org.hsqldb + hsqldb + test + + org.apache.jackrabbit jackrabbit-core diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RedbackRuntimeConfigurationServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RedbackRuntimeConfigurationServiceTest.java index 42d99a59e..bddb302ec 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RedbackRuntimeConfigurationServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RedbackRuntimeConfigurationServiceTest.java @@ -40,7 +40,7 @@ public class RedbackRuntimeConfigurationServiceTest { RedbackRuntimeConfiguration redbackRuntimeConfiguration = getRedbackRuntimeConfigurationService().getRedbackRuntimeConfiguration(); - assertEquals( "jdo", redbackRuntimeConfiguration.getUserManagerImpls().get( 0 ) ); + assertEquals( "jpa", redbackRuntimeConfiguration.getUserManagerImpls().get( 0 ) ); } @Test @@ -49,7 +49,7 @@ public class RedbackRuntimeConfigurationServiceTest { RedbackRuntimeConfiguration redbackRuntimeConfiguration = getRedbackRuntimeConfigurationService().getRedbackRuntimeConfiguration(); - assertEquals( "jdo", redbackRuntimeConfiguration.getUserManagerImpls().get( 0 ) ); + assertEquals( "jpa", redbackRuntimeConfiguration.getUserManagerImpls().get( 0 ) ); redbackRuntimeConfiguration.setUserManagerImpls( Arrays.asList( "foo" ) ); @@ -68,7 +68,7 @@ public class RedbackRuntimeConfigurationServiceTest RedbackRuntimeConfigurationService service = getRedbackRuntimeConfigurationService(); List infos = service.getUserManagerImplementationInformations(); assertThat( infos ).isNotNull().isNotEmpty().contains( - new UserManagerImplementationInformation( "jdo", null, false ) ); + new UserManagerImplementationInformation( "jpa", null, false ) ); } @@ -79,7 +79,7 @@ public class RedbackRuntimeConfigurationServiceTest RedbackRuntimeConfigurationService service = getRedbackRuntimeConfigurationService(); List infos = service.getRbacManagerImplementationInformations(); assertThat( infos ).isNotNull().isNotEmpty().contains( - new RBACManagerImplementationInformation( "jdo", null, false ) ); + new RBACManagerImplementationInformation( "jpa", null, false ) ); } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-test.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-test.xml index 951ced8f4..27d764d58 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-test.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-test.xml @@ -32,7 +32,7 @@ + base-package="org.apache.archiva.redback.keys,org.apache.archiva.rest.services.utils"/> diff --git a/archiva-modules/archiva-web/archiva-web-common/pom.xml b/archiva-modules/archiva-web/archiva-web-common/pom.xml index a51aa0e79..971da5c73 100644 --- a/archiva-modules/archiva-web/archiva-web-common/pom.xml +++ b/archiva-modules/archiva-web/archiva-web-common/pom.xml @@ -338,6 +338,12 @@ test + + org.apache.archiva.redback + redback-keys-jpa + test + + org.apache.archiva.redback redback-rest-services @@ -414,6 +420,12 @@ test + + org.hsqldb + hsqldb + test + + diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml index f3f50bf8d..1a981c78c 100755 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml @@ -34,7 +34,7 @@ default-lazy-init="true"> - + diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java index 16c84f23b..eda8af6a8 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java @@ -36,7 +36,7 @@ import org.apache.archiva.redback.users.UserManagerException; import org.apache.archiva.redback.users.UserManagerListener; import org.apache.archiva.redback.users.UserNotFoundException; import org.apache.archiva.redback.users.UserQuery; -import org.apache.archiva.redback.users.jdo.JdoUser; +import org.apache.archiva.redback.users.jpa.model.JpaUser; import java.util.ArrayList; import java.util.Date; @@ -74,7 +74,7 @@ public class SecuritySystemStub { result = new AuthenticationResult( true, source.getUsername(), null ); - User user = new JdoUser(); + User user = new JpaUser(); user.setUsername( source.getUsername() ); user.setPassword( users.get( source.getUsername() ) ); diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-artifacts-download.xml b/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-artifacts-download.xml index 08974cf01..570eeb588 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-artifacts-download.xml +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-artifacts-download.xml @@ -30,7 +30,6 @@ - diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-test-common.xml b/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-test-common.xml index 2937490c3..9bc51d7b2 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-test-common.xml +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-test-common.xml @@ -29,7 +29,7 @@ + base-package="org.apache.archiva.redback.keys,org.apache.archiva.rest.services.utils"/> diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/META-INF/spring-context.xml index 3c5ad2e98..b0b3840b6 100755 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/META-INF/spring-context.xml @@ -49,7 +49,7 @@ - + diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml index e11370579..49f0301db 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml @@ -21,6 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:task="http://www.springframework.org/schema/task" xmlns:util="http://www.springframework.org/schema/util" + xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context @@ -28,7 +29,8 @@ http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd http://www.springframework.org/schema/util - http://www.springframework.org/schema/util/spring-util.xsd"> + http://www.springframework.org/schema/util/spring-util.xsd + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> @@ -108,37 +110,6 @@ - - - - - - - true - false - false - false - None - READ_COMMITTED - READ_COMMITTED - JDK_DEFAULT_TIMEZONE - - 255 - - - - - true - ehcacheclassbased - defaultJpox - /ehcache.xml - - - - - @@ -324,4 +295,28 @@ --> + + + + + + + + + + + + + + + + + + + + + + + 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 83714e280..e1ac74b03 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 @@ -143,12 +143,6 @@ Container Shareable - - jdbc/redbackjpa - javax.sql.DataSource - Container - Shareable - mail/Session javax.mail.Session diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/log4j2-test.xml b/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/log4j2-test.xml index e4e860f73..55668911a 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/log4j2-test.xml +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/log4j2-test.xml @@ -26,12 +26,14 @@ - + + filePattern="${logsDirectory}/archiva-%d{MM-dd-yyyy}.log" + + immediateFlush="true" append="true"> %d [%t] %-5p %c %x - %m%n @@ -82,6 +84,9 @@ + + + diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/tomcat-context-archiva.xml b/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/tomcat-context-archiva.xml index 3f511020d..9e5769484 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/tomcat-context-archiva.xml +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/tomcat-context-archiva.xml @@ -24,12 +24,7 @@ driverClassName="org.apache.derby.jdbc.EmbeddedDriver" url="jdbc:derby:${appserver.base}/database/users;create=true" /> - + diff --git a/archiva-modules/archiva-web/archiva-webdav/pom.xml b/archiva-modules/archiva-web/archiva-webdav/pom.xml index e34e512fd..ec877a212 100644 --- a/archiva-modules/archiva-web/archiva-webdav/pom.xml +++ b/archiva-modules/archiva-web/archiva-webdav/pom.xml @@ -149,6 +149,11 @@ redback-rbac-memory test + + org.apache.archiva.redback + redback-keys-jpa + test + org.apache.archiva.redback redback-users-memory diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context-servlet-security-test.xml b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context-servlet-security-test.xml index f747bdb8f..1619c96e5 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context-servlet-security-test.xml +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context-servlet-security-test.xml @@ -31,7 +31,7 @@ + base-package="org.apache.archiva.redback.keys,org.apache.archiva.webdav,org.apache.archiva.metadata.repository,org.apache.archiva.webdav.util,org.apache.archiva.common.plexusbridge"/> diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context.xml b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context.xml index fe8f0b82e..66f4661ce 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context.xml +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context.xml @@ -30,7 +30,7 @@ - + diff --git a/pom.xml b/pom.xml index 107668b6e..733184cc5 100644 --- a/pom.xml +++ b/pom.xml @@ -1029,6 +1029,17 @@ + + org.apache.archiva.redback + redback-keys-jpa + ${redback.version} + + + commons-logging + commons-logging + + + org.apache.archiva.redback redback-rbac-model -- 2.39.5