You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

applicationContext.xml 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Licensed to the Apache Software Foundation (ASF) under one
  4. ~ or more contributor license agreements. See the NOTICE file
  5. ~ distributed with this work for additional information
  6. ~ regarding copyright ownership. The ASF licenses this file
  7. ~ to you under the Apache License, Version 2.0 (the
  8. ~ "License"); you may not use this file except in compliance
  9. ~ with the License. You may obtain a copy of the License at
  10. ~
  11. ~ http://www.apache.org/licenses/LICENSE-2.0
  12. ~
  13. ~ Unless required by applicable law or agreed to in writing,
  14. ~ software distributed under the License is distributed on an
  15. ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. ~ KIND, either express or implied. See the License for the
  17. ~ specific language governing permissions and limitations
  18. ~ under the License.
  19. -->
  20. <beans xmlns="http://www.springframework.org/schema/beans"
  21. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  22. xmlns:context="http://www.springframework.org/schema/context"
  23. xmlns:task="http://www.springframework.org/schema/task"
  24. xmlns:tx="http://www.springframework.org/schema/tx"
  25. xsi:schemaLocation="http://www.springframework.org/schema/beans
  26. http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  27. http://www.springframework.org/schema/context
  28. http://www.springframework.org/schema/context/spring-context-3.0.xsd
  29. http://www.springframework.org/schema/task
  30. http://www.springframework.org/schema/task/spring-task-3.0.xsd
  31. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
  32. <context:property-placeholder location="classpath:application.properties" />
  33. <alias name="userConfiguration#archiva" alias="userConfiguration#default" />
  34. <alias name="authorizer#rbac" alias="authorizer#default"/>
  35. <alias name="repositoryStatisticsManager#default" alias="repositoryStatisticsManager"/>
  36. <alias name="environmentCheck#archiva-locked-admin-check" alias="environmentCheck#locked-admin-check"/>
  37. <alias name="userManager#archiva" alias="userManager#default"/>
  38. <alias name="authenticator#archiva" alias="authenticator#user-manager"/>
  39. <alias name="rbacManager#archiva" alias="rbacManager#default"/>
  40. <alias name="ldapConnectionFactory#archiva" alias="ldapConnectionFactory"/>
  41. <alias name="ldapConnectionFactory#archiva" alias="ldapConnectionFactory#configurable"/>
  42. <alias name="ldapRoleMapperConfiguration#archiva" alias="ldapRoleMapperConfiguration#default"/>
  43. <!-- only here to cleanup temp indexes for groups increase number if use for something else -->
  44. <task:executor id="springExecutor" pool-size="2"/>
  45. <task:scheduler id="springScheduler" pool-size="2"/>
  46. <task:annotation-driven executor="springExecutor" scheduler="springScheduler"/>
  47. <bean id="mailSession" class="org.springframework.jndi.JndiObjectFactoryBean">
  48. <property name="jndiName" value="java:comp/env/mail/Session">
  49. </property>
  50. </bean>
  51. <bean name="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
  52. <property name="session" ref="mailSession"/>
  53. </bean>
  54. <!-- START SNIPPET: configuration-files-list -->
  55. <bean name="commons-configuration" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry"
  56. init-method="initialize">
  57. <property name="initialConfiguration">
  58. <value>
  59. <![CDATA[
  60. <configuration>
  61. <system/>
  62. <jndi prefix="java:comp/env" config-optional="true"/>
  63. <xml fileName="${appserver.base}/conf/archiva.xml" config-optional="true"
  64. config-name="org.apache.archiva.base"
  65. config-at="org.apache.archiva"/>
  66. <xml fileName="${appserver.base}/conf/shared.xml" config-optional="true"
  67. config-name="org.apache.maven.shared.app.base" config-at="org.apache.maven.shared.app"/>
  68. <xml fileName="${appserver.base}/conf/common.xml" config-optional="true"/>
  69. <properties fileName="${appserver.base}/conf/security.properties" config-optional="true"
  70. config-at="org.apache.archiva.redback"/>
  71. <xml fileName="${appserver.home}/conf/archiva.xml" config-optional="true"
  72. config-at="org.apache.archiva"/>
  73. <xml fileName="${appserver.home}/conf/shared.xml" config-optional="true"
  74. config-at="org.apache.maven.shared.app"/>
  75. <xml fileName="${appserver.home}/conf/common.xml" config-optional="true"/>
  76. <properties fileName="${appserver.home}/conf/security.properties" config-optional="true"
  77. config-at="org.apache.archiva.redback"/>
  78. <properties fileName="org/apache/archiva/redback-security.properties" config-at="org.apache.archiva.redback"/>
  79. </configuration>
  80. ]]>
  81. </value>
  82. </property>
  83. </bean>
  84. <!-- END SNIPPET: configuration-files-list -->
  85. <bean name="scheduler" class="org.apache.archiva.components.scheduler.DefaultScheduler">
  86. <property name="properties">
  87. <props>
  88. <prop key="org.quartz.scheduler.instanceName">scheduler1</prop>
  89. <prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop>
  90. <prop key="org.quartz.threadPool.threadCount">2</prop>
  91. <prop key="org.quartz.threadPool.threadPriority">4</prop>
  92. <prop key="org.quartz.jobStore.class">org.quartz.simpl.RAMJobStore</prop>
  93. </props>
  94. </property>
  95. </bean>
  96. <!--
  97. <bean name="mimeTpes" class="org.apache.archiva.webdav.util.MimeTypes">
  98. <property name="resource" value="archiva-mime-types.txt"/>
  99. </bean>
  100. -->
  101. <!-- for change configuration of the users cache -->
  102. <bean name="cache#users" class="org.apache.archiva.components.cache.ehcache.EhcacheCache"
  103. init-method="initialize">
  104. <property name="diskPersistent" value="false"/>
  105. <property name="eternal" value="false"/>
  106. <property name="maxElementsInMemory" value="1000"/>
  107. <property name="memoryEvictionPolicy" value="LRU"/>
  108. <property name="name" value="usersCache"/>
  109. <property name="timeToIdleSeconds" value="14400"/>
  110. <property name="timeToLiveSeconds" value="14400"/>
  111. </bean>
  112. <bean name="cache#url-failures-cache" class="org.apache.archiva.components.cache.ehcache.EhcacheCache" lazy-init="true"
  113. destroy-method="dispose">
  114. <property name="diskExpiryThreadIntervalSeconds" value="600"/>
  115. <property name="diskPersistent" value="true"/>
  116. <property name="diskStorePath" value="${appserver.base}/tmp/urlcache"/>
  117. <property name="maxElementsInMemory" value="1000"/>
  118. <property name="memoryEvictionPolicy" value="LRU"/>
  119. <property name="name" value="url-failures-cache"/>
  120. <property name="overflowToDisk" value="false"/>
  121. <!-- 45 minutes = 2700 seconds -->
  122. <property name="timeToIdleSeconds" value="2700"/>
  123. <!-- 30 minutes = 1800 seconds -->
  124. <property name="timeToLiveSeconds" value="1800"/>
  125. </bean>
  126. <bean name="cache#keys" class="org.apache.archiva.components.cache.ehcache.EhcacheCache"
  127. init-method="initialize">
  128. <property name="diskPersistent" value="false"/>
  129. <property name="eternal" value="false"/>
  130. <property name="maxElementsInMemory" value="1000"/>
  131. <property name="memoryEvictionPolicy" value="LRU"/>
  132. <property name="name" value="keys"/>
  133. <property name="timeToIdleSeconds" value="1800"/>
  134. <property name="timeToLiveSeconds" value="14400"/>
  135. </bean>
  136. <bean name="cache#operations" class="org.apache.archiva.components.cache.ehcache.EhcacheCache"
  137. init-method="initialize">
  138. <property name="diskPersistent" value="false"/>
  139. <property name="eternal" value="false"/>
  140. <property name="maxElementsInMemory" value="1000"/>
  141. <property name="memoryEvictionPolicy" value="LRU"/>
  142. <property name="name" value="operations"/>
  143. <property name="timeToIdleSeconds" value="1800"/>
  144. <property name="timeToLiveSeconds" value="14400"/>
  145. </bean>
  146. <bean name="cache#permissions" class="org.apache.archiva.components.cache.ehcache.EhcacheCache"
  147. init-method="initialize">
  148. <property name="diskPersistent" value="false"/>
  149. <property name="eternal" value="false"/>
  150. <property name="maxElementsInMemory" value="1000"/>
  151. <property name="memoryEvictionPolicy" value="LRU"/>
  152. <property name="name" value="permissions"/>
  153. <property name="timeToIdleSeconds" value="1800"/>
  154. <property name="timeToLiveSeconds" value="14400"/>
  155. </bean>
  156. <bean name="cache#resources" class="org.apache.archiva.components.cache.ehcache.EhcacheCache"
  157. init-method="initialize">
  158. <property name="diskPersistent" value="false"/>
  159. <property name="eternal" value="false"/>
  160. <property name="maxElementsInMemory" value="1000"/>
  161. <property name="memoryEvictionPolicy" value="LRU"/>
  162. <property name="name" value="resources"/>
  163. <property name="timeToIdleSeconds" value="1800"/>
  164. <property name="timeToLiveSeconds" value="14400"/>
  165. </bean>
  166. <bean name="cache#roles" class="org.apache.archiva.components.cache.ehcache.EhcacheCache"
  167. init-method="initialize">
  168. <property name="diskPersistent" value="false"/>
  169. <property name="eternal" value="false"/>
  170. <property name="maxElementsInMemory" value="1000"/>
  171. <property name="memoryEvictionPolicy" value="LRU"/>
  172. <property name="name" value="roles"/>
  173. <property name="timeToIdleSeconds" value="1800"/>
  174. <property name="timeToLiveSeconds" value="14400"/>
  175. </bean>
  176. <bean name="cache#effectiveRoleSet" class="org.apache.archiva.components.cache.ehcache.EhcacheCache"
  177. init-method="initialize">
  178. <property name="diskPersistent" value="false"/>
  179. <property name="eternal" value="false"/>
  180. <property name="maxElementsInMemory" value="1000"/>
  181. <property name="memoryEvictionPolicy" value="LRU"/>
  182. <property name="name" value="effectiveRoleSet"/>
  183. <property name="timeToIdleSeconds" value="1800"/>
  184. <property name="timeToLiveSeconds" value="14400"/>
  185. </bean>
  186. <!-- ================================================================
  187. Caches with Short Term entries
  188. ================================================================ -->
  189. <bean name="cache#userAssignments" class="org.apache.archiva.components.cache.ehcache.EhcacheCache"
  190. init-method="initialize">
  191. <property name="diskPersistent" value="false"/>
  192. <property name="eternal" value="false"/>
  193. <property name="maxElementsInMemory" value="1000"/>
  194. <property name="memoryEvictionPolicy" value="LRU"/>
  195. <property name="name" value="userAssignments"/>
  196. <property name="timeToIdleSeconds" value="300"/>
  197. <property name="timeToLiveSeconds" value="600"/>
  198. </bean>
  199. <bean name="cache#userPermissions" class="org.apache.archiva.components.cache.ehcache.EhcacheCache"
  200. init-method="initialize">
  201. <property name="diskPersistent" value="false"/>
  202. <property name="eternal" value="false"/>
  203. <property name="maxElementsInMemory" value="1000"/>
  204. <property name="memoryEvictionPolicy" value="LRU"/>
  205. <property name="name" value="userPermissions"/>
  206. <property name="timeToIdleSeconds" value="300"/>
  207. <property name="timeToLiveSeconds" value="600"/>
  208. </bean>
  209. <bean name="cache#ldapRoles" class="org.apache.archiva.components.cache.ehcache.EhcacheCache"
  210. init-method="initialize">
  211. <property name="diskPersistent" value="false"/>
  212. <property name="eternal" value="false"/>
  213. <property name="maxElementsInMemory" value="1000"/>
  214. <property name="memoryEvictionPolicy" value="LRU"/>
  215. <property name="name" value="ldapRoles"/>
  216. <property name="timeToIdleSeconds" value="300"/>
  217. <property name="timeToLiveSeconds" value="600"/>
  218. </bean>
  219. <bean name="cache#namespaces" class="org.apache.archiva.components.cache.ehcache.EhcacheCache"
  220. init-method="initialize">
  221. <property name="diskPersistent" value="false"/>
  222. <property name="eternal" value="false"/>
  223. <property name="maxElementsInMemory" value="1000"/>
  224. <property name="memoryEvictionPolicy" value="LRU"/>
  225. <property name="name" value="namespaces"/>
  226. <property name="timeToIdleSeconds" value="600"/>
  227. <property name="timeToLiveSeconds" value="600"/>
  228. </bean>
  229. <!-- override jcr repository location -->
  230. <!-- START SNIPPET: jcr-location -->
  231. <!--
  232. <bean id="jcr-config" class="org.apache.archiva.metadata.repository.jcr.ArchivaJcrRepositoryConfig" factory-method="create">
  233. <constructor-arg value="${appserver.base}/conf/repository.xml"/>
  234. <constructor-arg value="${appserver.base}/data/jcr"/>
  235. </bean>
  236. -->
  237. <!-- END SNIPPET: jcr-location -->
  238. <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  239. <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" />
  240. <property name="jpaPropertyMap">
  241. <map>
  242. <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
  243. <entry key="openjpa.jdbc.SchemaFactory" value="native(ForeignKeys=true)" />
  244. <entry key="openjpa.jdbc.MappingDefaults"
  245. value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
  246. <entry key="openjpa.Log" value="${openjpa.Log:DefaultLevel=INFO,Runtime=ERROR,Tool=ERROR,SQL=ERROR,Schema=ERROR,MetaData=ERROR}" />
  247. <entry key="openjpa.jdbc.DBDictionary" value="(disableSchemaFactoryColumnTypeErrors=true,BitTypeName=CHAR(1),BooleanTypeName=CHAR(1),BooleanRepresentation=STRING_YN)"/>
  248. </map>
  249. </property>
  250. </bean>
  251. <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
  252. <property name="entityManagerFactory" ref="entityManagerFactory" />
  253. </bean>
  254. <tx:annotation-driven />
  255. </beans>