Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Refactoring, rewriting, mostly for Gradle

...

Warning
titleBe sure Eclipse is ready

Before any interaction with OFBiz in Eclipse be sure to run "gradlew eclipse". This generate the information Eclipse needs about the OFBiz project.

...

  1. You can either allow Eclipse to download OFBiz directly from SVN,
  2. or you can import an already downloaded copy of OFBiz (from SVN or otherwise) from the filesystem.

 

Info
titleMostly for committers but also for users who mind about svn history and annotations.

OFBiz has been split between framework and plugins. It's though still possible for Eclipse to handle the plugins inside the framework by embedding the ofbiz-plugins project inside the ofbiz (ofbiz-framework) project. That's interesting notably if you use Subclipse.

  1. Install the the best Eclipse plugin for Gradle: "Pivotal EGradle IDE". You can find it with MarketPlace and it offers almost all what you need.
  2. Change your perspective to show the EGradle buttons in the toolbar
  3. Run pullAllPluginsSource inside Eclipse using the "EGradle quick launch" feature (use the button in the toolbar)
  4. Import the just checked out ofbiz-plugins project in Eclipse.
  5. Follow https://stackoverflow.com/questions/9163501/eclipse-import-folder-of-source-code-to-other-projects.
  6. You should now be able to use the ofbiz project to handle both framework and plugins.

There is only 1 drawback. If you run gradlew eclipse your ofbiz project will lose the relation with its ofbiz-plugins sub project because this Gradle task delete and create a new .classpath files which destroy the relation created when following the stackoverflow answer. Then you need to make the steps above again. Note that you only need that if you wan to use Subclipse for plugins from inside the ofbiz (ofbiz-framework) project. Else the plugins project should still stay open and you can use Subclipse there. We can maybe automate that with Gradle but I'm not sure how.

Importing OFBiz from the filesystem into Eclipse

If you have already downloaded OFBiz and do not wish to have Eclipse handle SVN pulls for you, Eclipse can import OFBiz from the filesystem as well.

...

  1. Right-click in the Navigator window and click on Import.
  2. Select "Existing Project into Workspace" and click Next.
  3. Click Browse and select the directory that contains the ".project" file, then click Finish. When this is complete, a new project named "ofbiz" will now appear in your Navigator. This will not copy the project to Eclipse's workspace directory: it will remain wherever it was before the import. If you want the OFBiz files in your workspace directory, you must move them there before you do the import. Note that by doing so you will not have the the plugins inside your ofbiz project. If you want that, follow the info in the "Setting up Eclipse to work with OFBiz is easy" section above.

 

...

Using SVN from within Eclipse

If you want to do the SVN pull from within Eclipse, use the following steps:

  1. First you need to install Subclipse
  2. Bring up the "SVN Repository" panel in Eclipse (Window/Open Perspective/SVN Repository Exploring)
  3. Right-Click within panel/New/Repository Location
    Pick the URL of the one you are interested in at http://svn.apache.org/repos/asf/ofbiz/
     eg: http://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk/
  4. Click on Finish. Now, do the initial checkout.
  5. Click the "+" next to the new repository
  6.  then Right-Click on trunk and select "Checkout...".
  7. Select "Check out as project in the workspace" and click on "Finish".
  8. This will create a new project that you can name as you want and download the OFBiz files directly from SVN. To sync your project with SVN in the future, right-click on the project and click Teams/Synchronize with Repository. Note that by doing so you will not have the the plugins inside your ofbiz project. If you want that, follow the info in the "Setting up Eclipse to work with OFBiz is easy" section above. Then of course import the project from the plugins directory inside the OFBiz project.

...

Using GIT from within Eclipse

You will need "Git Team Provider" package (integral part of many Eclipse IDE builds) for this to work. If not installed please check "EGit - Git integration for Eclipse".

...

For more information about how to manage the repository please see EGit/User Guide - Managing Repositories.

Eclipse and Gradle

The best Eclipse plugin for Gradle is "Pivotal EGradle IDE" you can find it with MarketPlace and it offers almost all what you need.

Info
titleMostly for committers but also for users who mind about svn history and annotations.

OFBiz has been split between framework and plugins. It's though still possible for Eclipse to handle the plugins inside the framework by embedding the ofbiz-plugins project inside the ofbiz (ofbiz-framework) project.

...

That's interesting notably if you use Subclipse.

  1. Install the best Eclipse plugin for Gradle: "Pivotal EGradle IDE". You can find it with MarketPlace and it offers almost all what you need.
  2. "Customize your Perspective" to show the EGradle buttons in the toolbar
  3. Run pullAllPluginsSource inside Eclipse using the "EGradle quick launch" feature (use the button in the toolbar).
    Beware if you have pending changes they will be lost. So if you have already done the 6 steps here, you might prefer to update using svn...
  4. Import the just checked out the plugins project in Eclipse.
  5. Follow https://stackoverflow.com/questions/9163501/eclipse-import-folder-of-source-code-to-other-projects.
  6. You should now be able to use the ofbiz project to handle both framework and plugins (in a sub-project).

There is only one drawback. I you run "gradlew eclipse" (notably needed after a cleanAll), you need to redo the 3rd step.

...

...

Hide folders from searches

...

A new file .catalog.xml has been introduced in OFBiz root starting from svn 1326499. This file contains a definition compliant with the Oasis Catalog specification of all schemas used by ofbiz. You can import it in you Eclipse workbench by following the explanation at the Eclipse Import XML catalog section (hint: use the Eclipse Import/XML feature). Note also that the platform:/resource notation is used to identify a resource located in the workspace. The next path segment after "resource" should be the name of a project, which can be followed by the folder and/or file we want to locate. So you might need to change the workspase name part of the path according to your real project name.

Here is an example

 

Eclipse and Gradle

The best Eclipse plugin for Gradle is "Pivotal EGradle IDE" you can find it with MarketPlace and it offers almost all what you need.

...