This document explains how to consume target platforms in Eclipse.
A target platform, in abstract terms, is a set of external dependencies that your features, plugins, and tests will use and on which their development and installation will depend. For JBoss Tools, these dependencies come from various Eclipse.org projects and other providers. Our target platforms can be used inside Eclipse to:
-
provide the right set of dependencies with which to debug, test, and develop;
-
provide the right set of dependencies at build time; and
-
provide a site containing all dependencies to end-users at install time.
In concrete terms, a target platform can take two forms: a target platform definition file
and a target platform update site
.
A target platform definition file
is a custom Eclipse file, with a .target
suffix, for use by Eclipse’s Plug-in Development Environment (PDE) tools. The file lists the versions of installable units (IUs) to be used as dependencies, as well as the repositories from which those dependencies can be found. The contained IUs are generally features, but can also be invididual plugins.
A target platform update site
is the result of resolving
the target platform definition file, which is the process of downloading all the IUs, and thier contained IUs, to one’s local disk. It includes the full set of jars for all dependencies our project may depend on, as well as the required Eclipse metadata to act as an update site. An update site, in Eclipse, is a mechanism used to install new (or update existing) software into Eclipse. Because of this, you could probably install the entire target platform into your Eclipse using such an update site.
See these slides for more about target platforms: http://www.slideshare.net/mickaelistria/a-journey-with-target-platforms.
JBoss Tools' target platform definition files
are stored in github:
JBoss Tools' target platform update sites
are located here, in both unpacked and packed (zipped) format. They do not contain sources or SDK features.
-
http://download.jboss.org/jbosstools/targetplatforms/ (SNAPSHOTS, milestones, and links to released versions)
Inside the JBoss Tools Target Platform repository, the two top level folders are jbdevstudio
and jbosstools
. Both of these folders contain two sub-folders: multiple
and unified
.
Multiple target platform definition files reference several different update sites, most of which are mirrors located on http://download.jboss.org/jbosstools/. Use this .target file in Eclipse, since it can include sources when built with the proper flags.
Unified target platform definition files are generated from the multiple ones, and are then used to produce the target platform update sites. As this file references only a single mirror, it is faster to use in Eclipse but cannot include sources, since it points at the generated target platform update site, which does not include sources. If you are a developer or adopter, do not choose this definition file - it should only used by end-users at installation time.
JBoss Tools uses a well-defined versioning scheme for our target platforms.
The first 3 digits are the version of Eclipse included in the target platform, such as 4.41 (Luna SR1) or 4.50 (Mars R).
The next digit signifies the sequence of target platforms, starting with 0. Should there be multiple JBoss Tools releases on the same Eclipse version, this allows us to have different target platforms using the same baseline, such as 4.42.0, 4.42.1, 4.42.2.
After that, the milestone of JBoss Tools that uses the target platform is suffixed, which also defines the quality/stability of the target platform (Alpha1, Alpha2, Beta1, Beta2, CR1, Final).
Finally, the target platform version will have a -SNAPSHOT
suffix if it has not yet been released to Nexus. Once released, the -SNAPSHOT
suffix is removed. For .Final versions, the bits are moved to mirrored to the Akamai /static/ folder for better performance.
Normally, each project uses a parent pom that will default to the right target platform, but in case you need to update to, or test against, a different target platform, this section will be useful for you.
In general, we use the latest target platform for the version of Eclipse your development environment requires. For example, if you are building code for Mars, use a 4.50.x target platform. If building for Luna SR1 or SR2, use a 4.41.x or 4.42.x target platform.
If you use the latest parent pom, chances are good you’ll automatically build with the latest appropriate target platform too.
However, this will default to use the latest minimum target platform based on the initial R release of the annual Eclipse release train, not the SR1 or SR2 updates. To quickly switch to building with the latest maximum target platform (eg., the SR2 version), use this profile:
mvn install -P maximum
Should you want to build using a specific target platform, perhaps because you’re testing a new, unreleased one, you could build like this:
mvn install -Dtpc.version=4.50.0.Beta1-SNAPSHOT
There are several different options you can use when attempting to configure your Eclipse workspace with a target platform. Each method has its own advantages and disadvantages.
Method | Advantages/Disadvantages | Steps | ||
---|---|---|---|---|
Import target platform zip |
But…
|
|
||
Import .target file |
But…
|
git clone https://github.com/jbosstools/jbosstools-target-platforms.git
cd jbosstools-target-platforms
git checkout 4.50.x
|
||
Build target platform |
But…
|
git clone https://github.com/jbosstools/jbosstools-target-platforms.git
cd jbosstools-target-platforms
git checkout 4.50.x
mvn clean install -Pmultiple2repo
mvn clean install -Pmultiple2repo -Dmirror-target-to-repo.includeSources=true
Next:
|
Up until this point, we’ve only been referencing using a target platform in eclipse to resolve dependencies. When simply using a target platform, it is not 'installed' into your eclipse, but rather all the units are stored locally and then resolved and referenced for compilation and run-time resolution.
Under some circumstances, users may wish to actually install the target platform (or some subset of it) into their running eclipse installation. This is very useful when testing local builds, for example.
With this in mind, if you have a local copy of the target platform unzipped on your disk, or if you wish to simply install from our web urls, you can perform the following to install it into your actual eclipse application:
-
Select
Window → Install New Software
-
Click
Add…
-
Provide a name
-
Browse to the location of your local target platform, or paste a target platform URL such as http://download.jboss.org/jbosstools/targetplatforms/jbosstoolstarget/4.50.0.Alpha1-SNAPSHOT/
-
Uncheck
Group item by category
-
Click
Select All
-
Click
Next>
and continue until you canFinish
-
Install all of the items.
If this is a task you intend to perform often, you will find it very useful to have a local target platform folder, rather than continuously download and install from a remote location.
After installing the target platform, you should restart your eclipse. You will find you have all dependencies locally installed and running, rather than being used only for plug-in dependency resolution.
JBoss Tools modules use Maven to build and are configured to consume the latest target platform from Nexus, based on what’s set in the parent pom.
If you want to use a newer version, simply build with mvn verify -Dtpc.version=4.42.1.Final
.