You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2017/12/28 13:19:37 UTC

[4/7] isis-site git commit: ISIS-1748: updates simpleapp and helloworld to run under Eclipse.

http://git-wip-us.apache.org/repos/asf/isis-site/blob/c54442e1/content/guides/dg/dg.html
----------------------------------------------------------------------
diff --git a/content/guides/dg/dg.html b/content/guides/dg/dg.html
index ca10dcd..49f782c 100644
--- a/content/guides/dg/dg.html
+++ b/content/guides/dg/dg.html
@@ -1408,26 +1408,13 @@ gradle -t --offline -b liveReload.gradle &amp;</code></pre>
           <p>If you are an <a href="http://www.eclipse.org">Eclipse</a> user, then we recommend you download the "Eclipse JEE package" configuration.</p> 
          </div> 
          <div class="paragraph"> 
-          <p>When running an Apache Isis application, it’s necessary to setup the development environment so that the Java bytecode can be enhanced by the <a href="http://www.datanucleus.org">DataNucleus</a> enhancer. If working in Eclipse, then JDO enhancement is most easily done by installing the <a href="http://www.datanucleus.org/products/datanucleus/jdo/guides/eclipse.html">DataNucleus' Eclipse plugin</a>. This hooks the bytecode enhancement of your domain objects into Eclipse’s normal incremental compilation.</p> 
+          <p>When running an Apache Isis application, it’s necessary to setup the development environment so that the Java bytecode can be enhanced by the <a href="http://www.datanucleus.org">DataNucleus</a> enhancer. If working in Eclipse, then JDO enhancement is most easily done by installing the <a href="http://www.datanucleus.org/products/accessplatform/jpa/tools.html#eclipse">DataNucleus' Eclipse plugin</a>. This hooks the bytecode enhancement of your domain objects into Eclipse’s normal incremental compilation.</p> 
          </div> 
          <div class="paragraph"> 
-          <p>This plugin needs to be configured for each of your domain modules (usually just one in any given app). The steps are therefore:</p> 
-         </div> 
-         <div class="ulist"> 
-          <ul> 
-           <li> <p>import the project into Eclipse</p> </li> 
-           <li> <p>configure the DataNucleus enhancer</p> </li> 
-           <li> <p>run the app from the <code>.launch</code> file</p> </li> 
-          </ul> 
-         </div> 
-         <div class="sect3"> 
-          <h4 id="__dg_ide_eclipse_screencast">2.2.1. Screencast</h4> 
-          <div class="paragraph"> 
-           <p>This <a href="https://www.youtube.com/watch?v=RgcYfjQ8yJA">screencast</a> shows how to import an Apache Isis maven-based application into Eclipse and configure to use with the JDO Objectstore.</p> 
-          </div> 
+          <p>This plugin needs to be configured for each of your domain modules (usually just one in any given app).</p> 
          </div> 
          <div class="sect3"> 
-          <h4 id="__dg_ide_eclipse_editor-templates">2.2.2. Editor Templates</h4> 
+          <h4 id="__dg_ide_eclipse_editor-templates">2.2.1. Editor Templates</h4> 
           <div class="paragraph"> 
            <p>We provide a set of editor templates. These are used to add new methods to existing classes. (These are equivalent to the <a href="../dg/dg.html#__dg_ide_intellij_live-templates">IntelliJ live templates</a>):</p> 
           </div> 
@@ -1443,13 +1430,90 @@ gradle -t --offline -b liveReload.gradle &amp;</code></pre>
           </div> 
          </div> 
          <div class="sect3"> 
