Hi,
To run james in my ide (eclipse), I copied config files from
server/spring-deployment/src/main/config/james to a directory called
conf a level upon the root of my project.
The resource loading via the file://conf was ok.
After, I wanted to load via classpath to have smoother intergration in
my ide and also thinking to later integration with 3rd parties (simply
using james jars with embedded resources).
I changed all needed file://conf/ to classpath: in the xml files
(spring-beans,...).
I also had to change in SpringConfigurationRegistry.getForComponent line
56 from
Resource r = loader.getResource("file://conf/" + name +
".xml");
to
Resource r = loader.getResource("classpath:" + name + ".xml");
I looked for a system-wide configuration (in James.xml or whatever) that
would allow to define the way resources are loaded (file or classpath)
but didn't find anything.
One way to tackle this would be first try on file://conf and rather than
throwing directly the RegistryException, still give a try to classpath.
In case of duplicate config present (file + classpath), the file would
take the precedence, discarding the classpath.
You could have a default classpath config, and simply override some via
file.
On pom.xml, we could also add the following (direct ide setup after mvn
eclipse:eclipse).
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
....
In a first instance, for mvn package, everything could remain as such
(all files copied to conf).
Any comment?
Tks,
Eric