How to build projects outside of Eclipse GUI


With the introduction of WebLogic Portal 10.3.2, the product moved to the new Oracle Enterprise Pack for Eclipse http://www.oracle.com/tools/enterprise-eclipse-pack.html  from the BEA Workshop for WebLogic product for Eclipse.  As part of this transition, the ant export facilities provided with Workshop for WebLogic to allow a project to be built outside of the Eclipse GUI as part of an automated procedure are no longer provided as there are several more standard options to do this type of build automation.  This post covers these new options, and specifically calls out one way you can do a very similar process on a Solaris based environment


The Issue

Eclipse projects contain a lot of information about dependencies. Such information is necessary to compile the projects. However, customers need to compile the projects outside of development environments – staging, production, and continuous build environments. The set of all possible project types and dependencies is very large, and some customers track these dependencies outside of Eclipse as part of their process, and integrate these into their custom build processes.  This is in fact the recommended best practice, and is often done by leveraging solutions such as Maven.
However, many customers rely on Eclipse and their developers to store these dependencies, especially those that were formerly leveraging the export ant facility of Workshop for WebLogic. Workshop for WebLogic provided a mechanism to export ant scripts, which can be used without an IDE, to build Eclipse Projects. However, this solution was fragile as it relied on constantly changing Eclipse internals. WLP 10.3.2 made a strategic shift to OEPE from Workshop for WebLogic, and OEPE does not provide this export ant facility. Rather, it relies on other, more standard approaches.


Two options

As stated, there are essentially two options. The first is to do custom build scripts, often leveraging a common build environment. The second is to do ‘headless builds’ which essentially run Eclipse just as a developer would, but are fully automatable without requiring an Eclipse GUI to be manually launched.

Custom Build Scripts

Pros
  • Formal dependency tracking outside the IDE – far better management and control. For example, makes it easier to determine un-needed libraries and do mass updates of libraries across projects
Cons
  • Does not do dependency analysis from the IDE – extra steps for developers
  • May need to be updated over time as new types of projects are created
Headless Builds
Pros
  • Advantage is all the project dependency information in Eclipse is utilized
  • Simple to script, generic to all Eclipse Projects
  • Exactly mirrors developer environments
Cons
  • Requires Eclipse Install on Build Environment w/ target OS – for example, must have Eclipse for Solaris
  • Eclipse is not very good at doing management of project assets at an enterprise level across projects
  • May result in many libraries being included which are not needed by a project due to a simple developer gesture to add them- no centralized control


Sample Headless Build Instructions (including Solaris)

Doing basic headless builds using Eclipse is a fairly straightforward process.  One of the most common projects for doing headless builds can be found here: http://code.google.com/p/headlesseclipse
However, to do the build on an atypical platform for running Eclipse, such as Solaris, is a bit more effort initially to setup- so we are providing sample instructions below on how you can do headless builds. They may need to be updated and modified to meet each customers particular build requirements.
  1. Get a Solaris 3.5 eclipse. It's not off the main eclipse download page, but a Google search will get you to this page: http://download.eclipse.org/eclipse/downloads/drops/R-3.5-200906111540/solPlatform.php
  2. Unzip that on the Solaris machine.
  3. Get WTP 3.1.0 -- http://archive.eclipse.org/webtools/downloads/drops/R3.1/R-3.1-20090616035105/ is the download page. A direct link is: http://www.eclipse.org/downloads/download.php?file=/webtools/downloads/drops/R3.1/R-3.1-20090616035105/wtp-R-3.1-20090616035105.zip
  4. Unzip WTP 3.1.0 to a <main-eclipse-folder>/dropins/wtp folder; it should then have dropins/wtp/eclipse/features and dropins/wtp/eclipse/plugins folders.
  5. On WLP installation on Windows or Linux, zip up the following directories:
    1. <middleware-home>/oepe_11gR1PS1/eclipse/dropins
    2. dtp
    3. emf
    4. emf-xsd
    5. gef
    6. wtp
    7. oepe
  6. Copy archive from step 5 onto Solaris host
  7. Unzip archive from step 6 into <main-eclipse-folder>/dropins.  Note that the wtp subdirectory will already exist.  This will add/change some contents.
  8. On WLP installation on Windows or Linux, zip up the following directory: <middleware-home>/wlportal_10.3/eclipse
  9. Copy archive from step 8 onto Solaris host
  10. Unzip the archive from step 9 into <middleware-home>/wlportal_10.3/eclipse (creating the ecplipse directory)
  11. In a <main-eclipse-folder>/links folder, create a com.bea.wlp.link file that looks like:
     path=<full path to wlportal_10.3>
  12. Edit the <main-eclipse-folder>/eclipse.ini to add:
    -Dsun.lang.ClassLoader.allowArraySyntax=true
    -Dweblogic.home=<full path to wlserver_10.3>
  13. Download the headlessworkspace plugin from http://code.google.com/p/headlesseclipse/downloads/list  and drop it into <main-eclipse-folder>/plugins
  14. Start Eclipse with -clean parameter
  15. Validate that the portal plugins can be seen (eg. Create Portal EAR project)

To run the headless build, from <eclipse-main-folder> execute something like:
./eclipse –nosplash –data <path-to-wlp-project> -application com.ind.eclipse.headlessworkspace.Application clean build exportears
See the documentation at the http://code.google.com/p/headlesseclipse/wiki/Documentation for information on running the headlesseclipse project.
You should be able to execute the headless build on Solaris both through VNC (no need to run the Xserver) and through telnet (after running the Xserver as documented).
Left Curve
Popular Downloads
Right Curve
Untitled Document
Left Curve
More Middleware Downloads
Right Curve