Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "SMILA/Documentation/HowTo/Howto set up dev environment"

m (Getting the source code)
(Add example projects)
(65 intermediate revisions by 7 users not shown)
Line 1: Line 1:
[[Category:SMILA]]
+
<br> This HowTo describes the necessary steps for setting up a SMILA development environment.
  
This HowTo describes the necessary steps for setting up a SMILA development environment.
+
=== Preconditions  ===
  
==== Preconditions  ====
+
Here is the list of things that you will definitely need for developing SMILA components:
  
Here is the list of things that you will definitely need for developing SMILA components:
+
* JDK 1.7 (Java 8 is not yet supported by SMILA).
 +
* Eclipse SDK - This HowTo was tested with [http://download.eclipse.org/eclipse/downloads/drops4/R-4.4.1-201409250400/ Eclipse Classic SDK 4.4.1] (Luna Release) <br>
  
# JDK 1.6
+
=== Getting the source code ===
# Recent Eclipse SDK - This HowTo was tested with [http://download.eclipse.org/eclipse/downloads/drops/R-3.7.1-201109091335/index.php Eclipse Classic SDK 3.7.1] (Indigo SR1) <br/>
+
  
==== Getting the source code ====
+
There is more than one way of getting the code into your Eclipse workspace. The following sections will describe how to get the source code from the Git repository (recommended!).
  
There is more than one way of getting the code into your Eclipse workspace. In the next two sections, two recommended ways are shown. After having imported the source code into your workspace, it will show up a lot of errors. Don't worry, they'll disappear when you run through all steps of this HowTo.
+
As an alternative, you could download the complete source code from the [http://www.eclipse.org/smila/downloads.php release download page] or the [http://build.eclipse.org/rt/smila/nightly/ nightly build downloads] and unpack the archive into your workspace.  
  
Both methods descibed below will lead you to the same result: They will provide you with a workspace containing all core SMILA projects (plus SMILA.releng when you choose the Project Set File).
+
==== Installing Git Provider ====
  
===== Getting the source code manually ===== 
+
''(skip this section if Git Team Provider is already installed in your Eclipse IDE - most current Eclipse Packages do contain it)''
This is a little more involved than the ''Project Set File'' but the recommended practice, especially when you wish to update frequently.
+
  
Use your favorite SVN client to check out SMILA's source code from the repository located at:
+
* Install ''Eclipse Git Team Provider'' and ''Java Implementaton of Git'' from the Eclipse software repository.
<pre>http://dev.eclipse.org/svnroot/rt/org.eclipse.smila/trunk/core</pre>
+
* Restart Eclipse.  
  
'''Hint:'''
+
==== Get source code from Git ====
''We recommend to check out the {{code|trunk/core}} as opposed to importing the projects through IDE SVN integrations. By doing so, you can easily get new projects just by updating your working copy and reimporting the sources.''
+
  
After having checked out the source code, import it in your IDE:
+
* Open the "Git" perspective
 +
* Select "Clone a Git repository"
 +
* Enter one of the following URIs for read-only access:
 +
** <tt>git://git.eclipse.org/gitroot/smila/org.eclipse.smila.core.git</tt>
 +
** <tt>http://git.eclipse.org/gitroot/smila/org.eclipse.smila.core.git</tt>
 +
(** Committers: use <tt>ssh://git.eclipse.org/gitroot/smila/org.eclipse.smila.core.git</tt> for read-write access and enter your credentials below)
 +
* Click "Next". In the following dialog ensure that branch "master" and other branches you need are selected (there are no other branches at the time of writing ;-)
 +
* Enter the desired location of your clone of the Git repository. You can put this into your current workspace, but this is not necessary.
 +
** You can activate the "Import all existing projects after clone finishes" now to import ALL projects, or you can manually import them afterwards to be a bit more selective.
 +
* Click "Finish". The Git repository will be cloned now. This will probably take a few minutes.
 +
* Switch to the "Plug-in Development" perspective.
 +
* To import the projects into the workspace (if not done automatically):
 +
** Open "File" -> "Import ..." and select "Git"/"Projects from Git". Click "Next" and select "Existing local repository". Click "Next" and select "org.eclipse.smila.core - ...". Click "Next".
 +
** Select "Import existing projects" and "core" in the tree below, and click "Next". Make sure all projects are selected and click "Finish".
 +
* After a while a "Problem occurred" dialog will open and there will be lots of compile errors. This is OK, we will fix this now.
  
Click File --> Import --> General --> Existing Projects into Workspace --> Next --> Select root folder of local trunk --> (all projects should be selected automatically) --> Finish
 
  
===== Using the Project Set File to get the source code =====
+
=== Defining the target platform  ===
This uses a ''Project Set File'' (.psf) file to check out and import all projects.
+
  
You have to install a subversion team provider in your eclipse IDE in order to use the ''Project Set File''. We recommend to install the Subversive Team Provider from the eclipse software repository (you should also install SVN JDT Ignore Extensions).
+
The target platform defines the set of bundles and features that you are developing against. SMILA ships a ''Target Definition File'' that you can open in your IDE to configure the target platform automatically. This file contains all the references needed for developing SMILA with Eclipse Luna (Release 4.4.1).
  
Before you can use the subversive team provider you have to select the SVN connector to use (we suggest that you should take the latest SVN Kit the Subversive Connector Discovery offers to you).
+
==== Using the target platform provided by SMILA ====
  
# Download [https://dev.eclipse.org/svnroot/rt/org.eclipse.smila/trunk/releng/devenv/SMILA-core.psf SMILA-core.psf] file
+
* Import project "SMILA.devenv" from the "releng" directory of your local Git repository (same procedure as for importing the other projects).
# File --> Import --> Team --> Team Project Set
+
* Open the file <tt>SMILA.devenv/SMILA.target</tt> with the ''Target Definition'' editor. <br>Eclipse starts downloading the referenced bundles/features which it tells you by stating "Resolving Target Definition" in its status bar. Be patient, this will take a while. After it has finished, you can click the link "Set as Target Platform" on the top right of the ''Target Definition'' editor. Doing so will cause Eclipse to start re-compiling the sources and all error markers should be gone when finished.
# Enter the .psf location
+
** If you have the Checkstyle Eclipse plugin installed in your IDE, you will still get error messages. See [[/SMILA/Development_Guidelines#Checkstyle Checkstyle configuration]] for instructions on how to fix this.
# Finish
+
  
Now your IDE starts to download and import the SMILA projects. This will take a while.
+
==== Defining the target platform manually  ====
  
'''Hint:'''
+
* Instead of using the target definition file provided by SMILA (see above) you can also [[SMILA/Development Guidelines/Howto set up target platform|manually set your own target platform]].
''When you want to reimport the psf (e.g. because there are new projects available in the SMILA core repository), you have to update the psf in the SMILA.releng project and import it (right click on it and click on "Import Project Set...", be sure to click "No To All" to the question whether to overwrite existing projects in the workspace, otherwise it will check out everything again instead of ignoring the projects, that are already checked out.''
+
  
===== Enabling the BPEL Designer =====
+
=== Launching SMILA in Eclipse IDE  ===
  
{{note|
+
If you've checked out SMILA's trunk correctly, you should have a project called '''SMILA.launch''' in your workspace. This project contains the SMILA's launch configuration for Eclipse IDE. To start SMILA directly in your Eclipse IDE, just follow the steps below:
If you want to work with the SMILA extensions for Eclipse BPEL designer, you need to checkout the bundles from <tt>trunk/tooling</tt>. Currently these are:
+
* org.eclipse.smila.processing.designer.model
+
* org.eclipse.smila.processing.designer.ui
+
To compile these you need bundles from the [http://www.eclipse.org/bpel Eclipse BPEL Designer] in your target platform. See [[SMILA/BPEL_Designer]] for more information on these bundles.
+
}}
+
  
==== Defining the target platform  ====
+
* Click <span style="font-style: italic;">Run</span>--&gt; ''Debug Configurations'' and expand '''''OSGI Framework'''''<b>.</b>
 +
* Select the ''SMILA'' launch file.
 +
* Click '''Debug'''. <br> If everything works fine, you will get an output in the '''Console''' view similar to the following:
  
The target platform defines the set of bundles and features that you are developing against.  
+
<source lang="text">
 +
osgi> Persistence bundle starting...
 +
ProviderTracker: New service detected...
 +
ProviderTracker: Added service org.eclipse.persistence.jpa.osgi.PersistenceProviderOSGi
 +
Persistence bundle started.
 +
[INFO ] Context /zookeeper: Registered handler(1) ZooKeeperAdminHandler, pattern /(.*)$
 +
[INFO ] Added worker webFetcher to WorkerManager.
 +
...
 +
[INFO ] HTTP server has SMILA handler RequestDispatcher for context /smila.
 +
[INFO ] HTTP server started successfully on port 8080.
 +
</source>
  
===== Defining the target platform the easy way =====
+
=== You're done  ===
  
'''Hint:'''
+
Congratulations! You've just successfully checked out and configured your SMILA development environment and you can now start [[SMILA/Development Guidelines/Create a bundle (plug-in)|developing your own bundles]].
''This way will enable you develop or use SMILA from within your workspace, but we recommend to use the manual way, so you can build releases, even for target platforms that are different to your platform.''
+
  
SMILA ships a target definition file at http://dev.eclipse.org/svnroot/rt/org.eclipse.smila/trunk/releng/devenv/SMILA-indigo-SR1.target that you can open in your IDE (after downloading it or even importing the releng project; if you downloaded the source code using the Project Set File you will already have the SMILA.releng project containing the target definition in your workspace).
+
=== Additional steps ===
  
This file contains all the references needed for developing SMILA with Eclipse Indigo SR1 (3.7.1). After opening it, eclipse starts to download the referenced bundles/features which it tells you by stating "resolving target platform" in the status bar. This takes a good while. After it is done you can hit the link "Set as Target Platform" on the top left of the editor. Doing so will cause eclipse to start re-compiling the sources and all error markers should be gone.
+
The following steps may be needed for special purposes. If you are a SMILA user who only wants to integrate an own component you won't need them.  
  
===== Defining the target platform manually =====
+
==== Checkstyle configuration ====
  
Instead of using the target definition file you can manually set your own target platform like so:
+
If you have the [http://eclipse-cs.sourceforge.net/ Eclipse Checkstyle plugin] installed, you will get a lot of error messages complaining about missing check configurations when Eclipse builds the workspace.
  
::*Download the eclipse SDK (if you have not already done so) and the <tt>Delta Pack</tt> from the eclipse download page listed in the [[#Preconditions|Preconditions]] section.
+
<source lang="text">
::**Please note that it really should be the plain Eclipse SDK to prevent naughty problems from occurring when trying to start SMILA, because of conflicting bundles etc.
+
Errors running builder 'Checkstyle Builder' on project 'org.eclipse.smila.utils'.
::*Extract the SDK in a directory you should name something like <tt>eclipse-target</tt> so you don't confuse it with your IDE's installation folder.
+
Fileset from project "org.eclipse.smila.utils" has no valid check configuration.
::*Unzip the Delta Pack' contents into the contents of the <tt>eclipse-target</tt> folder, always answer <tt>yes</tt> if the system asks you to confirm overwriting of files.
+
...
 +
</source>
  
This directory will be referenced as "eclipse-target" in the following lines.
+
You can solve this by [[SMILA/Development_Guidelines#Checkstyle|setup your Checkstyle configuration]].
  
In your IDE do the following:
+
==== Setting up the Eclipse build ====
::*Click Window --&gt; Preferences --&gt; Plug-in Development --&gt; Target Platform
+
::*Rename the new target, e.g. to "Running target + SMILA.Extension"
+
::*Click Add... --&gt; Select "Nothing: Start with an empty target definition" for target initialization and click "Next"
+
::*Click Add... --&gt; Select "Installation" and click "Next"
+
::*Click on "Browse..." and browse to your "eclipse-target" directory (SDK + delta pack) --&gt; Click OK
+
::*--&gt; Click Finish in the "Add Installation" window
+
::*Click "Add..." --&gt; Select "Directory" --&gt; Click Next --&gt; Select <tt>SMILA.extension/eclipse/plugins</tt> folder under local trunk as the location --&gt; Click Finish
+
::*The target definition dialog should now contain the following entries:
+
::**Name: <tt>Running target + SMILA.Extension</tt>
+
::**In page "Locations" the following entries:
+
::***Installation icon with path to your <tt>eclipse-target</tt> directory, showing the number of available plug-ins
+
::***Directory icon with path to the <tt>SMILA.extension/eclipse/plugins</tt> directory in your checked out SMILA code, showing the number of available plug-ins.
+
::*Change to page "Environment" and select "JavaSE-1.6" as Execution Environment
+
::*Click "Finish" and activate the new target platform by checking the box left to its name.
+
::*Click "OK"
+
  
This will trigger a rebuild of the workspace. Afterwards the errors will have vanished.
+
See [[SMILA/Documentation/HowTo/Howto_build_a_SMILA-Distribution]] for details on how to setup a build for SMILA.
  
==== Launch SMILA in Eclipse IDE ====
+
==== Add <tt>examples</tt> projects ====
  
If you've checked out SMILA's trunk correctly, than you should have a project called '''SMILA.launch''' in your workspace. This project contains the SMILA's launch configuration for Eclipse IDE. To start SMILA directly in your Eclipse IDE just follow the steps below:
+
The <tt>examples</tt> directory of the repository contains three simple bundles that demonstrate how to develop SMILA pipelets and workers. You can import them to your workspace just like the other projects.
::* Click '''Debug''' --> '''Debug Configurations''' and expand '''OSGI Framework'''
+
::* Select '''SMILA''' launch file
+
::* Check if no junit 4 bundles are activated:
+
::** enter junit in the filter of the '''Bundles'''
+
::** uncheck all junit 4 bundles, if they are checked (e.g. org.junit4, org.junit(4.8.2....) etc.) since they conflict with the junit 3 bundles used in SMILA.
+
::* press '''Debug'''
+
:: <br/>
+
::* If everything is started correctly, you will get an output in the '''Console''' view like below:
+
<source lang="text">
+
osgi> Persistence bundle starting...
+
ProviderTracker: New service detected...
+
ProviderTracker: Added service org.eclipse.persistence.jpa.osgi.PersistenceProviderOSGi
+
Persistence bundle started.
+
[INFO ] Context /zookeeper: Registered handler(1) ZooKeeperAdminHandler, pattern /(.*)$
+
[INFO ] Added worker webFetcher to WorkerManager.
+
  
...
+
==== Enabling the BPEL Designer ====
  
[INFO ] HTTP server has SMILA handler RequestDispatcher for context /smila.
+
If you want to work with the SMILA extensions for Eclipse BPEL designer, you need to clone the Git repository at <tt>http://git.eclipse.org/gitroot/smila/org.eclipse.smila.tooling.git</tt> (or <tt>git://...</tt> or <tt>ssh://...</tt>). Currently, the required bundles are:
[INFO ] HTTP server started successfully on port 8080.
+
</source>
+
  
==== You're done ====
+
*<tt>org.eclipse.smila.processing.designer.model</tt>
Congratulations! You've just successfully checked out and configured your SMILA development environment and can now start developing your own bundles.
+
*<tt>org.eclipse.smila.processing.designer.ui</tt>
 +
 
 +
To compile them you need additional bundles from the [http://www.eclipse.org/bpel Eclipse BPEL Designer] in your target platform. See [[SMILA/BPEL Designer]] for more information.
 +
 
 +
 
 +
[[Category:SMILA]]

Revision as of 05:22, 19 December 2014


This HowTo describes the necessary steps for setting up a SMILA development environment.

Preconditions

Here is the list of things that you will definitely need for developing SMILA components:

  • JDK 1.7 (Java 8 is not yet supported by SMILA).
  • Eclipse SDK - This HowTo was tested with Eclipse Classic SDK 4.4.1 (Luna Release)

Getting the source code

There is more than one way of getting the code into your Eclipse workspace. The following sections will describe how to get the source code from the Git repository (recommended!).

As an alternative, you could download the complete source code from the release download page or the nightly build downloads and unpack the archive into your workspace.

Installing Git Provider

(skip this section if Git Team Provider is already installed in your Eclipse IDE - most current Eclipse Packages do contain it)

  • Install Eclipse Git Team Provider and Java Implementaton of Git from the Eclipse software repository.
  • Restart Eclipse.

Get source code from Git

(** Committers: use ssh://git.eclipse.org/gitroot/smila/org.eclipse.smila.core.git for read-write access and enter your credentials below)

  • Click "Next". In the following dialog ensure that branch "master" and other branches you need are selected (there are no other branches at the time of writing ;-)
  • Enter the desired location of your clone of the Git repository. You can put this into your current workspace, but this is not necessary.
    • You can activate the "Import all existing projects after clone finishes" now to import ALL projects, or you can manually import them afterwards to be a bit more selective.
  • Click "Finish". The Git repository will be cloned now. This will probably take a few minutes.
  • Switch to the "Plug-in Development" perspective.
  • To import the projects into the workspace (if not done automatically):
    • Open "File" -> "Import ..." and select "Git"/"Projects from Git". Click "Next" and select "Existing local repository". Click "Next" and select "org.eclipse.smila.core - ...". Click "Next".
    • Select "Import existing projects" and "core" in the tree below, and click "Next". Make sure all projects are selected and click "Finish".
  • After a while a "Problem occurred" dialog will open and there will be lots of compile errors. This is OK, we will fix this now.


Defining the target platform

The target platform defines the set of bundles and features that you are developing against. SMILA ships a Target Definition File that you can open in your IDE to configure the target platform automatically. This file contains all the references needed for developing SMILA with Eclipse Luna (Release 4.4.1).

Using the target platform provided by SMILA

  • Import project "SMILA.devenv" from the "releng" directory of your local Git repository (same procedure as for importing the other projects).
  • Open the file SMILA.devenv/SMILA.target with the Target Definition editor.
    Eclipse starts downloading the referenced bundles/features which it tells you by stating "Resolving Target Definition" in its status bar. Be patient, this will take a while. After it has finished, you can click the link "Set as Target Platform" on the top right of the Target Definition editor. Doing so will cause Eclipse to start re-compiling the sources and all error markers should be gone when finished.

Defining the target platform manually

Launching SMILA in Eclipse IDE

If you've checked out SMILA's trunk correctly, you should have a project called SMILA.launch in your workspace. This project contains the SMILA's launch configuration for Eclipse IDE. To start SMILA directly in your Eclipse IDE, just follow the steps below:

  • Click Run--> Debug Configurations and expand OSGI Framework.
  • Select the SMILA launch file.
  • Click Debug.
    If everything works fine, you will get an output in the Console view similar to the following:
osgi> Persistence bundle starting...
ProviderTracker: New service detected...
ProviderTracker: Added service org.eclipse.persistence.jpa.osgi.PersistenceProviderOSGi
Persistence bundle started.
[INFO ] Context /zookeeper: Registered handler(1) ZooKeeperAdminHandler, pattern /(.*)$
[INFO ] Added worker webFetcher to WorkerManager.
...
[INFO ] HTTP server has SMILA handler RequestDispatcher for context /smila.
[INFO ] HTTP server started successfully on port 8080.

You're done

Congratulations! You've just successfully checked out and configured your SMILA development environment and you can now start developing your own bundles.

Additional steps

The following steps may be needed for special purposes. If you are a SMILA user who only wants to integrate an own component you won't need them.

Checkstyle configuration

If you have the Eclipse Checkstyle plugin installed, you will get a lot of error messages complaining about missing check configurations when Eclipse builds the workspace.

Errors running builder 'Checkstyle Builder' on project 'org.eclipse.smila.utils'.
Fileset from project "org.eclipse.smila.utils" has no valid check configuration.
...

You can solve this by setup your Checkstyle configuration.

Setting up the Eclipse build

See SMILA/Documentation/HowTo/Howto_build_a_SMILA-Distribution for details on how to setup a build for SMILA.

Add examples projects

The examples directory of the repository contains three simple bundles that demonstrate how to develop SMILA pipelets and workers. You can import them to your workspace just like the other projects.

Enabling the BPEL Designer

If you want to work with the SMILA extensions for Eclipse BPEL designer, you need to clone the Git repository at http://git.eclipse.org/gitroot/smila/org.eclipse.smila.tooling.git (or git://... or ssh://...). Currently, the required bundles are:

  • org.eclipse.smila.processing.designer.model
  • org.eclipse.smila.processing.designer.ui

To compile them you need additional bundles from the Eclipse BPEL Designer in your target platform. See SMILA/BPEL Designer for more information.

Back to the top