-          <h4 id="__dg_ide_eclipse_importing-the-project">2.2.3. Importing the Project</h4> 
+          <h4 id="__dg_ide_eclipse_configure-lombok">2.2.2. Install Project Lombok</h4> 
+          <div class="paragraph"> 
+           <p>The <a href="ugfun.html#_ugfun_getting-started_simpleapp-archetype">SimpleApp archetype</a> uses <a href="http://projectlombok.org">Project Lombok</a> annotations (<code>@Getter</code> and <code>@Setter</code> and so on) to reduce the boilerplate. For Eclipse IDE this requires an <a href="https://projectlombok.org/setup/eclipse">installation step</a>:</p> 
+          </div> 
+          <div class="ulist"> 
+           <ul> 
+            <li> <p>Locate the <code>lombok.jar</code> jar file:</p> 
+             <div class="imageblock"> 
+              <div class="content"> 
+               <a class="image" href="images/eclipse/2017-oxygen/010-lombok-locate-jar.png"><img src="images/eclipse/2017-oxygen/010-lombok-locate-jar.png" alt="010 lombok locate jar" width="600px"></a> 
+              </div> 
+             </div> </li> 
+            <li> <p>Run using <code>java -jar</code> (or double click on Windows):</p> 
+             <div class="imageblock"> 
+              <div class="content"> 
+               <a class="image" href="images/eclipse/2017-oxygen/020-lombok-install-into-eclipse.png"><img src="images/eclipse/2017-oxygen/020-lombok-install-into-eclipse.png" alt="020 lombok install into eclipse" width="600px"></a> 
+              </div> 
+             </div> </li> 
+           </ul> 
+          </div> 
+          <div class="paragraph"> 
+           <p>Then restart Eclipse.</p> 
+          </div> 
+         </div> 
+         <div class="sect3"> 
+          <h4 id="__dg_ide_eclipse_install-datanucleus-plugin">2.2.3. Install the DataNucleus plugin</h4> 
+          <div class="paragraph"> 
+           <p>The DataNucleus plugin hooks into the Eclipse compiler and will automatically enhance the compiled class files:</p> 
+          </div> 
+          <div class="ulist"> 
+           <ul> 
+            <li> <p>Use Help &gt; Install New Software:</p> 
+             <div class="imageblock"> 
+              <div class="content"> 
+               <a class="image" href="images/eclipse/2017-oxygen/030-datanucleus-install-new-software.png"><img src="images/eclipse/2017-oxygen/030-datanucleus-install-new-software.png" alt="030 datanucleus install new software" width="600px"></a> 
+              </div> 
+             </div> </li> 
+            <li> <p>Specify the DataNucleus plugin repository:</p> 
+             <div class="imageblock"> 
+              <div class="content"> 
+               <a class="image" href="images/eclipse/2017-oxygen/040-datanucleus-specify-repository.png"><img src="images/eclipse/2017-oxygen/040-datanucleus-specify-repository.png" alt="040 datanucleus specify repository" width="400px"></a> 
+              </div> 
+             </div> </li> 
+            <li> <p>Select the plugin</p> 
+             <div class="imageblock"> 
+              <div class="content"> 
+               <a class="image" href="images/eclipse/2017-oxygen/050-datanucleus-select-plugin.png"><img src="images/eclipse/2017-oxygen/050-datanucleus-select-plugin.png" alt="050 datanucleus select plugin" width="600px"></a> 
+              </div> 
+             </div> </li> 
+            <li> <p>Press Next and Finish to complete the installation of the plugin</p> </li> 
+           </ul> 
+          </div> 
+          <div class="paragraph"> 
+           <p>Then restart Eclipse</p> 
+          </div> 
+         </div> 
+         <div class="sect3"> 
+          <h4 id="__dg_ide_eclipse_importing-the-project">2.2.4. Importing the Project</h4> 
           <div class="paragraph"> 
            <p>Use File &gt; Import, then Maven &gt; Existing Maven Projects.</p> 
           </div> 
