diff options
author | Martin Stockhammer <martin_s@apache.org> | 2016-10-09 21:20:45 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2016-10-09 21:20:45 +0200 |
commit | b7174c444032ce5431fdf9d96cf7bd82060536cd (patch) | |
tree | 74deeee62aa7b7713c287ff4c71bb838377ad9ee /archiva-modules/archiva-web | |
parent | 0cc2733ca000451ebc26f2f76178d64bfdc92f36 (diff) | |
download | archiva-b7174c444032ce5431fdf9d96cf7bd82060536cd.tar.gz archiva-b7174c444032ce5431fdf9d96cf7bd82060536cd.zip |
Adding JPA provider as user manager
Diffstat (limited to 'archiva-modules/archiva-web')
4 files changed, 65 insertions, 3 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp/pom.xml b/archiva-modules/archiva-web/archiva-webapp/pom.xml index f5658d6ba..734a59768 100644 --- a/archiva-modules/archiva-web/archiva-webapp/pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp/pom.xml @@ -831,6 +831,18 @@ <scope>test</scope> </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-orm</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring.version}</version> + </dependency> + + </dependencies> @@ -969,6 +981,8 @@ <additionalClasspathDirs> <additionalClasspathDir>${basedir}/src/test/tomcat</additionalClasspathDir> </additionalClasspathDirs> + + </configuration> <dependencies> <dependency> @@ -981,6 +995,27 @@ <artifactId>mail</artifactId> <version>${javaxMailVersion}</version> </dependency> + <dependency> + <groupId>org.apache.openjpa</groupId> + <artifactId>openjpa</artifactId> + <version>${openjpaVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.geronimo.specs</groupId> + <artifactId>geronimo-jpa_2.0_spec</artifactId> + <version>1.1</version> + </dependency> + <dependency> + <groupId>org.apache.geronimo.specs</groupId> + <artifactId>geronimo-jta_1.1_spec</artifactId> + <version>1.1.1</version> + </dependency> + <dependency> + <groupId>net.sourceforge.serp</groupId> + <artifactId>serp</artifactId> + <version>1.15.1</version> + </dependency> + </dependencies> </plugin> 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 06cf58a64..d295d09c5 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 @@ -21,13 +21,14 @@ <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" - xmlns:util="http://www.springframework.org/schema/util" + xmlns:util="http://www.springframework.org/schema/util" xmlns:jee="http://www.springframework.org/schema/jee" + 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 http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/util - http://www.springframework.org/schema/util/spring-util-3.0.xsd" + http://www.springframework.org/schema/util/spring-util-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd" default-lazy-init="true"> <context:annotation-config/> @@ -48,5 +49,15 @@ + <jee:jndi-lookup id="dataSource" jndi-name="java:/comp/env/jdbc/redbackjpa" /> + <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> + <property name="dataSource" ref="dataSource" /> + <property name="jpaVendorAdapter" > + <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" /> + </property> + </bean> + + + </beans>
\ No newline at end of file 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 e1ac74b03..83714e280 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 @@ -144,6 +144,12 @@ <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> <resource-ref> + <res-ref-name>jdbc/redbackjpa</res-ref-name> + <res-type>javax.sql.DataSource</res-type> + <res-auth>Container</res-auth> + <res-sharing-scope>Shareable</res-sharing-scope> + </resource-ref> + <resource-ref> <res-ref-name>mail/Session</res-ref-name> <res-type>javax.mail.Session</res-type> <res-auth>Container</res-auth> 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 4f7ce1d69..3f511020d 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,8 +24,18 @@ driverClassName="org.apache.derby.jdbc.EmbeddedDriver" url="jdbc:derby:${appserver.base}/database/users;create=true" /> + <Resource name="jdbc/redbackjpa" auth="Container" type="javax.sql.DataSource" + username="sa" + password="" + driverClassName="org.apache.derby.jdbc.EmbeddedDriver" + url="jdbc:derby:${appserver.base}/database/jpausers;create=true" + /> <Resource name="mail/Session" auth="Container" type="javax.mail.Session" mail.smtp.host="localhost"/> - + + + + + </Context> |