]> source.dussan.org Git - archiva.git/commitdiff
[MRM-857] set a user agent for proxy HTTP requests
authorBrett Porter <brett@apache.org>
Wed, 2 Jul 2008 13:04:01 +0000 (13:04 +0000)
committerBrett Porter <brett@apache.org>
Wed, 2 Jul 2008 13:04:01 +0000 (13:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@673383 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/pom.xml
archiva-modules/archiva-web/archiva-webapp/src/main/filtered-resources/application.properties [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml

index 60ecdd63b802fc0fa77a9d7256ca580e0ffecc4e..a3a575535848a3ab09bff38ca55ee251b6f5ede7 100644 (file)
     </dependency>
   </dependencies>
   <build>
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+      </resource>
+      <resource>
+        <directory>src/main/filtered-resources</directory>
+        <filtering>true</filtering>
+      </resource>
+    </resources>
     <plugins>
       <!--
       <plugin>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/filtered-resources/application.properties b/archiva-modules/archiva-web/archiva-webapp/src/main/filtered-resources/application.properties
new file mode 100644 (file)
index 0000000..ba43607
--- /dev/null
@@ -0,0 +1 @@
+user.agent=Apache Archiva/${project.version}
index f6b0fa81d33867469acbf81237bd3a5cbcb28926..93bd4a30ba4ba1b17bb94e6e20b9f8b76bd859da 100644 (file)
     <constructor-arg ref="cache#url-failures-cache" type="org.codehaus.plexus.cache.Cache"/>
   </bean>
 
+  <bean name="wagon#http" class="org.apache.maven.wagon.providers.http.LightweightHttpWagon" scope="prototype">
+    <property name="httpHeaders">
+      <map>
+        <entry key="User-Agent" value="${user.agent}" />
+      </map>
+    </property>
+  </bean>
+
+  <bean name="wagon#https" class="org.apache.maven.wagon.providers.http.LightweightHttpsWagon" scope="prototype">
+    <property name="httpHeaders">
+      <map>
+        <entry key="User-Agent" value="${user.agent}" />
+      </map>
+    </property>
+  </bean>
+
+  <bean id="propertyPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+    <property name="location" value="classpath:application.properties" />
+  </bean>
 </beans>