5 Replies Latest reply on Mar 29, 2010 8:17 PM by Denis Golovin

    Copying and Branching a Project

    John Bailo Master

      I have a JBoss Tools web application project and I want to create a new "flavor" of it.

       

      So, I copied my project and saved it under a new name.

       

      The original project is under CVS version control.

       

      Call the old project MYPROJECTOLD

      Call the new project MYPROJECTNEW

       

       

      There are a few problems:

       

      1. When I run/debug MYPROJECTNEW at the project level, it launches under the old projects url, localhost/MYPROJECTOLD

      2. In the development JBoss AS 4.3.2 server, I want to add MYPROJECTNEW to the list of configured projects on the server.   However, I do not see MYPROJECTNEW in the list of projects, only MYPROJECTOLD
      3. If I try to right click and debug a .jsp file in MYPROJECTNEW, I am told  The selection is not within a valid module.   Could this be related to (2

      4. When I look at my CVS repositor, it appears that any files I add to MYPROJECTNEW are being added to MYPROJECTOLD.   MYPROJECTNEW does not appear in the repository, even though I right-clicked and selected Branch in the Eclipse Team menu.
        • 1. Re: Copying and Branching a Project
          Denis Golovin Master

          John Bailo wrote:

           

          1. When I run/debug MYPROJECTNEW at the project level, it launches under the old projects url, localhost/MYPROJECTOLD

          It can be changed in project properties dialog. Select "Web Project Settings" Category and you'll see 'Context Root' field to define it.

           

          John Bailo wrote:


          1. In the development JBoss AS 4.3.2 server, I want to add MYPROJECTNEW to the list of configured projects on the server.   However, I do not see MYPROJECTNEW in the list of projects, only MYPROJECTOLD
          2. If I try to right click and debug a .jsp file in MYPROJECTNEW, I am told  The selection is not within a valid module.   Could this be related to (2

          Here is the general approach to fix this in your case.

          1. Change filter preferences to see hidden files which name started from .

          2. Do file search trough all files for 'MYPROJECTOLD'  and replace to my "MYPROJECTNEW"

          3. Close and open project again

           

          John Bailo wrote:


          4. When I look at my CVS repositor, it appears that any files I add to MYPROJECTNEW are being added to MYPROJECTOLD.   MYPROJECTNEW does not appear in the repository, even though I right-clicked and selected Branch in the Eclipse Team menu.

            Delete hidden CVS meta data after you copied project and share project again. Another approach is exporting it before renaming to get just sources without CVS metadata.

            • 2. Re: Copying and Branching a Project
              John Bailo Master

              Denis Golovin wrote:

               

              It can be changed in project properties dialog. Select "Web Project Settings" Category and you'll see 'Context Root' field to define it.

               

              I changed this.  Now it launches with MYPROJECTNEW in the URL, but the server doesn't find any files.  It still doesn't recognize the project

               

              Change filter preferences to see hidden files which name started from .

               

              I'm not exactly sure where "Change Filter Preferences" is located?

               

              Delete hidden CVS meta data after you copied project and share project again. Another approach is exporting it before renaming to get just sources without CVS metadata.

               

              Do I need to leave the \CVS folder?   I deleted the whole thing and the project wouldn't load.  Do I delete only the files in the folder?

               

               

               

              Thank you for your help!!

              • 3. Re: Copying and Branching a Project
                Denis Golovin Master

                John Bailo wrote:

                 

                Denis Golovin wrote:

                 

                It can be changed in project properties dialog. Select "Web Project Settings" Category and you'll see 'Context Root' field to define it.

                 

                I changed this.  Now it launches with MYPROJECTNEW in the URL, but the server doesn't find any files.  It still doesn't recognize the project

                 

                That's probably because you still have old project name in hidden configuration files.

                 

                Change filter preferences to see hidden files which name started from .

                 

                I'm not exactly sure where "Change Filter Preferences" is located?

                In Java Package Explorer View press triangle button in task bar, like it shown on screen-shot below and select Filters... item

                 

                filter-menu.png

                 

                Then unselect ".* resources" item like it shown on screen-shot below

                 

                filter-unselect.png

                 

                Then do the search for old name in all files within new renamed project and replace all entries with new name.

                 

                John Bailo wrote:

                 

                Delete hidden CVS meta data after you copied project and share project again. Another approach is exporting it before renaming to get just sources without CVS metadata.

                 

                Do I need to leave the \CVS folder?   I deleted the whole thing and the project wouldn't load.  Do I delete only the files in the folder?

                 

                No matter what it names now all CVS folders still contain old module name in CVN\Repository file and that's why your commits come to the old CVS module in repository. So you ether should delete all CVS folders in your local filesystem or disconnect your project from CVS with meta information deletion through Team/Disconnect... context menu on your project in any eclipse navigator view. Then you should share it again in CVS module with new name.

                • 4. Re: Copying and Branching a Project
                  John Bailo Master

                  Ok, I got the deploy to work correctly.

                   

                  So, my path so far was:

                   

                  1. Disconnect original project from CVS.
                  2. Copy project.
                  3. Change old project names to new project names in Webcontext and elsewhere.
                  4. Team CVS Reconnect original project
                  5. Team Share new project into CVS

                   

                  The last remaining step is documented here:

                   

                   

                  Copying A Project in Eclipse and CVS

                  http://www.eclipse.org/forums/index.php?t=msg&goto=523915&#msg_523915

                   

                  You have to understand that I'm very noob so I  didn't know that Search...was a top level menu and had not been able to  find it under Edit (VSS.Net here).

                  Once I found it I did not see any mention of the old file name until I  checked  Consider Derived Resources.

                  At that point I found the source of my deploy to Jboss problem...the old  project name was in file called

                  org.eclipse.wst.common.component

                  Once I changed it there to the new project name, I right clicked on the  JBoss server and selected Add and Remove Projects... and was able  to add the new project to the list that JBoss would deploy.
                  • 5. Re: Copying and Branching a Project
                    Denis Golovin Master

                    I glad you got through it.

                     

                    I've checked refactoring for Dynamic Web Project and it seems for me that it also would work for you if you checked out this project, disconnected it from CVS and then used Refactor->Rename... from context menu on Dynamic web project. It looks like this renaming updates all project names in hidden configuration files.