I have a java class which reads some properties from a property file(which contains database server urls username and passwords).I want to jar the class file and give it to the some other project so that they can just change the properties file if needed and use the jar file in their project . When i make the jar file ,i see that the property file is inside the jar file and is not user freindly to modify. I would appricate if someone could help me to know , "How can we make a jar file so that its properties file are exteranal to jar".
They can put you properties file in their own classpath. You have something like this. /lib/Class1.class /lib/Class2.class /lib/Class3.class /lib/config.properties
Your clients have something like this. /new/ClassA.class /new/ClassB.class
Then you jar all your .class files in lib.jar. (without the config.properties)
So your clients want to use your libraries. They can do something like this. Import/add to classpath your lib.jar Add a config.properties to their project so it looks like this: /new/ClassA.class /new/ClassB.class /lib/config.properties
They can now jar their project including .class and .properties into new.jar and deploy both lib.jar and new.jar.
I hope it helps [ September 25, 2007: Message edited by: Jaime Tovar ]
She will remember your heart when men are fairy tales in books written by rabbits.<br /> As long as there is duct tape... there is also hope.
Joined: Apr 04, 2006
Thanks Jaime Tovar for the reply. I have worked out that in a similar way.
subject: Jar a project with property files in it external to jar