Author: jawi
Date: Tue Jun 21 06:57:21 2016
New Revision: 1749454
URL: http://svn.apache.org/viewvc?rev=1749454&view=rev
Log:
ACE-596 - further improvements.
Modified:
ace/site/trunk/content/docs/setup-dev-environment.mdtext
Modified: ace/site/trunk/content/docs/setup-dev-environment.mdtext
URL:
http://svn.apache.org/viewvc/ace/site/trunk/content/docs/setup-dev-environment.mdtext?rev=1749454&r1=1749453&r2=1749454&view=diff
==============================================================================
--- ace/site/trunk/content/docs/setup-dev-environment.mdtext (original)
+++ ace/site/trunk/content/docs/setup-dev-environment.mdtext Tue Jun 21
06:57:21 2016
@@ -13,8 +13,8 @@ Point your browser to the [ACE download
On that page you will find, amongst others, a link to the latest released
sources, plus an
archive containing all binary third-party dependencies. The page will
automatically select
-a download mirror close to you. Download *both* the source and dependencies
archive and then
-type:
+a download mirror close to you. Download *both* the source and dependencies
archive and
+then type:
:::sh
$ unzip apache-ace-2.1.0-src.zip
@@ -26,7 +26,8 @@ both archives. It is fine to overwriting
### Checkout from subversion
-Alternatively, you can check out the sources directly from the main Apache
source repositories:
+Alternatively, you can check out the sources directly from the main Apache
source
+repositories:
:::sh
$ svn co http://svn.apache.org/repos/asf/ace/trunk apache-ace
@@ -36,15 +37,16 @@ or
:::sh
$ git clone git://git.apache.org/ace apache-ace
-In both cases you end up with a copy of the source code.
+In both cases you end up with a copy of the source code. *Note: committers
should always
+use Subversion as the Git mirror is read-only.*
## Building the sources
There are two ways to build the sources. You can either run a command line
build or use
-Eclipse with the [Bndtools plugin](http://bndtools.org/) to build everything.
If you want to
-actively start developing, we strongly recommend you use Eclipse with Bndtools
as this is
-by far the most convenient way to build and run Apache ACE.
+Eclipse with the [Bndtools plugin](http://bndtools.org/) to build everything.
If you want
+to actively start developing, we strongly recommend you use Eclipse with
Bndtools as this
+is by far the most convenient way to build and run Apache ACE.
### Eclipse with Bndtools
@@ -52,26 +54,30 @@ by far the most convenient way to build
For developing ACE using Eclipse, you need:
-* A recent Java JDK, at least [Java
8](http://www.oracle.com/technetwork/indexes/downloads/index.html);
-* A recent Eclipse, for example, [Eclipse
Mars](http://www.eclipse.org/downloads/) with the following plugins:
- *
[Subclipse](http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA);
- * [BndTools](http://bndtools.org/installation.html);
- * [TestNG](http://testng.org/doc/download.html).
+* A recent Java JDK, at least [Java
+ 8](http://www.oracle.com/technetwork/indexes/downloads/index.html);
+* A recent Eclipse, for example, [Eclipse
Mars](http://www.eclipse.org/downloads/) with
+ the following plugins:
+ *
[Subclipse](http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA);
+ * [BndTools](http://bndtools.org/installation.html);
+ * [TestNG](http://testng.org/doc/download.html).
For building or exporting the compiled artifacts of ACE without Eclipse, you
can use the
Gradle wrapper script that is available in the source repository.
#### Eclipse set up
-When firing up Eclipse, make sure to either create a new workspace and check
out the
-sources according to the instructions below, or choose the root folder where
you have
-previously checked out or extracted your sources. This is important, as
otherwise
-Bndtools will not function correctly.
+Start Eclipse with a new, empty, workspace. To set up the projects you can do
either:
+
+1. if you use the *same* root folder/directory in which your ACE sources are
checked out
+ (or extracted) as your Eclipse workspace, you can import the projects
directly using
+ "File -> Import... -> General -> Existing Projects into Workspace";
+2. checkout the sources from Subversion as described below.
##### Checking out the latest sources
-If you created a new workspace above, you need to grab the latest sources from
ACE's
-subversion repository. To do this, open up the "SVN Repository Exploring"
perspective, and
+If you created a new and empty workspace, you need to grab the latest sources
from ACE's
+Subversion repository. To do this, open up the "SVN Repository Exploring"
perspective, and
add the following URL as new SVN repository using the yellow add-icon in the
"SVN
Repositories" view:
@@ -79,24 +85,16 @@ Repositories" view:
After this, expand the newly created tree node named after the SVN URL, and
select all
**individual** projects underneath. *Note: do **not** (only) select the root
node or the
-files that reside underneath the root node, as this won't let you properly
import the
+files that reside underneath the root node, as this won't let you properly
import the
individual projects.*
-Right click on the selected (sub)projects, and choose "Checkoutâ¦" from the
context menu.
+Right click on the selected (sub)projects, and choose "Checkout..." from the
context menu.
Leave all default settings as-is and click "finish". Now relax and wait until
the checkout
is completed, and all projects are imported into your workspace.
Switching back to the "Bndtools" perspective should give you a long list of
imported
projects.
-##### Importing existing projects
-
-If you created a workspace in a folder that already contained the sources, you
need to
-import these projects into the workspace. From the main menu in Eclipse,
choose: "File
--> Import..." and then select "General -> Existing projects into
workspace..." and
-select your workspace folder. A list of projects should show up now. Import
them all, wait
-until Eclipse has built the project and you're ready to start.
-
##### Coding guidelines
If you want to develop for ACE, you might want to import the code templates
and formatter
@@ -108,55 +106,77 @@ import it into Eclipse as your default f
One of the benefits of the migration to BndTools is that we can now directly
run ACE from
Eclipse with almost zero effort. In fact, it is even possible to directly
debug or profile
ACE from Eclipse. By convention, all runnable projects start with "run-" and
contain a
-".bndrun" file.
-To start a project, right-click the "bndrun" file and select "Run As" ->
"Bnd OSGi Run
+".bndrun" file.
+
+To start a project, right-click the "bndrun" file and select "Run As" ->
"Bnd OSGi Run
Launcher" or "Debug As" -> "Bnd OSGi Run Launcher".
There are several projects that can be run which we outline in the next
sections.
-##### ACE target
+##### run-develop
+
+This project allows you to directly start an ACE target that receives software
from the
+ACE server. By default, the target is started with a Gogo shell to allow you
to interact
+with it, making it easy to debug or troubleshoot it. *Note: since the Gogo
bundles are
+already installed, do **not** provision them using ACE! The deployment will
fail.*
+
+To run or debug the ACE server, use the "<tt>develop.bndrun</tt>" file in the
+"run-develop" project.
+
+##### run-target
-This project allows you to directly start an ACE target that receives software
from the ACE
-server. By default, the target is started with a Gogo shell to allow you to
interact with it.
+This project allows you to directly start an ACE target that receives software
from the
+ACE server. In contrast to the "run-develop" project, this target does only
start an ACE
+management agent and nothing else.
-To run or debug the ACE server, use the "<tt>target.bndrun</tt>" file in the
-"run-target" project.
+To run or debug the ACE server, use the "<tt>target.bndrun</tt>" file in the
"run-target"
+project.
-##### ACE server
+##### run-server
-This project allows you to start a plain ACE server *without* an OBR and
(web)client.
-Its endpoints can be reached on port <tt>8080</tt>. The server expects an OBR
to be
-available at the same host on port <tt>8082</tt>.
+This project allows you to start a plain ACE server *without* an OBR and
(web)client. Its
+endpoints can be reached on port <tt>8080</tt>. The server expects an OBR to
be available
+at the same host on port <tt>8082</tt>.
-To run or debug the ACE server, use the "<tt>server.bndrun</tt>" file in the
-"run-server" project.
+To run or debug the ACE server, use the "<tt>server.bndrun</tt>" file in the
"run-server"
+project.
-##### ACE OBR
+##### run-obr
-This will start an OBR for your artifacts. By default, its endpoints can be
reached through
-port <tt>8082</tt>.
+This will start an OBR for your artifacts. By default, its endpoints can be
reached
+through port <tt>8082</tt>.
-To run or debug the ACE OBR, use the "<tt>obr.bndrun</tt>" file in the
"run-obr"
+To run or debug the ACE OBR, use the "<tt>obr.bndrun</tt>" file in the
"run-obr" project.
+
+##### run-client
+
+This project allows you to start the web-based client. The web UI can be
reached by
+opening [localhost:8081/](http://localhost:8081/) in your browser. The ACE
client expects
+a (plain) ACE server to be available on the same host through port
<tt>8080</tt> and an
+ACE OBR to be available on the same on port <tt>8082</tt>.
+
+To run or debug the ACE client, use the "<tt>client.bndrun</tt>" file in the
"run-client"
project.
-##### ACE client
+##### run-server-allinone
-This project allows you to start the web-based client. The web UI can be
reached by opening
-[localhost:8081/](http://localhost:8081/) in your browser. The ACE client
expects a (plain) ACE
-server to be available on the same host through port <tt>8080</tt> and an ACE
OBR to be
-available on the same on port <tt>8082</tt>.
+In case you just want to start everything in one go, you can use the
"all-in-one" server.
+This starts the ACE server, OBR and web-based client and allows you to reach
all endpoints
+through port <tt>8080</tt>.
-To run or debug the ACE client, use the "<tt>client.bndrun</tt>" file in the
-"run-client" project.
+To run or debug the "all in one" ACE server, use the
"<tt>server-allinone.bndrun</tt>"
+file in the "run-server-allinone" project.
-##### ACE server-allinone
+##### run-relay
-In case you just want to start everything in one go, you can use the
"all-in-one" server. This
-starts the ACE server, OBR and web-based client and allows you to reach all
endpoints through
-port <tt>8080</tt>.
+This project allows you to start a relay server that you can use to distribute
the load
+from your main ACE server. Instead of all clients talking directly to one ACE
server, you
+can let clients talk to one or more relay servers. The default relay
configuration expects
+an ACE server to run at port <tt>8080</tt> and an OBR to run at port
<tt>8082</tt>. Its
+endpoints are reacheable through port <tt>8282</tt>.
-To run or debug the "all in one" ACE server, use the
-"<tt>server-allinone.bndrun</tt>" file in the "run-server-allinone" project.
+To run or debug the relay server, use the "<tt>relay.bndrun</tt>" file in the
"run-relay"
+project.
##### Unit tests
@@ -170,6 +190,7 @@ named with a '<tt>.itest</tt>' suffix. T
framework up and running. To run one or all integration tests, use "Run As
-> Bnd OSGi
Test Launcher (JUnit)" or "Debug As -> Bnd OSGi Test Launcher (JUnit)".
+
### Command line build
The command line build for Apache ACE is based on [Gradle](http://gradle.org/).
@@ -177,25 +198,34 @@ The command line build for Apache ACE is
The build is structured as a flat hierarchy of projects, and you can go into
any of these
projects to build just that project and its dependencies. There are two
special projects:
-1. `cnf` -- Which is collection of repositories that contain all the required
dependencies for building and running Apache ACE;
-2. `build` -- A project that contains the necessary scripts and tools to do
source and binary releases.
+1. `cnf` -- Which is collection of repositories and configuration files that
contain all
+ the required dependencies for building and running Apache ACE;
+2. `build` -- A project that contains the necessary scripts and tools to do
source and
+ binary releases.
So, to build Apache ACE, we issue the following command:
:::sh
$ ./gradlew build
-This will build everything, and run all unit and integration tests. In the
end, this leaves us with
-a set of bundles (in the <tt>generated</tt> folder of each individual project).
+This will build everything, and run all unit and integration tests. In the
end, this
+leaves us with a set of bundles (in the <tt>generated</tt> folder of each
individual
+project).
-The following targets are available:
+The following targets are available (there actually are a few more, use the
<tt>tasks</tt>
+target for that, but these are the most important ones):
-* <tt>clean</tt> -- Cleans up any files in the current project that were
generated during a build;
+* <tt>clean</tt> -- Cleans up any files and artifacts in the current projects
that were
+ generated during a build;
* <tt>build</tt> -- Build the current project;
-* <tt>rat</tt> -- Run the release audit tool that reports any license
violations, such as incompatible licenses or missing license headers;
-* <tt>export</tt> -- Exports all "bndrun" files into runnable JAR files in
<tt>generated/distributions/executable</tt> of each "runnable" project.
-
-There actually are a few more (use the <tt>tasks</tt> target for that), but
these are the most important ones.
+* <tt>rat</tt> -- Run the release audit tool that reports any license
violations, such as
+ incompatible licenses or missing license headers;
+* <tt>export</tt> -- Exports all "bndrun" files into runnable JAR files in
+ <tt>generated/distributions/executable</tt> of each "runnable" project.
+
+You can prefix these task names with the `<project-name>:` to execute them for
a single
+project. For example, `run-target:export` would create the runnable JAR file
for the
+<tt>run-target</tt> project only.
## How to...
@@ -203,30 +233,28 @@ There actually are a few more (use the <
Unfortunately, the easy answer is "no". Until somebody ports Bndtools to your
favorite
IDE, you either have to use Eclipse, or a combination of your IDE and manual
builds using
-Ant (though not recommended). If you insist, please do make sure you manually
generate the
-proper metadata for Eclipse.
+Gradle (though not recommended).
### ...build this thing in Eclipse?
Normally, you don't. Seriously. If "Build Automatically" is enabled, as soon
as you hit
-save after changing a line of code, BndTools will automatically build your
bundle for you.
-In fact, if your server if already running, Bndtools will even redeploy all
changed
-bundles to it automatically.
+save after changing a line of code, Bndtools will automatically build your
bundle(s) for
+you. In fact, if any project is already running, Bndtools will even redeploy
all changed
+bundles to it automatically allowing you to directly test your changes at
runtime.
### ...get rid of all those red crosses in Eclipse?
If Eclipse complaints about missing test libraries, you probably forgot to
install the
TestNG plugin. If this plugin is installed, it will automatically cause your
projects to
get the required dependency to the TestNG library. Without this plugin,
Eclipse won't have
-the required library and fails to compile the code correctly.
-In case you are importing the projects into Eclipse for the first time, it
takes a while
-and a couple of builds to get rid of all build errors. If the problem does
*not* go away,
-please drop a line on the [mailing lists](/get-involved/mailing-lists.html) to
get
-additional help.
+the required library and fails to compile the code correctly. In case you are
importing
+the projects into Eclipse for the first time, it takes a while and a couple of
builds to
+get rid of all build errors. If the problem does *not* go away, please drop a
line on the
+[mailing lists](/get-involved/mailing-lists.html) to get additional help.
### ...add an OSGi bundle
-The easiest way to add an OSGi bundle, is to drag it onto the "Local
Repository" entry in
+The easiest way to add an OSGi bundle, is to drag it onto the "Local"
repository entry in
the "Repositories" view, or to use the "Add files to repository" toolbar icon.
Bndtools
will analyze the files you try to add and show their metadata if they're
indeed valid
bundles.
@@ -241,10 +269,11 @@ within Apache ACE. If your library does
"...add an OSGi bundle" instructions above.
1. Copy the library to the right location. The jar file for the library should
be copied
-to the following location: <tt>cnf/lib/foo/foo-1.0.0.jar</tt>. Note that the
directory
-name should be equal to the basename of the added JAR file, that is,
everything *before*
-the version-string of the JAR;
+ to the following location: <tt>cnf/lib/foo/foo-1.0.0.jar</tt>. Note that
the directory
+ name should be equal to the basename of the added JAR file, that is,
everything
+ *before* the version-string of the JAR;
2. Refresh the repositories in Bnd by invoking "Bndtools -> Refresh
Repositories".
-Your library should be now available "Repositories" view and can be used
normally in
-any OSGi project.
+Your library should be now available "Repositories" view and can be used
normally in any
+OSGi project.
+