+          <div class="paragraph"> 
+           <p>However, you will have some compile errors until you enable annotation processing, discussed below.</p> 
+          </div> 
+          <div class="sect4"> 
+           <h5 id="__dg_ide_eclipse_enable-annotation-processing">Enable Annotation Processing</h5> 
+           <div class="paragraph"> 
+            <p>Both DataNucleus and Project Lombok use annotation processors that must be enabled in Eclipse.</p> 
+           </div> 
+           <div class="paragraph"> 
+            <p>For each project, open its <em>Properties</em> page and then <em>Java Compiler &gt; Annotation Processing</em> to specify the generated source directory of <code>target/generated-sources/annotations</code>:</p> 
+           </div> 
+           <div class="imageblock"> 
+            <div class="content"> 
+             <a class="image" href="images/eclipse/2017-oxygen/060-enable-annotation-processor.png"><img src="images/eclipse/2017-oxygen/060-enable-annotation-processor.png" alt="060 enable annotation processor" width="600px"></a> 
+            </div> 
+           </div> 
+           <div class="paragraph"> 
+            <p>Eclipse should automatically add this directory as a source path; at this point all remaining compiler errors should disappear.</p> 
+           </div> 
+          </div> 
          </div> 
          <div class="sect3"> 
-          <h4 id="_add_datanucleus_support">2.2.4. Add DataNucleus support</h4> 
+          <h4 id="__dg_ide_eclipse_add-datanucleus-support">2.2.5. Configure DataNucleus</h4> 
           <div class="admonitionblock tip"> 
            <table> 
             <tbody>
@@ -1464,7 +1528,7 @@ gradle -t --offline -b liveReload.gradle &amp;</code></pre>
            </table> 
           </div> 
           <div class="paragraph"> 
-           <p>In Eclipse, for the <em>domain object model</em> project, first add DataNucleus support:</p> 
+           <p>In Eclipse, for the <em>domain object model</em> project(s), first add DataNucleus support:</p> 
           </div> 
           <div class="imageblock"> 
            <div class="content"> 
@@ -1556,7 +1620,7 @@ gradle -t --offline -b liveReload.gradle &amp;</code></pre>
           </div> 
          </div> 
          <div class="sect3"> 
-          <h4 id="_running_the_app">2.2.5. Running the App</h4> 
+          <h4 id="__dg_ide_eclipse_running-the-app">2.2.6. Running the App</h4> 
           <div class="paragraph"> 
            <p>The simpleapp archetype automatically provides a <code>.launch</code> configurations in the <code>webapp</code> module. You can therefore very simply run the application by right-clicking on one of these files, and choosing "Run As…" or "Debug As…".</p> 
           </div> 
@@ -1575,19 +1639,16 @@ gradle -t --offline -b liveReload.gradle &amp;</code></pre>
           </div> 
          </div> 
          <div class="sect3"> 
-          <h4 id="_other_domain_projects">2.2.6. Other domain projects.</h4> 
+          <h4 id="_other_domain_projects">2.2.7. Other domain projects.</h4> 
           <div class="paragraph"> 
            <p>There is nothing to prevent you having multiple domain projects. You might want to do such that each domain project corresponds to a <a href="http://www.methodsandtools.com/archive/archive.php?id=97p2">DDD module</a>, thus guaranteeing that there are no cyclic dependencies between your modules.</p> 
           </div> 
           <div class="paragraph"> 
-           <p>If you do this, make sure that each project has its own <code>persistence.xml</code> file.</p> 
-          </div> 
-          <div class="paragraph"> 
-           <p>And, remember also to configure Eclipse’s DataNucleus plugin for these other domain projects.</p> 
+           <p>If you do this, make sure that each project has its own <code>persistence.xml</code> file. And, remember also to configure Eclipse’s DataNucleus plugin for these other domain projects.</p> 
           </div> 
          </div> 
          <div class="sect3"> 
-          <h4 id="_advanced">2.2.7. Advanced</h4> 
+          <h4 id="_advanced">2.2.8. Advanced</h4> 
           <div class="paragraph"> 
            <p>In this section are a couple of options that will reduce the length of the change code/build/deploy/review feedback loop.</p> 
           </div>