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
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.
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
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
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
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.
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.
On WLP installation on Windows or Linux, zip up the following directories:
Copy archive from step 5 onto Solaris host
Unzip archive from step 6 into <main-eclipse-folder>/dropins. Note that the wtp subdirectory will already exist. This will add/change some contents.
On WLP installation on Windows or Linux, zip up the following directory: <middleware-home>/wlportal_10.3/eclipse
Copy archive from step 8 onto Solaris host
Unzip the archive from step 9 into <middleware-home>/wlportal_10.3/eclipse (creating the ecplipse directory)
In a <main-eclipse-folder>/links folder, create a com.bea.wlp.link file that looks like: path=<full path to wlportal_10.3>
Edit the <main-eclipse-folder>/eclipse.ini to add: -Dsun.lang.ClassLoader.allowArraySyntax=true -Dweblogic.home=<full path to wlserver_10.3>
Download the headlessworkspace plugin from http://code.google.com/p/headlesseclipse/downloads/list and drop it into <main-eclipse-folder>/plugins
Start Eclipse with -clean parameter
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).