Hi Jeff,
first of all, i would like to ask you to continue this debate on Maven
Users List <[email protected]>, since this mailing list is hosted
on "site" (my machine) with very lousy (adsl) uplink and is not meant to
be public :) It is my mistake that on Proximity site I listed this
mailing list.
Well, your question regards mere the J2EE webapp then Proximity itself.
It is possible what you asking, but this way you will VIOLATE the J2EE
guidelines. Nevertheless, as long as you use some "relaxed" container
(eg. Tomcat and not JBoss) everything should be fine (i think, never
tested it actually).
Since in web.xml you cannot reference file outside the webapp root, you
should create a Spring "stub" application context, which will in turn
include the "real" application context. Since this configuration is done
by Spring, not the servlet container it would be possible to achieve it.
I modelled this by placing files in my $HOME/tmp. Files attached.
Steps to achieve this:
1. Move /WEB-INF/applicationContext.xml to where you want and rename it
to proximity.xml (in my case $HOME/tmp)
2. Move /WEB-INF/proximity.properties to be beside proximity.xml (in my
case $HOME/tmp)
3. Set up both files as you want, use SCM on it etc.
4. I attached a Spring "stub" context, drop it in
/WEB-INF/applicationContext.xml REPLACING the original one.
5. Configure the stub to point where your proximity.xml is.
And that's it!
The bad thing about this config is that in case of path modification you
have TWO places to update: one in /WEB-INF/applicationContext.xml "stub"
and one in proximity.xml. But since you have "taken-out" the config from
webapp, you could simply drop the proximity properties file, replace and
maintain the proximity.xml file only by inserting values directly and
remove the "propertyConfigurer" bean from proximity.xml. The properties
file in this case is not a benefit.
Have fun
cstamas
Jeff Jensen wrote:
> Hi,
>
> Since we source control product config files, it is much easier for us when
> we can configure products to point to their config files in our desired
> location (i.e. into a dir in the SCM's workspace).
>
> So far with Proximity, we have changed settings in proximity.properties and
> applicationContext.xml.
>
> Not sure of all settings yet - is it possible to customize Proximity to load
> those files from a specified location instead of always from web-inf?
>
> _______________________________________________
> ismicro-commons mailing list
> [EMAIL PROTECTED]
> http://mail.is-micro.hu/mailman/listinfo/ismicro-commons
>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<!--
Default Proximity webapp configuration with provided all possible settings (most of
them have default values!).
Have fun,
[EMAIL PROTECTED]
-->
<beans>
<!--
=================================================================================
Infrastructure, Spring convenience stuff, not Proximity beans.
-->
<!--
- Message source
-->
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<list>
<value>messages</value>
</list>
</property>
</bean>
<import resource="file:/home/cstamas/tmp/proximity.xml"/>
</beans>
# proximity.properties
# The directory of the index files used by LuceneIndexer
indexer.dir=${user.home}/proximity/indexer
# The directory of repositories local storage.
# IMPORTANT! If local storage is metadata-aware (the default), then
# from the given directory Proximity will create two sub-dirs, one for
# metadata and one for actual files.
inhouseFSStorage.baseDir=${user.home}/proximity/inhouse
extFreeFSStorage.baseDir=${user.home}/proximity/ext-free
extNonFreeFSStorage.baseDir=${user.home}/proximity/ext-non-free
centralFSStorage.baseDir=${user.home}/proximity/central
ibiblioFSStorage.baseDir=${user.home}/proximity/ibiblio
codehausFSStorage.baseDir=${user.home}/proximity/codehaus
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<!--
Default Proximity webapp configuration with provided all possible settings (most of
them have default values!).
Have fun,
[EMAIL PROTECTED]
-->
<beans>
<!--
- Property configurer, see proximity.properties
-->
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_FALLBACK" />
<property name="locations">
<list>
<value>file:/home/cstamas/tmp/proximity.properties</value>
</list>
</property>
</bean>
<!--
=================================================================================
Proximity
-->
<!--
- Central proximity bean with list of repos and it's helpers.
-->
<bean id="proximity"
class="hu.ismicro.commons.proximity.base.ProximityImpl"
init-method="initialize">
<property name="indexer" ref="indexer" />
<property name="statisticsGatherer" ref="stats" />
<property name="accessManager" ref="openAccessManager" />
<property name="repositories">
<list>
<!-- Repos'es will be processed in THIS ORDER! -->
<ref local="inhouse" />
<ref local="extFree" />
<ref local="extNonFree" />
<!-- Uncomment the needed repositories! -->
<!-- for Maven2 -->
<ref local="central" />
<!-- for Maven1 -->
<!--
<ref local="ibiblio"/>
<ref local="codehaus"/>
-->
</list>
</property>
</bean>
<!--
- Indexer, used to speed up searches.
-->
<bean id="indexer"
class="hu.ismicro.commons.proximity.base.indexer.LuceneIndexer">
<!-- Where to store indexes? -->
<property name="indexDirectory" value="${indexer.dir}" />
<!-- On webapp start should i recreate Lucene indexes? -->
<property name="recreateIndexes" value="true" />
<!-- After how much of item insertion should i optimize indexes? -->
<property name="dirtyItemTreshold" value="100" />
</bean>
<!--
- StatisticsGatherer, gathers statistics. Simple in-memory implementation.
-->
<bean id="stats"
class="hu.ismicro.commons.proximity.base.SimpleStatisticsGathererImpl" />
<!--
- AccessManager. With OpenAccessManager Proximity is wide open.
-->
<bean id="openAccessManager"
class="hu.ismicro.commons.proximity.access.OpenAccessManager" />
<!--
=================================================================================
-->
<!--
- Logic used for Maven2 repositories.
-->
<bean id="maven2logic"
class="hu.ismicro.commons.proximity.base.logic.MavenProxyLogic">
<!-- SNAPSHOTSs expires after 24h -->
<property name="snapshotExpirationPeriodInSeconds"
value="86400" />
<!-- Maven2 POMs expires after 24h -->
<property name="pomExpirationPeriodInSeconds" value="86400" />
<!-- Maven2 metadatas expires after 24h -->
<property name="metadataExpirationPeriodInSeconds"
value="86400" />
<!-- everything else will never expire once downloaded -->
<property name="itemExpirationPeriodInSeconds" value="-1" />
</bean>
<!--
- MAVEN2 repository!
- repo1.maven.org Central Repository (with writable cache storage and remote peer)
- A standard maven2 repository.
-->
<bean id="central"
class="hu.ismicro.commons.proximity.base.RepositoryImpl">
<property name="id" value="central" />
<property name="localStorage" ref="centralFSStorage" />
<property name="remoteStorage" ref="centralRemotePeer" />
<property name="indexer" ref="indexer" />
<property name="statisticsGatherer" ref="stats" />
<property name="accessManager" ref="openAccessManager" />
<property name="repositoryLogic" ref="maven2logic" />
<!-- Should i reindex my content on startup? -->
<property name="reindex" value="true" />
<!-- Should i recreate metadata on startup? -->
<property name="recreateMetadata" value="true" />
<!-- Am I listable? -->
<property name="listable" value="true" />
</bean>
<bean id="centralFSStorage"
class="hu.ismicro.commons.proximity.base.local.WritableFileSystemStorage">
<property name="baseDir" value="${centralFSStorage.baseDir}" />
<property name="metadataAware" value="true" />
<property name="metadataPrefix" value="metadata" />
<property name="storagePrefix" value="storage" />
</bean>
<bean id="centralRemotePeer"
class="hu.ismicro.commons.proximity.base.remote.HttpClientRemotePeer">
<property name="remoteUrl"
value="http://repo1.maven.org/maven2/" />
<property name="connectionTimeout" value="10000" />
<property name="followRedirection" value="true" />
<!-- Fix query string appended to URL, used for ProximityPiping "repositoryId=central" -->
<property name="queryString" value="" />
<!-- Proxy setup, uncomment if needed
<property name="proxyHost" value="myproxyhost.company.com" />
<property name="proxyPort" value="8080" />
-->
<!-- Proxy authentication setup, uncomment if proxy needs this
<property name="proxyRealm" value="ProxyRealm" />
<property name="proxyUsername" value="userOnProxy" />
<property name="proxyPassword" value="bigSecret" />
-->
</bean>
<!--
- MAVEN1
- IBIBLIO Repository (with writable cache storage and remote peer)
- A standard maven1 repository.
-->
<bean id="ibiblio"
class="hu.ismicro.commons.proximity.base.RepositoryImpl">
<property name="id" value="ibiblio" />
<property name="localStorage" ref="ibiblioFSStorage" />
<property name="remoteStorage" ref="ibiblioRemotePeer" />
<property name="indexer" ref="indexer" />
<property name="reindex" value="true" />
<property name="recreateMetadata" value="true" />
<property name="statisticsGatherer" ref="stats" />
<property name="listable" value="true" />
<property name="accessManager" ref="openAccessManager" />
<property name="repositoryLogic" ref="maven2logic" />
</bean>
<bean id="ibiblioFSStorage"
class="hu.ismicro.commons.proximity.base.local.WritableFileSystemStorage">
<property name="baseDir" value="${ibiblioFSStorage.baseDir}" />
<property name="metadataAware" value="true" />
<property name="metadataPrefix" value="metadata" />
<property name="storagePrefix" value="storage" />
</bean>
<bean id="ibiblioRemotePeer"
class="hu.ismicro.commons.proximity.base.remote.HttpClientRemotePeer">
<property name="remoteUrl"
value="http://www.ibiblio.org/maven2/" />
<property name="connectionTimeout" value="10000" />
<property name="queryString" value="" />
<property name="followRedirection" value="true" />
<!-- Proxy setup, uncomment if needed
<property name="proxyHost" value="myproxyhost.company.com" />
<property name="proxyPort" value="8080" />
-->
<!-- Proxy authentication setup, uncomment if proxy needs this
<property name="proxyRealm" value="ProxyRealm" />
<property name="proxyUsername" value="userOnProxy" />
<property name="proxyPassword" value="bigSecret" />
-->
</bean>
<!--
- MAVEN1!
- Codehaus Repository (with writable storage and remote peer)
- A standard maven1 repository.
-->
<bean id="codehaus"
class="hu.ismicro.commons.proximity.base.RepositoryImpl">
<property name="id" value="codehaus" />
<property name="localStorage" ref="codehausFSStorage" />
<property name="remoteStorage" ref="codehausRemotePeer" />
<property name="indexer" ref="indexer" />
<property name="reindex" value="true" />
<property name="recreateMetadata" value="true" />
<property name="statisticsGatherer" ref="stats" />
<property name="listable" value="true" />
<property name="accessManager" ref="openAccessManager" />
<property name="repositoryLogic" ref="maven2logic" />
</bean>
<bean id="codehausFSStorage"
class="hu.ismicro.commons.proximity.base.local.WritableFileSystemStorage">
<property name="baseDir" value="${codehausFSStorage.baseDir}" />
<property name="metadataAware" value="true" />
<property name="metadataPrefix" value="metadata" />
<property name="storagePrefix" value="storage" />
</bean>
<bean id="codehausRemotePeer"
class="hu.ismicro.commons.proximity.base.remote.HttpClientRemotePeer">
<property name="remoteUrl" value="http://dist.codehaus.org/" />
<property name="connectionTimeout" value="10000" />
<property name="queryString" value="" />
<property name="followRedirection" value="true" />
<!-- Proxy setup, uncomment if needed
<property name="proxyHost" value="myproxyhost.company.com" />
<property name="proxyPort" value="8080" />
-->
<!-- Proxy authentication setup, uncomment if proxy needs this
<property name="proxyRealm" value="ProxyRealm" />
<property name="proxyUsername" value="userOnProxy" />
<property name="proxyPassword" value="bigSecret" />
-->
</bean>
<!--
- In-House Repository (with read-only storage and without remote peer)
- A maven repository for publishing in-house artifacts.
-->
<bean id="inhouse"
class="hu.ismicro.commons.proximity.base.RepositoryImpl">
<property name="id" value="inhouse" />
<property name="localStorage" ref="inhouseFSStorage" />
<property name="indexer" ref="indexer" />
<property name="reindex" value="true" />
<property name="recreateMetadata" value="true" />
<property name="listable" value="true" />
<property name="statisticsGatherer" ref="stats" />
<property name="accessManager" ref="openAccessManager" />
</bean>
<bean id="inhouseFSStorage"
class="hu.ismicro.commons.proximity.base.local.ReadOnlyFileSystemStorage">
<property name="baseDir" value="${inhouseFSStorage.baseDir}" />
<property name="metadataAware" value="false" />
</bean>
<!--
- EXT NonFree Repository (with read-only storage and without remote peer)
- A maven repository for in-house use for publishing non-free artifacts
- not deployed on standard maven repositories (oracle JDBC, J2EE, etc...).
-->
<bean id="extNonFree"
class="hu.ismicro.commons.proximity.base.RepositoryImpl">
<property name="id" value="extNonFree" />
<property name="localStorage" ref="extNonFreeFSStorage" />
<property name="indexer" ref="indexer" />
<property name="reindex" value="true" />
<property name="recreateMetadata" value="true" />
<property name="listable" value="true" />
<property name="statisticsGatherer" ref="stats" />
<property name="accessManager" ref="openAccessManager" />
</bean>
<bean id="extNonFreeFSStorage"
class="hu.ismicro.commons.proximity.base.local.ReadOnlyFileSystemStorage">
<property name="baseDir" value="${extNonFreeFSStorage.baseDir}" />
<property name="metadataAware" value="false" />
</bean>
<!--
- EXT Free Repository (with read-only storage and without remote peer)
- A maven repository for in-house use for publishing artifacts
- not deployed on standard maven repositories (dwr, etc...).
-->
<bean id="extFree"
class="hu.ismicro.commons.proximity.base.RepositoryImpl">
<property name="id" value="extFree" />
<property name="localStorage" ref="extFreeFSStorage" />
<property name="indexer" ref="indexer" />
<property name="reindex" value="true" />
<property name="recreateMetadata" value="true" />
<property name="listable" value="true" />
<property name="statisticsGatherer" ref="stats" />
<property name="accessManager" ref="openAccessManager" />
</bean>
<bean id="extFreeFSStorage"
class="hu.ismicro.commons.proximity.base.local.ReadOnlyFileSystemStorage">
<property name="baseDir" value="${extFreeFSStorage.baseDir}" />
<property name="metadataAware" value="false" />
</bean>
</beans>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]