facebook

[Closed] Renaming or copying MyEclipse Project

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #269827 Reply

    Marty Hall
    Member

    If I have a Web project called “foo” and I deployed it within MyEclipse, it is then accessible as http://hostname/foo/…

    However, if I rename (Refactor->Raname) the project to “bar”, it will still be accessible as http://hostname/foo/…. That is, the context root does not get updated when I rename. I have the same problem if I copy/paste a project: the context root still does not get updated.

    I can work around this by editing .mymetadata and editing the context-root entry, then restarting MyEclipse. But presumably there is a better and easier way that I have overlooked.

    Any suggestions?

    #269829 Reply

    Riyad Kalla
    Member

    You can actually edit the context-root under project properties and the MyEclipse > Web preference panel.

    Also the context root is not related to the project name. You may have personally adopted a 1:1 relationship between then, but many people don’t. For example a project named “Accounting and Management Module D” will deploy to context root “/admin” or something like that.

    We can’t make any assumptions about name == context root, which is why we don’t change it.

    #270321 Reply

    Marty Hall
    Member

    Thanks: I did not know you could right-click on the project, go to Properties, and change the context path there. That is helpful.

    Although I agree that it is possible (and sometimes desirable) to have the context path be different than the project name, I still think MyEclipse should update the context path when you copy/rename a project. If I press the “deploy” button at the top, it automatically deploys with the context path matching the project name (and doesn’t give you an option to change it).

    An even better option might be: when you deploy, make the textfield showing the context path editable.

    #270341 Reply

    Riyad Kalla
    Member

    If I press the “deploy” button at the top, it automatically deploys with the context path matching the project name (and doesn’t give you an option to change it).

    When you go to create the deployment for the new copied project, it *should* show you that there is an overlap between the request dir and an existing deployment and ask you to Overlay, Backup, Delete the existing deployment. Did you see that prompt?

    An even better option might be: when you deploy, make the textfield showing the context path editable.

    You can have that, it’s a Custom Location Deployment type though, as opposed to selecting the specific app server.

    NOTE: I’m not disagreeing with you, just trying to show alternatives to get you closer to the desires behavior.

    #270373 Reply

    Marty Hall
    Member

    If I press the “deploy” button at the top, it automatically deploys with the context path matching the project name (and doesn’t give you an option to change it).

    When you go to create the deployment for the new copied project, it *should* show you that there is an overlap between the request dir and an existing deployment and ask you to Overlay, Backup, Delete the existing deployment. Did you see that prompt?

    I always undeploy apps I am not currently working with so that Tomcat 6 starts faster. So, I didn’t see that prompt.

    Thanks for the tip about custom deployments; I didn’t know about it.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: [Closed] Renaming or copying MyEclipse Project

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