You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2016/11/28 22:28:06 UTC

svn commit: r1771822 - /sling/site/trunk/content/documentation/development/getting-and-building-sling.mdtext

Author: rombert
Date: Mon Nov 28 22:28:05 2016
New Revision: 1771822

URL: http://svn.apache.org/viewvc?rev=1771822&view=rev
Log:
Refresh instructions for building Sling

The instructions now focus on building just the launchpad and a module, as
opposed to the full reactor. Instructions to setting MAVEN_OPTS have been
removed, as they are now picked up from .mvn/jvm.config .

Modified:
    sling/site/trunk/content/documentation/development/getting-and-building-sling.mdtext

Modified: sling/site/trunk/content/documentation/development/getting-and-building-sling.mdtext
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/development/getting-and-building-sling.mdtext?rev=1771822&r1=1771821&r2=1771822&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/development/getting-and-building-sling.mdtext (original)
+++ sling/site/trunk/content/documentation/development/getting-and-building-sling.mdtext Mon Nov 28 22:28:05 2016
@@ -7,23 +7,20 @@ Note that you don't *have* to build Slin
 binaries from the [Downloads](/downloads.cgi) page. But those, especially the launchpad runnable jar, are not released often
 and can be outdated. In case of doubt, build it yourself as shown below or ask on the Sling users mailing list.
 
-A full build of Sling takes 5-10 minutes on a recent computer once your local Maven repository is up to date. The first build 
-may take much longer than that if you start with an empty local Maven repository, as Maven will then download its plugins and 
-all the required dependencies.
+Rather than performing a full build of Sling, which can take 5-10 minutes on a recent computer once your local Maven
+repository is up to date, it's recommended to build only the launchpad and the modules you're interested in.
 
 ## tl:dr - Short form build + run instructions 
 If you already have the required svn (or Git, see below) client, JDK and Maven installed, here's the short form recipe:
 
-    $ svn co http://svn.apache.org/repos/asf/sling/trunk sling
-    $ cd sling
-    $ export MAVEN_OPTS= # (see below)
-    $ mvn clean install # (maybe with -DskipTests if you know what you're doing)
+    $ svn co http://svn.apache.org/repos/asf/sling/trunk sling 
+    $ cd sling  # you are now in the Sling SVN checkout
     $ cd launchpad/builder
-    $ rm -rf ../builder/sling # (if needed, to cleanup previous state)
-    $ export DBG="-Xmx384M -agentlib:jdwp..." # (see below) 
+    $ mvn --update-snapshots clean install
+    $ export DBG="-Xmx384M -agentlib:jdwp..." # (see below)
     $ java $DBG -jar target/org.apache.sling.launchpad... # (see below)
     
-With this, Sling should be running at http://localhost:8080 with remote debugging active as per the $DBG variable.      
+With this, Sling should be running at http://localhost:8080 with remote debugging active as per the $DBG variable.
 
 ## Prerequisites
 
@@ -42,25 +39,6 @@ If you want to set up Eclipse (not requi
 
 The full build process requires quite a lot of resources, so you may run into limits. The following hints should show you what to setup before building Sling.
 
-### Java Heap Space
-
-* *Problem* \- Build aborts with reports of `java.lang.OutOfMemoryError: Java heap space`. Alternatively the build may randomly fail during the integration tests.
-* *Platforms* \- This happens on all platforms
-* *Fix* \- Increase the values of the maximum heap and perm space for the build by setting or extending the `MAVEN_OPTS` environment variable.
-
-For 32bit platforms you should use
-
-    MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=256m"
-
-
-For 64bit platforms, you should use
-
-    MAVEN_OPTS="-Xmx512M -XX:MaxPermSize=512m"
-
-
-For more information see [SLING-443](https://issues.apache.org/jira/browse/SLING-443) and [SLING-1782](https://issues.apache.org/jira/browse/SLING-1782).
-
-
 ### Environment Variable Space
 
 * *Problem* \- Build aborts when trying to launch the integration tests with the message
@@ -134,23 +112,19 @@ Possibly something in sling-builder migh
 
 ## Building Sling
 
+Note that while it's possible to build the full Sling reactor, using the pom.xml file in the root of the SVN checkout, this should
+rarely be needed and it's almost always too slow to consider. Instead, it's recommended to build the Sling launchpad and the module
+you're working on at the moment.
 
 ### With the Maven command line tool
 
-1. Enter the directory, then do a full build and local install (below are unix/linux commands, slightly different under windows)
+1. Enter the directory, then do a build and local install of the launchpad (below are unix/linux commands, slightly different under windows)
 
     $ cd sling
-    $ export MAVEN_OPTS="-Xmx256m -XX:MaxPermSize=128m"
-    $ mvn -s /dev/null clean install
-
-Note: On windows just leave out `/dev/null` and make sure you have an empty settings.xml file for maven (located in your user directory under .m2).
-
-1. Enter the `launchpad/builder` directory and launch Sling for the first time
-
-    $ cd launchpad/builder
+    $ cd launchpad/builder # you are now in the Sling SVN checkout
+    $ mvn --update-snapshots clean install
     $ java -jar target/org.apache.sling.launchpad-*.jar -c test -f -
 
-
 <div class="note">
 When starting Sling inside the `launchpad/builder` folder you should not use the default Sling Home folder name `sling` because this folder is removed when running `mvn clean`.
 </div>
@@ -165,6 +139,17 @@ After all messages have been printed you
 
 To stop Sling, just hit `Ctrl-C` in the console or click the *Stop* button on the *System Information* page of the Sling Management Console.
 
+1. Enter the directory of the bundle you're working on, then do a build and deploy the bundle to the running launchpad instance
+
+    $ cd sling
+    $ cd bundles/servlets/get
+    $ mvn clean install sling:install
+
+The Maven build command ensure that:
+
+* the bundle is installed in the local repository so future builds of the launchpad module will pick it up ( `install` goal )
+* the bundle is deployed in the running launchpad instance ( `sling:install` goal )
+
 ### With M2Eclipse
 
 1. Make sure you're in the Java perspective (Menu: Window->Open Perspective)