facebook

[Closed] Configure a project specific classpath for tomcat?

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #242066 Reply

    skress
    Member

    Hi,

    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 classpath

    As 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

    #242168 Reply

    Riyad Kalla
    Member

    To 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?

    #242202 Reply

    skress
    Member

    The 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

    #242235 Reply

    Riyad Kalla
    Member

    Soeren,
    I am glad you found a middle ground that accomodated your teams needs, it sounds like the best option right now.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: [Closed] Configure a project specific classpath for tomcat?

You must be logged in to post in the forum log in