facebook

how to parameterize app server paths per project?

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

    boyski
    Member

    Our web app project is in source control. The basic functionality development is done on the main branch while on a parallel branch work is being done to add persistence capabilities. Therefore, on my Windows machine I have two versions of the source code: one at (say) C:\base\path\myproject and the other at C:\base\path\myproject-DB. These are implemented as two different projects within MyEclipse (6.0 full stack). My problem has to do with running the app server (Tomcat 6 in this case) against either of these. The Tomcat launcher configuration under Windows->Preferences->MyEclipse->Application Servers->Tomcat->Tomcat 6.x->Paths has a number of paths to jars (and the generated class files) which look like C:\base\path\myproject\WEB-INF\…. In other words this is hard coded to refer to “myproject”. What I want, of course, is for Tomcat to run against whatever project is active. I.e. the way I see it if I could refer to a jar as ${project.basedir}\WEB-INF\lib\foo.jar then eveything would work fine. Can this be done? Or is there an alternate recommended way of running the same app server against multiple project configurations?

    Again, with my current configuration developing in “myproject” is fine. But when “myproject-DB” is active and I start Tomcat it silently runs the class files and jars from the other project.

    Thanks,
    DB

    #276687

    Loyal Water
    Member

    I guess you are looking for a way to have multiple configurations of Tomcat. You can go to Windows > Preferences > MyEclipse > Application Server > Tomcat 6.x > Launch > Create Launch Config and create a new Launch Config. You can run your project against this newly created configuration by right clicking on the project, selecting run and then selecting your configuration.

    #276727

    boyski
    Member

    Thanks, I will look into Launch Configurations but I don’t like the way I think it’s going to look. It sounds like for every build configuration (every different branch of development, basically) we would need to maintain a separate Tomcat launch config and manually choose that one. It might work OK for 2 branches but not so much for 15 or 30. And this seems unnecessary given that all that’s really needed here is a way to parameterize the base directory where the source repository sits. Are you sure there’s no way to do that? Also, what if I want to move the entire project from one location on the hard drive to another. Do I have to find every hard-wired pathname the wizards have stuck in there on my behalf and change them? Wouldn’t it be better if they were all relative to a project property?

    In other words I don’t really need “multiple configurations of Tomcat”. I want the same configuration to be able to run against multiple branches of my code. Same JVM, same classpaths, etc. Just pointing at different class files of my app.

    #276763

    Riyad Kalla
    Member

    The Tomcat launcher configuration under Windows->Preferences->MyEclipse->Application Servers->Tomcat->Tomcat 6.x->Paths has a number of paths to jars (and the generated class files) which look like C:\base\path\myproject\WEB-INF\…. In other words this is hard coded to refer to “myproject”.

    Normally these Paths fields should be totally empty. They are only for auxiliary classes and JARs that *Tomcat* needs on startup (like a JDBC driver or native DLL). When MyEclipse deploys your project to Tomcat, it will package all the libs up for you and put them under WEB-INF/lib, and Tomcat knows to load them. You do not need/want to list them under the connector settings.

    Again, with my current configuration developing in “myproject” is fine. But when “myproject-DB” is active and I start Tomcat it silently runs the class files and jars from the other project.

    All you need to worry about is making sure both projects have different web root contexts (e.g. /weproject and /webproject-db) so they deploy to different paths under Tomcat.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: how to parameterize app server paths per project?

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