Skip to content

How to set up CDR projects in Eclipse

bbpennel edited this page Sep 14, 2011 · 3 revisions

How to Set Up the CDR Master Maven Project in Eclipse

  1. The first step is to check out the master project from SVN. You can either do this in Eclipse or via the command line, but I recommend the command-line. You can even do this without Eclipse running. Just put the trunk for cdr-master in your eclipse workspace folder:

    count0@aalcdl24a:~/workspace$ git clone [email protected]:UNC-Libraries/Carolina-Digital-Repository.git cdr-master

  2. Next step is to generate eclipse project files, using Maven:

    count0@aalcdl24a:~/workspace$ cd cdr-master

    count0@aalcdl24a:~/workspace/cdr-master$ mvn org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse

  3. There may be various intermediate warnings and errors, but at the end you should see success status for the entire list of projects.

  4. Start Eclipse.

  5. Create a working set for CDR web application, if desired.

  6. Now we are going to "Import an Existing Project" for the main project and each sub-project, starting with the master.

  7. Choose File > Import. Select "Import an Existing Project". Use the browse button to Navigate to the next project's main folder.

  8. After you select the root of a project, cdr-master, you should see a list of projects below with check boxes.

  9. If you created a working set, add each project to your working set.

  10. Add the cdr-master project itself to Eclipse by adding a new faceted project and pointing at your existing cdr-master folder.

  11. You can now select all of these new project in Eclipse and right-click to reach Team > Share. Select Git and the defaults to share via the existing local .git repository.

  12. Note that by default maven configures these projects to resolve workspace artifacts on build. While we avoided this approach in the past, it may be a better way to go about working in a master-child setup, since you may now make local changes to more than one project for a particular feature.

  13. In my workspace, the access and services projects had trouble resolving the JAXB generated classes in fcrepo-clients. I don't know why this was happening, since fcrepo-clients seems to be exporting those packages. In any case, you can resolve those dependencies by adding the fcrepo-clients project to the build path, under the projects tab.

  14. To build the admin project, add to the admin project's Java Build Path the directories admin/target/generated-sources/dir1 and admin/target/generated-sources/dir2 . Both of them should be set to Included: (All) and Excluded: (None).

Set up the project using EGit

  1. Install the m2e plugin if it is not already.
  2. Install EGit plugin.
  3. Add the Git Repositories view
  4. In the Git Repositories view, click on "Clone Git Repository and add a clone to this view".
  5. Under Location > URI paste in one of the source code paths for this repository, such as git://github.com/UNC-Libraries/Carolina-Digital-Repository.git
  6. Click next, then select the branch to use. Most likely it will be master.
  7. Click next, change the Directory if you want, then finish.
  8. To import the entire project, go to File > import > maven > existing maven project. Select the root Working Directory that is listed in the Git Repositories view.
  9. Continue from step 11 above to share the project back to git.