facebook

Dependant projects when deploying a web project [Closed]

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #198121 Reply

    I saw in another thread that MyEclipse does not support deployment of dependant projects (and the libraries in them) when you deploy a web project to Tomcat. Currently I have to build the dependant projects and then copy them to the WEB-INF/lib (or classes) dir before I deploy.

    The Sysdeo tomcat plugin had an option where you could choose to add dependant projects to Tomcats classpath and this worked ok. In theory I should be able to achieve the same thing by adding the output directories of my dependant projects to the Tomcat classpath using Window->Preferences->MyEclipse->Application Servers->Tomcat 4->Paths settings. I tried doing this but Tomcat didn’t seem to find the extra stuff on start up (for example my servlets did not initialise etc) and the application doesn’t work.

    Is there a way to achieve this?

    Chris Tuck
    Expert Information Services

    #198124 Reply

    support-michael
    Keymaster

    I believe the Sysdeo plugin requires a Tomcat modification inorder for its classloader to find classfiles scattered between your main project and dependent projects. (don’t quote me on this)

    A short term MyEclipse solution that you might wish to consider is to redirect the output of your dependent project to the WEB-INF/classes folder of your web project. Doing this effectively merges the dependent project’s classes directly with the web project’s classes that are deployed in either exploded or std. packaged deployment. WARNING – this approach requires you to be aware of how Eclipse manages project output areas. By default a build-all action will delete a project’s entire output area unless you disable this preference (see preferences at windows->java->compiler->buildpath). So if you do not disable “Scrub output folders on full rebuild”, a rebuild/build-all action on your web project will cause the dependent project’s output classfiles to be deleted from the web project including those contributed by the dependent project. When this happens you will need to rebuild your dependent project before deploying the web project.

    I hope this helps.

    Michael
    MyEclipse Support

    #198133 Reply

    @support wrote:

    A short term MyEclipse solution that you might wish to consider is to redirect the output of your dependent project to the WEB-INF/classes folder of your web project. Doing this effectively merges the dependent project’s classes directly with the web project’s classes that are deployed in either exploded or std. packaged deployment.

    Hi Michael,

    the problem with doing this is that Eclipse doesn’t seem to allow me to enter a Default output folder that doesn’t sit below the project root. This is the setting in Project Properties->Java Build Path->Default output folder. The same problem seems to also exist with setting an output directory for each src folder. So I can’t have the output from one project go to the WEB-INF/classes directory of my web project. Is there another way to set the output folder to a folder inside another project?

    thanks,

    Chris Tuck
    Expert Information Services

    #198135 Reply

    support-michael
    Keymaster

    Is there another way to set the output folder to a folder inside another project?

    In the example I created for this case I used a link from the output location of my dependent project to the output location of my web project (i.e., <web root>/WEB-INF/classes).

    To do this,

    1) from the Properties->Build Path->Source tab, select the Browse button on the Default Output Folder field. This opens the Folder Selection Dialog.

    2) Select the top-level folder (your project folder) and then the New Folder button. This opens a New Folder dialog

    3) Enter the name of the link, e.g., classes_link

    4) Then select the Link button and navigate to the WEB-INF/classes directory of you web project and select it.

    Note that links can only be created at the project level.

    Good luck,

    Michael
    MyEclipse Support

    #198136 Reply

    Thanks Michael, this worked like a treat. Wasn’t aware of the link ability in eclipse.

    regards,

    Chris Tuck
    Expert Information Services

    #198137 Reply

    support-michael
    Keymaster

    Glad we can be of assistance. We are working on dependent projects for an upcoming release which will eliminate this kind of workaround.

    Happy MyEclipse’ing

    Michael
    MyEclipse Support

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Dependant projects when deploying a web project [Closed]

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