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.

spring-context.xml 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?xml version="1.0"?>
  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:jaxrs="http://cxf.apache.org/jaxrs"
  24. xsi:schemaLocation="http://www.springframework.org/schema/beans
  25. http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  26. http://www.springframework.org/schema/context
  27. http://www.springframework.org/schema/context/spring-context-3.0.xsd
  28. http://cxf.apache.org/jaxrs
  29. http://cxf.apache.org/schemas/jaxrs.xsd" default-lazy-init="true">
  30. <import resource="classpath:META-INF/cxf/cxf.xml"/>
  31. <!--
  32. <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"/>
  33. -->
  34. <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
  35. <context:annotation-config/>
  36. <context:component-scan
  37. base-package="org.apache.archiva.rest.services,org.apache.archiva.redback.rest.services"/>
  38. <!-- CXF OpenApiFeature -->
  39. <bean id="archivaOpenApiFeature" class="org.apache.cxf.jaxrs.openapi.OpenApiFeature">
  40. <property name="scanKnownConfigLocations" value="false"/>
  41. <property name="configLocation" value="archiva/openapi-configuration.yaml"/>
  42. <property name="scan" value="false"/>
  43. <property name="useContextBasedConfig" value="true"/>
  44. <!-- <property name="scannerClass" value="io.swagger.v3.jaxrs2.integration.JaxrsApplicationScanner"/> -->
  45. </bean>
  46. <bean id="jsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider">
  47. <property name="mapper" ref="redbackJacksonJsonMapper"/>
  48. </bean>
  49. <bean id="v2.jsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider">
  50. <property name="mapper" ref="v2.redbackJacksonJsonMapper"/>
  51. </bean>
  52. <bean id="xmlProvider" class="com.fasterxml.jackson.jaxrs.xml.JacksonJaxbXMLProvider">
  53. <property name="mapper" ref="redbackJacksonXMLMapper"/>
  54. </bean>
  55. <bean id="redbackJacksonJsonMapper" class="com.fasterxml.jackson.databind.ObjectMapper" />
  56. <bean id="v2.redbackJacksonJsonMapper" class="com.fasterxml.jackson.databind.ObjectMapper" >
  57. </bean>
  58. <bean id="redbackJacksonXMLMapper" class="com.fasterxml.jackson.dataformat.xml.XmlMapper" />
  59. <jaxrs:server name="archivaServices" address="/archivaServices" >
  60. <jaxrs:providers>
  61. <ref bean="jsonProvider" />
  62. <ref bean="xmlProvider" />
  63. <ref bean="authenticationInterceptor#rest"/>
  64. <ref bean="permissionInterceptor#rest"/>
  65. <ref bean="requestValidationInterceptor#rest" />
  66. <ref bean="archivaRestServiceExceptionMapper"/>
  67. <ref bean="threadLocalUserCleaner#rest" />
  68. </jaxrs:providers>
  69. <jaxrs:serviceBeans>
  70. <ref bean="browseService#rest"/>
  71. <ref bean="pingService#rest"/>
  72. <ref bean="repositoriesService#rest"/>
  73. <ref bean="managedRepositoriesService#rest"/>
  74. <ref bean="remoteRepositoriesService#rest"/>
  75. <ref bean="repositoryGroupService#rest"/>
  76. <ref bean="proxyConnectorService#rest"/>
  77. <ref bean="networkProxyService#rest"/>
  78. <ref bean="archivaAdministrationService#default"/>
  79. <ref bean="searchService#rest"/>
  80. <ref bean="commonServices#rest"/>
  81. <ref bean="pluginsService#rest"/>
  82. <ref bean="systemStatusService#rest"/>
  83. <ref bean="reportRepositoriesService#rest" />
  84. <ref bean="mergeRepositoriesService#rest"/>
  85. <ref bean="proxyConnectorRuleService#rest"/>
  86. <ref bean="archivaRuntimeConfigurationService#rest"/>
  87. <ref bean="redbackRuntimeConfigurationService#rest"/>
  88. </jaxrs:serviceBeans>
  89. </jaxrs:server>
  90. <jaxrs:server name="v2.archiva" address="/v2/archiva" >
  91. <jaxrs:providers>
  92. <ref bean="v2.jsonProvider" />
  93. <ref bean="bearerAuthInterceptor#rest"/>
  94. <ref bean="permissionInterceptor#rest"/>
  95. <ref bean="requestValidationInterceptor#rest" />
  96. <ref bean="v2.archivaRestServiceExceptionMapper"/>
  97. <ref bean="threadLocalUserCleaner#rest" />
  98. </jaxrs:providers>
  99. <jaxrs:serviceBeans>
  100. <ref bean="v2.defaultSecurityConfigurationService" />
  101. </jaxrs:serviceBeans>
  102. <jaxrs:features>
  103. <ref bean="archivaOpenApiFeature" />
  104. </jaxrs:features>
  105. </jaxrs:server>
  106. <bean name="browse#versionMetadata" class="org.apache.archiva.components.cache.ehcache.EhcacheCache"
  107. init-method="initialize">
  108. <property name="diskPersistent" value="false"/>
  109. <property name="eternal" value="false"/>
  110. <property name="maxElementsInMemory" value="1000"/>
  111. <property name="memoryEvictionPolicy" value="LRU"/>
  112. <property name="name" value="userPermissions"/>
  113. <property name="timeToIdleSeconds" value="300"/>
  114. <property name="timeToLiveSeconds" value="600"/>
  115. </bean>
  116. </beans>