facebook

How to merge WebRoot files from diff projects for deploy?

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

    svalin
    Member

    I need to find out if there is a way to merge WebRoot contents from multiple projects during deployment in my development environment (while testing and debugging web apps deployed to Tomcat from Eclipse with MyEclipse).

    Background Info:
    I have numerous web apps (JSP, Servlet, etc.) (No EJBs, etc) which need to be maintained as independent projects in both Eclipse and CVS.

    The problem is that all of these web apps need to have a common look & feel, so I want to share images, CSS, etc. files among the different projects. However, I do not want to have to maintain a multiple copies of the same CSS, etc. in each project.

    I am supposing that the best way to handle this is to create a standalone web project for all of the shared CSS, image, etc. files.

    That leads to my question as to how I can pull WebRoot content (CSS, images, etc) from one project and merge it with the WebRoot content of another project when I am deploying that other project from MyEclipse to Tomcat.

    Any assistance would be appreciated.

    Steve

    #230178 Reply

    Riyad Kalla
    Member

    I need to find out if there is a way to merge WebRoot contents from multiple projects during deployment in my development environment (while testing and debugging web apps deployed to Tomcat from Eclipse with MyEclipse).

    No there isn’t, there is no predetermined way to do this and we have not developed overlap rules for this to be supported (for example which web.xml file do you use?)

    The problem is that all of these web apps need to have a common look & feel, so I want to share images, CSS, etc. files among the different projects. However, I do not want to have to maintain a multiple copies of the same CSS, etc. in each project.

    Ahh I understand, this can be tricky to do well regardless of the IDE. I have not done this, but I wonder if you could make an Enterprise project that contains your custom projects (JSP/Servlet/etc.) and then the Resource project as modules, and on deployment it would work?

    #230203 Reply

    svalin
    Member

    Riyad,

    Thanks for your reply and your suggestion. I will check it out.

    Another indirect solution (which I will probably use if Riyad’s idea doesn’t work) is to create a separate “Simple Project” that contains one folder, perhaps called “globalCommon”. This globalCommon folder will contain all of the common CSS, image, banner.html, etc. files. Since this is a separate project it can be maintained separately in Eclipse and in CVS.

    To include these common files in each of your web projects (the ones that need the common look & feel) you would simply import the globalCommon directory (via the file system) into the WebRoot of each web project.

    The caveats here are that you must add the imported globalCommon to your .cvsignore file so that it isn’t stored in multiple CVS projects. Also, when you make changes to the common files in the original “Simple Project”, you will have to manually re-import the globalCommon directory into each web project.

    Admittedly, it’s a kludge and Riyad’s solution (if it works) sounds a little more graceful, but it will get the job done.

    I will try to remember to post the results I get when I try Riyad’s idea.

    Steve

    #230214 Reply

    svalin
    Member

    The quick answer is that it does not appear that Riyad’s solution will work in my particular case.

    The first reason is that it means all of the individual web apps would have to be bundled and deployed together as one app. I prefer to avoid this because each app is independently maintained and it is easier if it is kept that way during development.

    Second, since the globalCommon stuff would be in a separate .WAR file, all of the common files would have to be referenced via a URL. In my case that would be undesireable because I don’t want to incur the extra overhead of an additional web request for images, particularly because my Tomcat server is sitting behind an IIS server (which, for now, is a necessary evil…. YUCK!)

    Third, Tomcat simply doesn’t understand enterprise apps or .EAR files and apparently this is something that is programmed into the App Server preference files (behind the scenes) by MyEclipse, because MyEclipse won’t allow the encompassing enterprise app to be deployed to Tomcat.

    So in my particular case I’ll be going with the implementation outlined in my prior post. YMMV.

    Steve

    #230215 Reply

    svalin
    Member

    Hey Riyad,

    If you’re still reading these posts, I have an idea for the MyEclipse team.

    To handle this sort of situation at DEVELOPMENT time (for debugging) (I don’t care about test or production because I can do whatever I want with Ant builds for those deployments), do you think it would be possible to add “virtual” files and/or folders to the WebRoot of a project?

    In other words, I have all of my common styles, images, etc in a directory in one project (globalCommon in the earlier example).

    Then, instead of manually importing the globalCommon directory into each web project (physically copying the files), simply create a reference to the globalCommon directory and those files would be included along with the rest of the files in the deployment. Of course “virtual” files and folders would not participate in a CVS commit of the project (or maybe this would be configurable).

    There is a similar feature already available whereby you add a file or folder to a project but are allowed to simply “Link to folder in the file system” instead of actually creating or importing (copying) the files within the project.

    The problem with this is that Eclipse (or MyEclipse) prevents you from creating a “linked folder” within WebRoot. It appears to only allow linked folders under the project root. The other problem is that then you are dependent on the physical location of the files within the file system, rather than referencing the files by project.

    (BTW, I’m on Eclipse 3.02, MyEclipse 3.8.4)

    Think you might want to add such a feature to MyEclipse? I can’t believe I’m the only one confronting this issue!

    Steve

    #230236 Reply

    Riyad Kalla
    Member

    The first reason is that it means all of the individual web apps would have to be bundled and deployed together as one app.

    Couldn’t you just have multiple Enterprise Apps, one for each “compiled” project?

    Second, since the globalCommon stuff would be in a separate .WAR file, all of the common files would have to be referenced via a URL. In my case that would be undesireable because I don’t want to incur the extra overhead of an additional web request for images, particularly because my Tomcat server is sitting behind an IIS server (which, for now, is a necessary evil…. YUCK!)

    Ahh, good point.

    Third, Tomcat simply doesn’t understand enterprise apps or .EAR files and apparently this is something that is programmed into the App Server preference files (behind the scenes) by MyEclipse, because MyEclipse won’t allow the encompassing enterprise app to be deployed to Tomcat.

    Nothing fancy going on here, Tomcat does not provide an EJB container, so it isn’t J2EE compliant, you would need to deploy your EARS to Jboss or other equivalent J2EE server.

    do you think it would be possible to add “virtual” files and/or folders to the WebRoot of a project?

    Eclipse actually provides this, they are called “Linked resources”, unfortunately you can only add a linked resource (Currently) to the root of your project… we have no idea why or why the Eclipse team didn’t make them more generic, but if this functionality were to be added it would need to come from the Eclipse team. I think this is a very reasonable request of them considering that any kind of project, MyEclipse or not, can benefit from the user of virtual resources like this.

    There is a similar feature already available whereby you add a file or folder to a project but are allowed to simply “Link to folder in the file system” instead of actually creating or importing (copying) the files within the project.

    The problem with this is that Eclipse (or MyEclipse) prevents you from creating a “linked folder” within WebRoot. It appears to only allow linked folders under the project root. The other problem is that then you are dependent on the physical location of the files within the file system, rather than referencing the files by project.

    Haha woops, I guess I should read entire posts before replying instead of processing it serially 🙂

    Think you might want to add such a feature to MyEclipse? I can’t believe I’m the only one confronting this issue!

    You aren’t, nor are only our MyEclipse uisers… Eclipse users could benefit from this, WTP users, etc… pretty much anyone with a complex project structure could, that’s why fundamentally it should be a base addition to Eclipse JDT… I can’t imagine this hasn’t been filed a 100x already over at bugs.eclipse.org

    I get the feeling other users would like changes to linked resources 😀
    https://bugs.eclipse.org/bugs/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&product=&content=Linked+resource

    #230252 Reply

    svalin
    Member

    Thanks Riyad. It’s impossible that such a feature enhancement hasn’t been requested before.

    I’ll put in my 2 cents on their feature request list anyway in hopes that “Horton Hears a Who”.

    Steve

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: How to merge WebRoot files from diff projects for deploy?

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