- This topic has 3 replies, 2 voices, and was last updated 19 years ago by Riyad Kalla.
-
AuthorPosts
-
skressMemberHi,
is it possible to define a project specific classpath for tomcat? I have multiple projects with each of it having its own properties files located in the filesystem. The directory where the properties are located should be added to tomcat’s classpath, but when creating a war those files should not be included. (That’s why I cannot simply add the directory as an eclipse source-path I guess.)
Here’s my project layout:
/eclipse-workspace/project1/src/… -> source directory
/eclipse-workspace/project1/properties/… -> location of properties files, this directory should be added to tomcat’s classpath/eclipse-workspace/project2/src/… -> source directory
/eclipse-workspace/project2/properties/… -> location of properties files, this directory should be added to tomcat’s classpathAs there may be conflicting files in the properties directories I cannot simply add all directories to tomcat’s classpath.
Back to my initial question: is there a way to add something like this to tomcat’s classpath: $PROJECT_ROOT/properties -> which would then be resolved for the specific project.
Best regards
Soeren
Riyad KallaMemberTo answer your initial question, no there isn’t a way to manipulate the Paths’ settings to do this, but:
The directory where the properties are located should be added to tomcat’s classpath, but when creating a war those files should not be included.
I don’t understand this, if each project has a set of Properties files that it needs at run time, why would these not be included in the deployed WAR file? Why would these files need to be outside the scope of the project?
skressMemberThe properties files should not be deployed within the WAR because we have different environments for development, integration testing and production. Those environments only differ in the properties files. Thus we will (if at all possible) create one WAR and deploy it to the different staging areas. And as we have different branches within the development environment we would like to be able to switch between the Eclipse workspaces and also switch the classpath for the tomcat installation.
I think the easiest way to accomplish this would be to include the properties files within the source path, deploy it during development with MyEclipse and then use an Ant task which omits the properties files for integration testing and production. (So we won’t use MyEcplise’s feature of deploying into a custom location which was quite comfortable for us 😉
Best regards
Soeren
Riyad KallaMemberSoeren,
I am glad you found a middle ground that accomodated your teams needs, it sounds like the best option right now. -
AuthorPosts