cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Cocoon Wiki] Update of "LoadInEclipse" by MarkLeicester
Date Tue, 31 May 2005 12:01:31 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cocoon Wiki" for change notification.

The following page has been changed by MarkLeicester:
http://wiki.apache.org/cocoon/LoadInEclipse

The comment on the change is:
Brought up to date with Eclipse 3.0.2 and BRANCH_2_1_X - can we remove cruft?

------------------------------------------------------------------------------
- == How to load Cocoon in Eclipse ==
+ == Cocoon and Eclipse ==
  
- [http://www.eclipse.org Eclipse] is a wonderful IDE. But making an Eclipse project for Cocoon
isn't a piece of cake given the number of source directories and libraries that compose Cocoon,
especially in version 2.1.
+ (as at 31 May 2005 with BRANCH_2_1_X and Eclipse 3.0.2)
  
- To ease this, Cocoon's build system has a target to create the Eclipse project files automatically.
But (at least as of Cocoon 2.1.5 and above) there are a number of issues to keep in mind as
well.
+ I use [http://www.eclipse.org Eclipse] configured with the Subclipse plugin to retrieve
the Cocoon source code from Subversion.
+ 
+ === Eclipse and Subclipse ===
+ 
+ ==== Windows ====
+ 
+ The following should work on Windows. [Please verify]
+ 
+ To install the Subclipse plugin:
+  1. In Eclipse, click Help -> Software Updates -> Find and Install...
+  1. Choose "Search for new features to install".
+  1. Click the "New Remote Site..." button.
+  1. Enter "Subclipse" into the name field, and "http://subclipse.tigris.org/update" into
the URL field. Click OK.
+  1. Eclipse will contact the Subclipse site for available plugins. Select "Subclipse", "Version
Control with Subversion" and click Next.
+  1. Accept the terms of the agreement, and click "Finish".
+  1. The plugins will probably not be signed. You will get warnings. Click "Install".
+  1. If prompted, click to restart the Eclipse workbench.
+ 
+ ==== Mac OS X ====
+ 
+ The above steps didn't work on my Mac OS X 10.3 Powerbook. Instead, I needed to rollback
to Subclipse version 0.9.30 (instead of 0.9.31, the latest version at the time of writing).
I also needed to install the Pure Java Subversion Client Library. My steps were:
+  1. Visit the [http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240&expandFolder=2240&folderID=2240
Subclipse Archive] and download [http://subclipse.tigris.org/files/documents/906/21855/site.0.9.30.zip
site.0.9.30.zip].
+  1. Unzip site.0.9.30.zip to my local hard drive.
+  1. In Eclipse, click Help -> Software Updates -> Find and Install...
+  1. Choose "Search for new features to install".
+  1. Click the "New Local Site..." button.
+  1. Enter "Subclipse (0.9.30 local)" into the name field, and select the folder you unzipped
site.0.9.30.zip into. Click OK.
+  1. Accept the terms of the agreement, and click "Finish".
+  1. The plugins will probably not be signed. You will get warnings. Click "Install".
+  1. If prompted, click to restart the Eclipse workbench.
+  1. When Eclipse has restarted, click Help -> Software Updates -> Find and Install...
+  1. Choose "Search for new features to install".
+  1. Click the "New Remote Site..." button.
+  1. Enter "Pure Java Subversion Client Library" into the name field, and "http://tmate.org/svn/"
into the URL field. Click OK.
+  1. Eclipse will contact the Subclipse site for available plugins. Select "JavaSVN Library",
"JavaSVN Subclipse Extension" and click Next.
+  1. Accept the terms of the agreement, and click "Finish".
+  1. The plugins will probably not be signed. You will get warnings. Click "Install".
+  1. If prompted, click to restart the Eclipse workbench.
+ 
+ For more information about using Subclipse on different environments, visit [http://subclipse.tigris.org/].
+ 
+ === Checking out Cocoon BRANCH_2_1_X with Subclipse ===
+ 
+ Create a new repository:
+  1. In Eclipse, click Window -> Open Perspective -> Other...
+  1. Choose "SVN Repository Exploring" and click OK.
+  1. In the SVN Repository view, right-click and select New -> Repository Location...
+  1. Enter "http://svn.apache.org/repos/asf/cocoon/" into the URL field.
+  1. Click "Browse..." to choose "http://svn.apache.org/repos/asf/cocoon" as the Root URL.
+  1. Leave the user and password fields blank.
+  1. Click "Finish".
+ 
+ Check out the Cocoon BRANCH_2_1_X source code:
+  1. From the SVN Repository view, expand "http://svn.apache.org/repos/asf/cocoon".
+  1. Open the branches subfolder.
+  1. Right-click on BRANCH_2_1_X, and choose "Check Out As...".
+  1. Choose "Java Project from the Wizards box and click "Next".
+  1. Enter BRANCH_2_1_X into the project name field.
+  1. Click "Finish", and wait. Subclipse will take a long time to complete the checkout!
+ 
+ '''Note:''' Eclipse automatically detects source folders and adds them to your project (there
is no need to run an Ant task to create an Eclipse project).
  
  === Eclipse and Ant ===
  
- Eclipse comes with Ant built-in. This is commonly known as the "internal Ant". The Ant integration
in Eclipse provides some nice features, such as an outline for build.xml files from which
you can right-click on a target to build it. Unfortunately this does not work for building
Cocoon sources in Eclipse.
+ ==== Building Cocoon with Eclipse's built-in Ant ====
+ 
+ To begin, we need to configure Ant to use the latest Xerces and Ant contrib JARs. We only
need to do this once:
+  1. In Eclipse, click Window -> Preferences, and choose Ant -> Runtime from the tree
on the left of the dialog box.
+  1. From within the Classpath tab, click on "Global Entries" and then click "Add JARs..."
+  1. From your Cocoon project select tools/lib/ant-contrib-0.6.jar, lib/endorsed/xml-apis
and lib/endorsed/xercesImpl-2.6.2.
+  1. Click OK
+ 
+ Eclipse comes with Ant built-in. The Ant integration in Eclipse provides some nice features,
such as an Eclipse view for build.xml files. Now we'll load Cocoon's Ant build file into the
Eclipse Ant view:
+  1. Make sure the Ant view is visible in your current Eclipse perspective. If not, choose
Window -> Show View, and select Ant.
+  1. Drag the build.xml from the Cocoon project root folder into the Ant view, and expand
the tree. You should see many Ant targets, each marked with a green concentric circle.
+ 
+ To build Cocoon from within Eclipse:
+  1. In the Ant view, double click the target you wish to build (e.g. "war", "webapp" etc.)
+  1. Output from the build process should appear in Eclipse's Console window.
+ 
+ '''Note:''' All these targets (e.g. "war", "webapp" etc.) automatically invoke the init-tasks
target mentioned below. There is no need to run the init-tasks target first, as described
below.
+ 
+ ----
+ 
+ == Older Material (can it be deleted now?) ==
  
  The reson for that is that the Cocoon build process relies on external tasks in Ant (see:
[http://ant.apache.org/external.html]) which are compiled on-the-fly during the Cocoon build
process. So if you build Cocoon from the command line using either {{{build.bat}}} (Windows)
or {{{build.sh}}} (*ix) here is what is happening internally:
  
@@ -25, +105 @@

  from the sources in {{{tools/src/anttasks}}} to {{{tools/anttasks}}} and make these external
tasks known to Ant using {{{<taskdef ...>}}}.
  
  Other targets further down the build process rely on these tasks obviously.
- 
- ==== Why does that not work with the internal Ant in Eclipse ====
- 
- ----
- 
- Quite frankly: Don't know yet. Whoever is sure about this is strongly encouraged to edit
this section or - even better - explain how to make it work. All I was able to speculate about
so far is:
- 
-  * I am not sure to what extend the CLASSPATH manipulation done in the build.bat / build.sh
scripts can be done with Eclipse internal Ant but at the same time it am not sure if it will
be necessary at all.
-  * There seems to be no hook in the Eclipse UI to specify the endorsed lib directory for
the Ant run.
-  * The internal Ant is running in the same VM as the Eclipse workbench itself. So I don't
consider it an option to alter the endorsed settings through the -vmargs option when starting
the Eclipse workbench.
- 
- It is not the reason:
- 
-  * ... that Ant version in Cocoon and Eclipse do not match! Both Cocoon 2.1.6 and Eclipse
3.1 M3 come with Ant 1.6.2!
- 
- Questions and places to discuss:
- 
-  * Why does the Cocoon build process has to build the external Ant tasks from source rather
than supplying them as .class / .jar files? (We don't build Ant itself from source, do we?
Should we?) This would be a topic for the Cocoon Developer's list.
-  * Should the "internal Ant" run in a separate VM or use a separate class loader? Does it
already have this capability and I just overlooked it? Should there be an option to specify
endorsed libraries for the Ant run? This would be a topic for the Ant integration list at
the Eclipse Platform project.
- 
- I will raise these questions in the mentioned places and update this page as soon as I get
any answers.
- 
- TorstenSchlabach
- 
- ----
  
  === Eclipse, its workspace and how to import a project ===
  

Mime
View raw message