velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From laredotornado <laredotorn...@gmail.com>
Subject Trouble finding velocity.properties in a jar
Date Thu, 21 Jul 2011 16:37:30 GMT

Hi,

I'm using Java 1.6, Velocity 1.6.2.  I have a Maven JAR project, in which
the "velocity.properties" gets packaged at the root of the JAR.  When I
include this JAR in other projects, I'm not able to initialize velocity,
using ...

		VelocityEngine ve = new VelocityEngine();
		final InputStream resourceStream =
Thread.currentThread().getContextClassLoader().getResourceAsStream("velocity.properties");
		final Properties velocityProps = new Properties();
		velocityProps.load(resourceStream);
		ve.init( velocityProps );

The above dies because the "resourceStream" is null.  Any ideas how I
reference this file?  Keep in mind that it is packaged within the JAR. 
Thanks, - Dave
-- 
View this message in context: http://old.nabble.com/Trouble-finding-velocity.properties-in-a-jar-tp32108932p32108932.html
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message