content/versions/1.11.0/guides/cgcon.html (5,476 lines of code) (raw):

<!doctype html> <html class="no-js" lang="en"> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>Contributors Guide</title> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- No caching headers --> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="-1" /> <!-- TODO: need to (re)instate CDN in the future (not using for now just so can develop off-line --> <link href="../css/foundation/5.5.1/foundation.css" rel="stylesheet" /> <script src="../js/foundation/5.5.1/vendor/modernizr.js"></script> <link href="../css/asciidoctor/colony.css" rel="stylesheet"> <link href="../css/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"> <link href="../css/github-fork-ribbon-css/0.1.1/gh-fork-ribbon.css" rel="stylesheet" /> <!--[if lt IE 9]> <link href="../css/github-fork-ribbon-css/0.1.1/gh-fork-ribbon.ie.css" rel="stylesheet" /> <![endif]--> <style type="text/css"> pre code { background-color: inherit; border-style: none; } pre code > span:first-child { margin-left: -5px; } <style> <!-- <style type="text/css"> /* Stylesheet for CodeRay to match GitHub theme | MIT License | http://foundation.zurb.com */ /*pre.CodeRay {background-color:#f7f7f8;}*/ .CodeRay .line-numbers{border-right:1px solid #d8d8d8;padding:0 0.5em 0 .25em} .CodeRay span.line-numbers{display:inline-block;margin-right:.5em;color:rgba(0,0,0,.3)} .CodeRay .line-numbers strong{font-weight: normal} table.CodeRay{border-collapse:separate;border-spacing:0;margin-bottom:0;border:0;background:none} table.CodeRay td{vertical-align: top} table.CodeRay td.line-numbers{text-align:right} table.CodeRay td.line-numbers>pre{padding:0;color:rgba(0,0,0,.3)} table.CodeRay td.code{padding:0 0 0 .5em} table.CodeRay td.code>pre{padding:0} .CodeRay .debug{color:#fff !important;background:#000080 !important} .CodeRay .annotation{color:#007} .CodeRay .attribute-name{color:#000080} .CodeRay .attribute-value{color:#700} .CodeRay .binary{color:#509} .CodeRay .comment{color:#998;font-style:italic} .CodeRay .char{color:#04d} .CodeRay .char .content{color:#04d} .CodeRay .char .delimiter{color:#039} .CodeRay .class{color:#458;font-weight:bold} .CodeRay .complex{color:#a08} .CodeRay .constant,.CodeRay .predefined-constant{color:#008080} .CodeRay .color{color:#099} .CodeRay .class-variable{color:#369} .CodeRay .decorator{color:#b0b} .CodeRay .definition{color:#099} .CodeRay .delimiter{color:#000} .CodeRay .doc{color:#970} .CodeRay .doctype{color:#34b} .CodeRay .doc-string{color:#d42} .CodeRay .escape{color:#666} .CodeRay .entity{color:#800} .CodeRay .error{color:#808} .CodeRay .exception{color:inherit} .CodeRay .filename{color:#099} .CodeRay .function{color:#900;font-weight:bold} .CodeRay .global-variable{color:#008080} .CodeRay .hex{color:#058} .CodeRay .integer,.CodeRay .float{color:#099} .CodeRay .include{color:#555} .CodeRay .inline{color:#00} .CodeRay .inline .inline{background:#ccc} .CodeRay .inline .inline .inline{background:#bbb} .CodeRay .inline .inline-delimiter{color:#d14} .CodeRay .inline-delimiter{color:#d14} .CodeRay .important{color:#555;font-weight:bold} .CodeRay .interpreted{color:#b2b} .CodeRay .instance-variable{color:#008080} .CodeRay .label{color:#970} .CodeRay .local-variable{color:#963} .CodeRay .octal{color:#40e} .CodeRay .predefined{color:#369} .CodeRay .preprocessor{color:#579} .CodeRay .pseudo-class{color:#555} .CodeRay .directive{font-weight:bold} .CodeRay .type{font-weight:bold} .CodeRay .predefined-type{color:inherit} .CodeRay .reserved,.CodeRay .keyword {color:#000;font-weight:bold} .CodeRay .key{color:#808} .CodeRay .key .delimiter{color:#606} .CodeRay .key .char{color:#80f} .CodeRay .value{color:#088} .CodeRay .regexp .delimiter{color:#808} .CodeRay .regexp .content{color:#808} .CodeRay .regexp .modifier{color:#808} .CodeRay .regexp .char{color:#d14} .CodeRay .regexp .function{color:#404;font-weight:bold} .CodeRay .string{color:#d20} .CodeRay .string .string .string{background:#ffd0d0} .CodeRay .string .content{color:#d14} .CodeRay .string .char{color:#d14} .CodeRay .string .delimiter{color:#d14} .CodeRay .shell{color:#d14} .CodeRay .shell .delimiter{color:#d14} .CodeRay .symbol{color:#990073} .CodeRay .symbol .content{color:#a60} .CodeRay .symbol .delimiter{color:#630} .CodeRay .tag{color:#008080} .CodeRay .tag-special{color:#d70} .CodeRay .variable{color:#036} .CodeRay .insert{background:#afa} .CodeRay .delete{background:#faa} .CodeRay .change{color:#aaf;background:#007} .CodeRay .head{color:#f8f;background:#505} .CodeRay .insert .insert{color:#080} .CodeRay .delete .delete{color:#800} .CodeRay .change .change{color:#66f} .CodeRay .head .head{color:#f4f} pre.CodeRay code { background-color: inherit; border-style: none; } pre.CodeRay code > span:first-child { margin-left: -5px; } .literalblock pre, .listingblock pre:not(.highlight), .listingblock pre[class="highlight"], .listingblock pre[class^="highlight "], .listingblock pre.CodeRay, .listingblock pre.prettyprint { background: rgb(253, 250, 246); } .sidebarblock .literalblock pre, .sidebarblock .listingblock pre:not(.highlight), .sidebarblock .listingblock pre[class="highlight"], .sidebarblock .listingblock pre[class^="highlight "], .sidebarblock .listingblock pre.CodeRay, .sidebarblock .listingblock pre.prettyprint { background: rgb(253, 250, 246); } <style> --> <style> .github-fork-ribbon-wrapper.right { position: fixed; } .github-fork-ribbon { background: #090; } .github-fork-ribbon a:hover { background:#0D0; color:#fff; font-size: 1.1em; } </style> <style> @media only screen and (min-width: 40.063em) { .top-bar { .contain-to-grid .top-bar { max-width: 80rem; } } } .row { max-width: 80rem; } </style> <style> .extended-quote, .extended-quote-first { margin-left: 40px; margin-right: 40px; font-style: italic; } .extended-quote-attribution { text-align: right; margin-right: 100px; color: #10B061; } .extended-quote-first:before { content: "\201c"; float: left; font-size: 2.75em; font-weight: bold; line-height: 0.6em; margin-left: -0.6em; color: #003b6b; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); } </style> <style> body { position: relative; } *:not(pre) a > code { color: #210DDC; } *:not(pre) > code { background-color: inherit; border: none; font-weight: normal; } body div#toc li, body div#toc2 li { list-style-type: none; } div#doc-content { margin-top: 30px; } div.documentation-page table.frame-all { border-left: none; border-right: none; } body div#toc li.active-region:before, body div#toc2 li.active-region:before { content: "\00BB \0020"; margin-left: -12px; } body div#toc li a.active, body div#toc2 li a.active { color: red; } body div#toc.toc, body div#toc.toc2 { position: fixed; left: auto; padding-top: 60px; z-index: auto; background-color: white; border-left-color: #eee; border-left-style: solid; border-right: none; min-height: 2000px; } </style> <style> @media only screen and (min-width: 768px) { #toc.toc2 ul ul { margin-left: -10px; } } body div#toc .tocify-subheader ul { margin-bottom: 0px; } body div#toc .tocify-subheader li { font-size: 14px; } .tocify li.tocify-item, .tocify ul.tocify-item { line-height: 24px; } body div#toc li.tocify-item.active:before, body div#toc2 li.tocify-item.active:before { content: "\00BB \0020"; margin-left: -12px; } body div#toc li.tocify-item.active a, body div#toc2 li.tocify-item.active a { color: red; } </style> <style> footer { margin-top: 1000px; } </style> <style> /* overriding colony.css stylesheet */ .literalblock pre, .literalblock pre[class], .listingblock pre, .listingblock pre[class] { /*padding: 1.25em 1.5625em 1.125em 1.5625em;*/ padding: 0.3em 0.6em 0.25em 0.6em; } @media only screen and (min-width: 1280px) #toc.toc2 { /*width: 20em;*/ width: 25em; } #doc-content a { color: #210DDC; } .top-bar h1 { border-bottom: inherit; } h2 { margin-top: 80px; } h3 { margin-top: 40px; } h4,h5 { margin-top: 30px; } .admonitionblock.tip > table td.content { color: #10B061; } .admonitionblock.note > table td.content { color: #B509AB; } .admonitionblock.important > table td.content { color: #D5810A; } .admonitionblock .title { font-size: larger; font-style: italic; } .imageblock img { margin-bottom: 10px; } </style> <style> /* from http://ben.balter.com/2014/03/13/pages-anchor-links/ */ .header-link { position: absolute; left: -0.5em; opacity: 0; /* -webkit-transition: opacity 0.2s ease-in-out 0.1s; -moz-transition: opacity 0.2s ease-in-out 0.1s; -ms-transition: opacity 0.2s ease-in-out 0.1s; */ } h2:hover .header-link, h3:hover .header-link, h4:hover .header-link, h5:hover .header-link, h6:hover .header-link { opacity: 1; } </style> <style> .top-bar { -webkit-transition-duration: .5s; transition-duration: .5s; -webkit-transition-timing-function: cubic-bezier( 0.215, 0.610, 0.355, 1.000 ); transition-timing-function: cubic-bezier( 0.215, 0.610, 0.355, 1.000 ); -webkit-transition-property: -webkit-transform; transition-property: transform; } /* http://osvaldas.info/auto-hide-sticky-header MIT license */ .header--hidden { -webkit-transform: translateY( -100% ); -ms-transform: translateY( -100% ); transform: translateY( -100% ); transition-duration: .5s; transition-timing-function: cubic-bezier( 0.215, 0.610, 0.355, 1.000 ); -webkit-transition-property: -webkit-transform; transition-property: transform; } </style> <style> #doc-content a.guide { color: white; } </style> <style> .tocify { margin-top: 80px; } </style> </script> </head> <body> <<div class="github-fork-ribbon-wrapper right" style="position: fixed;"> <div class="github-fork-ribbon"> <a href="https://github.com/apache/isis/fork">Fork me on GitHub</a> </div> </div> <div class="row"> <div class="fixed contain-to-grid header"> <nav class="top-bar" data-topbar role="navigation" style="max-width: 80rem"> <ul class="title-area"> <li class="name"> <h1> <a href="/index.html">Apache Isis&trade;</a> </h1> </li> <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone --> <li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li> </ul> <section class="top-bar-section"> <ul class="right"> <li class="has-form"> <FORM class="searchbox navbar-form navbar-right" id="searchbox_012614087480249044419:dn-q5gtwxya" action="http://www.google.com/cse"> <div class="row collapse"> <input type="hidden" name="cx" value="012614087480249044419:dn-q5gtwxya"> <INPUT type="hidden" name="cof" value="FORID:0"> <INPUT class="form-control" name="q" type="text" placeholder="Search"> </div> </FORM> </li> </ul> <!-- Left Nav Section --> <ul class="left"> <li><a href="/documentation.html">Documentation</a></li> <li><a href="/downloads.html">Downloads</a></li> <li><a href="/help.html">Help</a></li> <li><a href="/asf.html">@ASF</a></li> </ul> </section> </nav> </div> </div> <div class="row"> <div id="doc-content-left" class="large-9 medium-9 columns"> <div id="doc-content"> <div class="sect1"> <h2 id="_cgcon">1. Contributors' Guide</h2> <div class="sectionbody"> <div class="paragraph"> <p>This contributors' guide is for:</p> </div> <div class="ulist"> <ul> <li> <p>programmers who want to just use Apache Isis to build applications, and want help setting up their development environment or to build their code from the command line (eg to execute within a continuous integration server such as Jenkins)</p> </li> <li> <p>programmers who want to contribute back patches (bug fixes, new features) either to the codebase or the framework&#8217;s documentation</p> </li> <li> <p>committers of Apache Isis itself who want guidance on release process, publishing documents and other related procedures.</p> </li> </ul> </div> <div class="sect2"> <h3 id="_other_guides">1.1. Other Guides</h3> <div class="paragraph"> <p>Apache Isis documentation is broken out into a number of user, reference and "supporting procedures" guides.</p> </div> <div class="paragraph"> <p>The user guides available are:</p> </div> <div class="ulist"> <ul> <li> <p><a href="ugfun.html">Fundamentals</a></p> </li> <li> <p><a href="ugvw.html">Wicket viewer</a></p> </li> <li> <p><a href="ugvro.html">Restful Objects viewer</a></p> </li> <li> <p><a href="ugsec.html">Security</a></p> </li> <li> <p><a href="ugtst.html">Testing</a></p> </li> <li> <p><a href="ugbtb.html">Beyond the Basics</a></p> </li> </ul> </div> <div class="paragraph"> <p>The reference guides are:</p> </div> <div class="ulist"> <ul> <li> <p><a href="rgant.html">Annotations</a></p> </li> <li> <p><a href="rgsvc.html">Domain Services</a></p> </li> <li> <p><a href="rgcfg.html">Configuration Properties</a></p> </li> <li> <p><a href="rgcms.html">Classes, Methods and Schema</a></p> </li> </ul> </div> <div class="paragraph"> <p>The "supporting procedures" guides are:</p> </div> <div class="ulist"> <ul> <li> <p><a href="#">Contributors' Guide</a> (this guide)</p> </li> <li> <p><a href="#">Committers' Guide</a> (release procedures and related practices)</p> </li> </ul> </div> </div> </div> </div> <div class="sect1"> <h2 id="_cgcon_ide">2. Using an IDE</h2> <div class="sectionbody"> <div class="paragraph"> <p>The vast majority of Java developers use an IDE to assist with developing their code, and we highly recommend that you do like wise as you develop your Apache Isis applications using an IDE. Apache Isis is built with Maven, and all modern IDEs can import Maven projects.</p> </div> <div class="paragraph"> <p>This chapter shows how to setup and use two of the most popular IDEs, IntelliJ IDEA and Eclipse.</p> </div> <div class="sect2"> <h3 id="_cgcon_ide_intellij">2.1. Developing using IntelliJ IDEA</h3> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> <div class="paragraph"> <p>This material does not constitute an endorsement; JetBrains is not affiliated to Apache Software Foundation in any way.</p> </div> </td> </tr> </table> </div> <div class="paragraph"> <p>This section describes how to install and setup JetBrains' IntelliJ IDEA, then how to import an application into IntelliJ and run it.</p> </div> <div class="sect3"> <h4 id="_installing_and_setting_up">2.1.1. Installing and Setting up</h4> <div class="paragraph"> <p>This section covers installation and setup. These notes relates to IntelliJ Community Edition 14.1.x, with screenshots taken for Windows.</p> </div> <div class="sect4"> <h5 id="_download_and_install">Download and Install</h5> <div class="paragraph"> <p><a href="https://www.jetbrains.com/idea/download/">Download</a> latest version of IntelliJ Community Edition, and install:</p> </div> <div class="paragraph"> <p>Start the wizard, click through the welcome page:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/010-installing/010-welcome-page.png" alt="010 welcome page" width="400px"> </div> <div class="title">Figure 1. IntelliJ Installation Wizard - Welcome page</div> </div> <div class="paragraph"> <p>Choose the location to install the IDE:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/010-installing/020-choose-location.png" alt="020 choose location" width="400px"> </div> <div class="title">Figure 2. IntelliJ Installation Wizard - Choose Location</div> </div> <div class="paragraph"> <p>Adjust any installation options as you prefer:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/010-installing/030-installation-options.png" alt="030 installation options" width="400px"> </div> <div class="title">Figure 3. IntelliJ Installation Wizard - Installation Options</div> </div> <div class="paragraph"> <p>and the start menu:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/010-installing/040-start-menu-folder.png" alt="040 start menu folder" width="400px"> </div> <div class="title">Figure 4. IntelliJ Installation Wizard - Start Menu Folder</div> </div> <div class="paragraph"> <p>and finish up the wizard:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/010-installing/050-completing.png" alt="050 completing" width="400px"> </div> <div class="title">Figure 5. IntelliJ Installation Wizard - Completing the Wizard</div> </div> <div class="paragraph"> <p>Later on we&#8217;ll specify the Apache Isis/ASF code style settings, so for now select <code>I do not want to import settings</code>:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/010-installing/060-import-settings-or-not.png" alt="060 import settings or not" width="400px"> </div> <div class="title">Figure 6. IntelliJ Installation Wizard - Import Settings</div> </div> <div class="paragraph"> <p>Finally, if you are young and trendy, set the UI theme to Darcula:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/010-installing/070-set-ui-theme.png" alt="070 set ui theme" width="600px"> </div> <div class="title">Figure 7. IntelliJ Installation Wizard Set UI Theme</div> </div> </div> <div class="sect4"> <h5 id="_new_project">New Project</h5> <div class="paragraph"> <p>In IntelliJ a project can contain multiple modules; these need not be physically located together. (If you are previously an Eclipse user, you can think of it as similar to an Eclipse workspace).</p> </div> <div class="paragraph"> <p>Start off by creating a new project:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/020-create-new-project/010-new-project-create.png" alt="010 new project create" width="400px"> </div> <div class="title">Figure 8. IntelliJ Create New Project</div> </div> <div class="paragraph"> <p>We want to create a new <strong>Java</strong> project:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/020-create-new-project/020-java-project-setup-jdk.png" alt="020 java project setup jdk" width="600px"> </div> <div class="title">Figure 9. IntelliJ Create New Project - Create a Java project</div> </div> <div class="paragraph"> <p>We therefore need to specify the JDK.</p> </div> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> at the time of writing Apache Isis supports only Java 7; Java 8 is scheduled for support in Apache Isis v1.9.0 </td> </tr> </table> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/020-create-new-project/030-java-project-select-jdk.png" alt="030 java project select jdk" width="300px"> </div> <div class="title">Figure 10. IntelliJ Create New Java Project - Select the JDK</div> </div> <div class="paragraph"> <p>Specify the directory containing the JDK:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/020-create-new-project/050-name-and-location.png" alt="050 name and location" width="400px"> </div> <div class="title">Figure 11. IntelliJ Create New Project - Select the JDK location</div> </div> <div class="paragraph"> <p>Finally allow IntelliJ to create the directory for the new project:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/020-create-new-project/060-create-dir.png" alt="060 create dir" width="200px"> </div> <div class="title">Figure 12. IntelliJ Create New Project</div> </div> </div> <div class="sect4"> <h5 id="_import_settings">Import Settings</h5> <div class="paragraph"> <p>Next we need to configure IntelliJ with ASF/Apache Isis' standard templates and coding conventions. These are bundled as the <code>settings.jar</code> JAR file <a href="resources/appendices/dev-env/intellij/isis-settings.jar">download from the Apache Isis website</a>).</p> </div> <div class="paragraph"> <p>Import using: <code>File &gt; Import Settings</code>, and specify the directory that you have downloaded the file to:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/030-import-settings/010-settings-import-jar.png" alt="010 settings import jar" width="400px"> </div> <div class="title">Figure 13. IntelliJ Import Settings - Specify JAR file</div> </div> <div class="paragraph"> <p>Select all the (two) categories of settings available in the JAR file:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/030-import-settings/020-select-all.png" alt="020 select all" width="300px"> </div> <div class="title">Figure 14. IntelliJ Import Settings - Select all categories</div> </div> <div class="paragraph"> <p>And then restart:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/030-import-settings/030-restart.png" alt="030 restart" width="200px"> </div> <div class="title">Figure 15. IntelliJ Import Settings - Restart</div> </div> </div> <div class="sect4"> <h5 id="_cgcon_ide_intellij_other-settings-compiler">Other Settings (Compiler)</h5> <div class="paragraph"> <p>There are also some other settings that influence the compiler. We highly recommend you set these.</p> </div> <div class="paragraph"> <p>On the <strong>Compiler</strong> Settings page, ensure that <code>build automatically</code> is enabled (and optionally <code>compile independent modules in parallel</code>):</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/040-other-settings-compiler/010-build-automatically.png" alt="010 build automatically" width="600px"> </div> <div class="title">Figure 16. IntelliJ Compiler Settings</div> </div> <div class="paragraph"> <p>On the <strong>Annotation Processors</strong> page, enable and adjust for the 'default' setting:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/040-other-settings-compiler/020-annotation-processor.png" alt="020 annotation processor" width="600px"> </div> <div class="title">Figure 17. IntelliJ Annotation Processor Settings</div> </div> <div class="paragraph"> <p>This setting enables the generation of the <code>Q*</code> classes for DataNucleus type-safe queries, as well as being required for frameworks such as <a href="#_cg_ide_project-lombok">Project Lombok</a>.</p> </div> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> <div class="paragraph"> <p>IntelliJ may also have inferred these settings for specific projects/modules when importing; review the list on the left to see if the default is overridden and fix/delete as required.</p> </div> </td> </tr> </table> </div> </div> <div class="sect4"> <h5 id="_cgcon_ide_intellij_other-settings-maven">Other Settings (Maven)</h5> <div class="paragraph"> <p>There are also some other settings for Maven that we recommend you adjust (though these are less critical):</p> </div> <div class="paragraph"> <p>First, specify an up-to-date Maven installation, using <code>File &gt; Settings</code> (or <code>IntelliJ &gt; Preferences</code> if on MacOS):</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/042-other-settings-maven/010-maven-installation.png" alt="010 maven installation" width="600px"> </div> <div class="title">Figure 18. IntelliJ Maven Settings - Installation</div> </div> <div class="paragraph"> <p>Still on the Maven settings page, configure as follows:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/042-other-settings-maven/020-maven-configuration.png" alt="020 maven configuration" width="600px"> </div> <div class="title">Figure 19. IntelliJ Maven Settings - Configuration</div> </div> </div> <div class="sect4"> <h5 id="_other_settings_misc">Other Settings (Misc)</h5> <div class="paragraph"> <p>These settings are optional but also recommended.</p> </div> <div class="paragraph"> <p>On the <strong>auto import</strong> page, check the <code>optimize imports on the fly</code> and <code>add unambiguous imports on the fly</code></p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/044-other-settings-misc/010-auto-import.png" alt="010 auto import" width="600px"> </div> <div class="title">Figure 20. IntelliJ Maven Settings - Auto Import</div> </div> </div> </div> <div class="sect3"> <h4 id="_importing_maven_modules">2.1.2. Importing Maven Modules</h4> <div class="paragraph"> <p>Let&#8217;s load in some actual code! We do this by importing the Maven modules.</p> </div> <div class="paragraph"> <p>First up, open up the Maven tool window (<code>View &gt; Tool Windows &gt; Maven Projects</code>). You can then use the 'plus' button to add Maven modules. In the screenshot you can see we&#8217;ve loaded in Apache Isis core; the modules are listed in the <em>Maven Projects</em> window and corresponding (IntelliJ) modules are shown in the <em>Projects</em> window:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/100-maven-module-mgmt/010-maven-modules-view.png" alt="010 maven modules view" width="730px"> </div> <div class="title">Figure 21. IntelliJ Maven Module Management - Importing Maven modules</div> </div> <div class="paragraph"> <p>We can then import another module (from some other directory). For example, here we are importing the Isis Addons' todoapp example:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/100-maven-module-mgmt/020-adding-another-module.png" alt="020 adding another module" width="400px"> </div> <div class="title">Figure 22. IntelliJ Maven Module Management - Importing another Module</div> </div> <div class="paragraph"> <p>You should then see the new Maven module loaded in the <em>Projects</em> window and also the <em>Maven Projects</em> window:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/100-maven-module-mgmt/030-other-module-added.png" alt="030 other module added" width="730px"> </div> <div class="title">Figure 23. IntelliJ Maven Module Management -</div> </div> <div class="paragraph"> <p>If any dependencies are already loaded in the project, then IntelliJ will automatically update the CLASSPATH to resolve to locally held modules (rather from <code>.m2/repository</code> folder). So, for example (assuming that the <code>&lt;version&gt;</code> is correct, of course), the Isis todoapp will have local dependencies on the Apache Isis core.</p> </div> <div class="paragraph"> <p>You can press F4 (or use <code>File &gt; Project Structure</code>) to see the resolved classpath for any of the modules loaded into the project.</p> </div> <div class="paragraph"> <p>If you want to focus on one set of code (eg the Isis todoapp but not Apache Isis core) then you <em>could</em> remove the module; but better is to ignore those modules. This will remove from the the <em>Projects</em> window but keep them available in the <em>Maven Projects</em> window for when you next want to work on them:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/100-maven-module-mgmt/040-ignoring-modules.png" alt="040 ignoring modules" width="730px"> </div> <div class="title">Figure 24. IntelliJ Maven Module Management - Ignoring Modules</div> </div> <div class="paragraph"> <p>Confirm that it&#8217;s ok to ignore these modules:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/100-maven-module-mgmt/050-ignoring-modules-2.png" alt="050 ignoring modules 2" width="300px"> </div> <div class="title">Figure 25. IntelliJ Maven Module Management - Ignoring Modules (ctd)</div> </div> <div class="paragraph"> <p>All being well you should see that the <em>Projects</em> window now only contains the code you are working on. Its classpath dependencies will be adjusted (eg to resolve to Apache Isis core from <code>.m2/repository</code>):</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/100-maven-module-mgmt/060-ignored-modules.png" alt="060 ignored modules" width="730px"> </div> <div class="title">Figure 26. IntelliJ Maven Module Management - Updated Projects Window</div> </div> </div> <div class="sect3"> <h4 id="_running">2.1.3. Running</h4> <div class="paragraph"> <p>Let&#8217;s see how to run both the app and the tests.</p> </div> <div class="sect4"> <h5 id="_running_the_app">Running the App</h5> <div class="paragraph"> <p>Once you&#8217;ve imported your Isis application, we should run it. We do this by creating a Run configuration, using <code>Run &gt; Edit Configurations</code>.</p> </div> <div class="paragraph"> <p>Set up the details as follows:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/110-running-the-app/010-run-configuration.png" alt="010 run configuration" width="600px"> </div> <div class="title">Figure 27. IntelliJ Running the App - Run Configuration</div> </div> <div class="paragraph"> <p>We specify the <code>Main class</code> to be <code>org.apache.isis.WebServer</code>; this is a wrapper around Jetty. It&#8217;s possible to pass program arguments to this (eg to automatically install fixtures), but for now leave this blank.</p> </div> <div class="paragraph"> <p>Also note that <code>Use classpath of module</code> is the webapp module for your app, and that the <code>working directory</code> is <code>$MODULE_DIR$</code>.</p> </div> <div class="paragraph"> <p>Next, and most importantly, configure the DataNucleus enhancer to run for your <code>dom</code> goal. This can be done by defining a Maven goal to run before the app:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/110-running-the-app/020-datanucleus-enhancer-goal.png" alt="020 datanucleus enhancer goal" width="400px"> </div> <div class="title">Figure 28. IntelliJ Running the App - Datanucleus Enhancer Goal</div> </div> <div class="paragraph"> <p>The <code>-o</code> flag in the goal means run off-line; this will run faster.</p> </div> <div class="admonitionblock warning"> <table> <tr> <td class="icon"> <i class="fa icon-warning" title="Warning"></i> </td> <td class="content"> if you forget to set up the enhancer goal, or don&#8217;t run it on the correct (dom) module, then you will get all sorts of errors when you startup. These usually manifest themselves as class cast exception in DataNucleus. </td> </tr> </table> </div> <div class="paragraph"> <p>You should now be able to run the app using <code>Run &gt; Run Configuration</code>. The same configuration can also be used to debug the app if you so need.</p> </div> </div> <div class="sect4"> <h5 id="_running_the_unit_tests">Running the Unit Tests</h5> <div class="paragraph"> <p>The easiest way to run the unit tests is just to right click on the <code>dom</code> module in the <em>Project Window</em>, and choose run unit tests. Hopefully your tests will pass (!).</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/110-running-the-app/030-running-unit-tests.png" alt="030 running unit tests" width="600px"> </div> <div class="title">Figure 29. IntelliJ Running the App - Unit Tests Run Configuration</div> </div> <div class="paragraph"> <p>As a side-effect, this will create a run configuration, very similar to the one we manually created for the main app:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/110-running-the-app/040-running-unit-tests-run-configuration.png" alt="040 running unit tests run configuration" width="600px"> </div> <div class="title">Figure 30. IntelliJ Running the App - Unit Tests Run Configuration</div> </div> <div class="paragraph"> <p>Thereafter, you should run units by selecting this configuration (if you use the right click approach you&#8217;ll end up with lots of run configurations, all similar).</p> </div> </div> <div class="sect4"> <h5 id="_running_the_integration_tests">Running the Integration Tests</h5> <div class="paragraph"> <p>Integration tests can be run in the same way as unit tests, however the <code>dom</code> module must also have been enhanced.</p> </div> <div class="paragraph"> <p>One approach is to initially run the tests use the right click on the <code>integtests</code> module; the tests will fail because the code won&#8217;t have been enhanced, but we can then go and update the run configuration to run the datanucleus enhancer goal (same as when running the application):</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/110-running-the-app/050-running-integration-tests-run-configuration.png" alt="050 running integration tests run configuration" width="600px"> </div> <div class="title">Figure 31. IntelliJ Running the App - Integration Tests Run Configuration</div> </div> </div> </div> <div class="sect3"> <h4 id="_hints_and_tips">2.1.4. Hints and Tips</h4> <div class="sect4"> <h5 id="_keyboard_cheat_sheets">Keyboard Cheat Sheets</h5> <div class="paragraph"> <p>You can download 1-page PDFs cheat sheets for IntelliJ&#8217;s keyboard shortcuts: * for <a href="https://www.jetbrains.com/idea/docs/IntelliJIDEA_ReferenceCard.pdf">Windows</a> * for <a href="https://www.jetbrains.com/idea/docs/IntelliJIDEA_ReferenceCard_Mac.pdf">MacOS</a></p> </div> <div class="paragraph"> <p>Probably the most important shortcut on them is for <code>Find Action</code>: - <code>ctrl-shift-A</code> on Windows - <code>cmd-shift-A</code> on MacOS.</p> </div> <div class="paragraph"> <p>This will let you search for any action just by typing its name.</p> </div> </div> <div class="sect4"> <h5 id="_switch_between_tools_editors">Switch between Tools &amp; Editors</h5> <div class="paragraph"> <p>The Tool Windows are the views around the editor (to left, bottom and right). It&#8217;s possible to move these around to your preferred locations.</p> </div> <div class="ulist"> <ul> <li> <p>Use <code>alt-1</code> through <code>alt-9</code> (or <code>cmd-1</code> through <code>alt-9</code>) to select the tool windows</p> <div class="ulist"> <ul> <li> <p>Press it twice and the tool window will hide itself; so can use to toggle</p> </li> </ul> </div> </li> <li> <p>If in the <em>Project Window</em> (say) and hit enter on a file, then it will be shown in the editor, but (conveniently) the focus remains in the tool window. To switch to the editor, just press <code>Esc</code>.</p> <div class="ulist"> <ul> <li> <p>If in the <em>Terminal Window</em>, you&#8217;ll need to press <code>Shift-Esc</code>.</p> </li> </ul> </div> </li> <li> <p>If on the editor and want to locate the file in (say) the <em>Project Window</em>, use <code>alt-F1</code>.</p> </li> <li> <p>To change the size of any tool window, use <code>ctrl-shift-arrow</code></p> </li> </ul> </div> <div class="paragraph"> <p>Using these shortcuts you can easily toggle between the tool windows and the editor, without using the mouse. Peachy!</p> </div> </div> <div class="sect4"> <h5 id="_navigating_around">Navigating Around</h5> <div class="paragraph"> <p>For all of the following, you don&#8217;t need to type every letter, typing "ab" will actually search for ".<strong>a.*b.</strong>".</p> </div> <div class="ulist"> <ul> <li> <p>to open classes or files or methods that you know the name of:</p> <div class="ulist"> <ul> <li> <p><code>ctrl-N</code> to open class</p> </li> <li> <p><code>ctrl-shift-N</code> to open a file</p> </li> <li> <p>(bit fiddly this) <code>ctrl-shift-alt-N</code> to search for any symbol.</p> </li> </ul> </div> </li> <li> <p>open up dialog of recent files: <code>ctrl-E</code></p> </li> <li> <p>search for any file: <code>shift-shift</code></p> </li> </ul> </div> <div class="paragraph"> <p>Navigating around: * find callers of a method (the call hierarchy): <code>ctrl-alt-H</code> * find subclasses or overrides: <code>ctrl-alt-B</code> * find superclasses/interface/declaration: <code>ctrl-B</code></p> </div> <div class="paragraph"> <p>Viewing the structure (ie outline) of a class * <code>ctrl-F12</code> will pop-up a dialog showing all members ** hit <code>ctrl-F12</code> again to also see inherited members</p> </div> </div> <div class="sect4"> <h5 id="_editing">Editing</h5> <div class="ulist"> <ul> <li> <p>Extend selection using <code>ctrl-W</code></p> <div class="ulist"> <ul> <li> <p>and contract it down again using <code>ctrl-shift-W</code></p> </li> </ul> </div> </li> <li> <p>to duplicate a line, it&#8217;s <code>ctrl-D</code></p> <div class="ulist"> <ul> <li> <p>if you have some text selected (or even some lines), it&#8217;ll actually duplicate the entire selection</p> </li> </ul> </div> </li> <li> <p>to delete a line, it&#8217;s <code>ctrl-X</code></p> </li> <li> <p>to move a line up or down: <code>shift-alt-up</code> and <code>shift-alt-down</code></p> <div class="ulist"> <ul> <li> <p>if you have selected several lines, it&#8217;ll move them all togethe</p> </li> </ul> </div> </li> <li> <p><code>ctrl-shift-J</code> can be handy for joining lines together</p> <div class="ulist"> <ul> <li> <p>just hit enter to split them apart (even in string quotes; IntelliJ will "do the right thing")</p> </li> </ul> </div> </li> </ul> </div> </div> <div class="sect4"> <h5 id="_intentions_and_code_completion">Intentions and Code Completion</h5> <div class="paragraph"> <p>Massively useful is the "Intentions" popup; IntelliJ tries to guess what you might want to do. You can activate this using`alt-enter`, whenever you see a lightbulb/tooltip in the margin of the current line.</p> </div> <div class="paragraph"> <p>Code completion usually happens whenever you type '.'. You can also use <code>ctrl-space</code> to bring these up.</p> </div> <div class="paragraph"> <p>In certain circumstances (eg in methods0) you can also type <code>ctrl-shift-space</code> to get a smart list of methods etc that you might want to call. Can be useful.</p> </div> <div class="paragraph"> <p>Last, when invoking a method, use <code>ctrl-P</code> to see the parameter types.</p> </div> </div> <div class="sect4"> <h5 id="_refactoring">Refactoring</h5> <div class="paragraph"> <p>Loads of good stuff on the <code>Refactor</code> menu; most used are:</p> </div> <div class="ulist"> <ul> <li> <p>Rename (<code>shift-F6</code>)</p> </li> <li> <p>Extract</p> <div class="ulist"> <ul> <li> <p>method: <code>ctrl-alt-M</code></p> </li> <li> <p>variable: <code>ctrl-alt-V</code></p> </li> </ul> </div> </li> <li> <p>Inline method/variable: <code>ctrl-alt-N</code></p> </li> <li> <p>Change signature</p> </li> </ul> </div> <div class="paragraph"> <p>If you can&#8217;t remember all those shortcuts, just use <code>ctrl-shift-alt-T</code> (might want to rebind that to something else!) and get a context-sensitive list of refactorings available for the currently selected object</p> </div> </div> <div class="sect4"> <h5 id="_plugins">Plugins</h5> <div class="paragraph"> <p>You might want to set up some additional plugins. You can do this using <code>File &gt; Settings &gt; Plugins</code> (or equivalently <code>File &gt; Other Settings &gt; Configure Plugins</code>).</p> </div> <div class="paragraph"> <p>Recommended are:</p> </div> <div class="ulist"> <ul> <li> <p><a href="https://plugins.jetbrains.com/plugin/7179?pr=idea">Maven Helper</a> plugin</p> <div class="paragraph"> <p>More on this below.</p> </div> </li> <li> <p><a href="https://github.com/asciidoctor/asciidoctor-intellij-plugin">AsciiDoctor</a> plugin</p> <div class="paragraph"> <p>Useful if you are doing any authoring of documents.</p> </div> </li> </ul> </div> <div class="paragraph"> <p>Some others you might like to explore are:</p> </div> <div class="imageblock"> <div class="content"> <img src="images/appendices/dev-env/intellij-idea/050-some-plugins/020-some-plugins-confirmation.png" alt="020 some plugins confirmation" width="600px"> </div> <div class="title">Figure 32. IntelliJ Plugins</div> </div> <div class="sect5"> <h6 id="_maven_helper_plugin">Maven Helper Plugin</h6> <div class="paragraph"> <p>This plugin provides a couple of great features. One is better visualization of dependency trees (similar to Eclipse).</p> </div> <div class="paragraph"> <p>If you open a <code>pom.xml</code> file, you&#8217;ll see an additional "Dependencies" tab:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/appendices/dev-env/intellij-idea/050-some-plugins/maven-helper/010-dependency-tab.png"><img src="images/appendices/dev-env/intellij-idea/050-some-plugins/maven-helper/010-dependency-tab.png" alt="010 dependency tab" width="600px"></a> </div> </div> <div class="paragraph"> <p>Clicking on this gives a graphical tree representation of the dependencies, similar to that obtained by <code>mvn dependency:tree</code>, but filterable.</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/appendices/dev-env/intellij-idea/050-some-plugins/maven-helper/020-dependency-as-tree.png"><img src="images/appendices/dev-env/intellij-idea/050-some-plugins/maven-helper/020-dependency-as-tree.png" alt="020 dependency as tree" width="600px"></a> </div> </div> <div class="paragraph"> <p>The plugin also provides the ability to easily run a Maven goal on a project:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/appendices/dev-env/intellij-idea/050-some-plugins/maven-helper/030-maven-run-goal.png"><img src="images/appendices/dev-env/intellij-idea/050-some-plugins/maven-helper/030-maven-run-goal.png" alt="030 maven run goal" width="600px"></a> </div> </div> <div class="paragraph"> <p>This menu can also be bound to a keystroke so that it is available as a pop-up:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/appendices/dev-env/intellij-idea/050-some-plugins/maven-helper/040-maven-quick-run.png"><img src="images/appendices/dev-env/intellij-idea/050-some-plugins/maven-helper/040-maven-quick-run.png" alt="040 maven quick run" width="600px"></a> </div> </div> </div> </div> <div class="sect4"> <h5 id="_troubleshooting">Troubleshooting</h5> <div class="paragraph"> <p>When a Maven module is imported, IntelliJ generates its own project files (suffix <code>.ipr</code>), and the application is actually built from that.</p> </div> <div class="paragraph"> <p>Occasionally these don&#8217;t keep in sync (even if auto-import of Maven modules has been enabled).</p> </div> <div class="paragraph"> <p>To fix the issue, try: * reimport module * rebuild selected modules/entire project * remove and then re-add the project * restart, invalidating caches * hit StackOverflow (!)</p> </div> <div class="paragraph"> <p>One thing worth knowing; IntelliJ actively scans the filesystem all the time. It&#8217;s therefore (almost always) fine to build the app from the Maven command line; IntelliJ will detect the changes and keep in sync. If you want to force that, use <code>File &gt; Synchronize</code>, <code>ctrl-alt-Y</code>.</p> </div> <div class="paragraph"> <p>If you hit an error of "duplicate classes":</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/appendices/dev-env/intellij-idea/060-troubleshooting/010-duplicate-classes.png"><img src="images/appendices/dev-env/intellij-idea/060-troubleshooting/010-duplicate-classes.png" alt="010 duplicate classes" width="600px"></a> </div> </div> <div class="paragraph"> <p>then make sure you have correctly configured the <a href="#_cg_ide_intellij_other-settings-compiler">annotation processor</a> settings. Pay attention in particular to the "Production sources directory" and "Test sources directory", that these are set up correctly.</p> </div> </div> </div> <div class="sect3"> <h4 id="_running_integration_tests">2.1.5. Running Integration Tests</h4> <div class="paragraph"> <p>When running integration tests from within IntelliJ, make sure that the <code>search for tests</code> radio button is set to <code>In single module</code>:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/appendices/dev-env/intellij-idea/400-running-integtests/run-debug-configuration-single-module.png"><img src="images/appendices/dev-env/intellij-idea/400-running-integtests/run-debug-configuration-single-module.png" alt="run debug configuration single module" width="600px"></a> </div> </div> <div class="paragraph"> <p>If this radio button is set to one of the other options then you may obtain class loading issues; these result from IntelliJ attempting to run unit tests of the <code>dom</code> project that depend on test classes in that module, but using the classpath of the <code>integtests</code> module whereby the <code>dom</code> test-classes (<code>test-jar</code> artifact) are not exposed on the Maven classpath.</p> </div> </div> <div class="sect3"> <h4 id="_cgcon_ide_intellij_advanced">2.1.6. 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> <div class="sect4"> <h5 id="_cgcon_ide_intellij_advanced_dcevm">Setting up Dynamic Reloading</h5> <div class="paragraph"> <p><a href="github.com/dcevm/dcevm">DCEVM</a> enhances the JVM with true hot-swap adding/removing of methods as well as more reliable hot swapping of the implementation of existing methods.</p> </div> <div class="paragraph"> <p>In the context of Apache Isis, this is very useful for contributed actions and mixins and also view models; you should then be able to write these actions and have them be picked up without restarting the application.</p> </div> <div class="paragraph"> <p>Changing persisting domain entities is more problematic, for two reasons: the JDO/DataNucleus enhancer needs to run on domain entities, and also at runtime JDO/DataNucleus would need to rebuild its own metamodel. You may find that adding actions will work, but adding new properties or collections is much less likely to.</p> </div> <div class="paragraph"> <p>To set up DCEVM, download the appropriate JAR from the <a href="https://dcevm.github.io/">github page</a>, and run the installer. For example:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">java -jar DCEVM-light-8u51-installer.jar</code></pre> </div> </div> <div class="admonitionblock tip"> <table> <tr> <td class="icon"> <i class="fa icon-tip" title="Tip"></i> </td> <td class="content"> <div class="paragraph"> <p>Be sure to run with appropriate privileges to be able to write to the installation directories of the JDK. If running on Windows, that means running as <code>Administrator</code>.</p> </div> </td> </tr> </table> </div> <div class="paragraph"> <p>After a few seconds this will display a dialog listing all installations of JDK that have been found:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/appendices/dev-env/intellij-idea/070-advanced/010-dcevm-list-of-found-jdk-installations.png"><img src="images/appendices/dev-env/intellij-idea/070-advanced/010-dcevm-list-of-found-jdk-installations.png" alt="010 dcevm list of found jdk installations" width="600px"></a> </div> </div> <div class="paragraph"> <p>Select the corresponding installation, and select <code>Replace by DCEVM</code>.</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/appendices/dev-env/intellij-idea/070-advanced/020-dcevm-once-installed.png"><img src="images/appendices/dev-env/intellij-idea/070-advanced/020-dcevm-once-installed.png" alt="020 dcevm once installed" width="600px"></a> </div> </div> <div class="paragraph"> <p>In IntelliJ, register the JDK in <code>File &gt; Project Structure</code> dialog:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/appendices/dev-env/intellij-idea/070-advanced/030-dcevm-intellij-project-structure.png"><img src="images/appendices/dev-env/intellij-idea/070-advanced/030-dcevm-intellij-project-structure.png" alt="030 dcevm intellij project structure" width="600px"></a> </div> </div> <div class="paragraph"> <p>Finally, in the run configuration, select the patched JDK:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/appendices/dev-env/intellij-idea/070-advanced/040-dcevm-run-configuration.png"><img src="images/appendices/dev-env/intellij-idea/070-advanced/040-dcevm-run-configuration.png" alt="040 dcevm run configuration" width="600px"></a> </div> </div> </div> <div class="sect4"> <h5 id="_setting_up_jrebel">Setting up JRebel</h5> <div class="paragraph"> <p>See the repo for the (non-ASF) <a href="https://github.com/isisaddons/isis-jrebel-plugin">Isis JRebel</a> plugin. With some modification, this should work for IntelliJ too.</p> </div> <div class="paragraph"> <p>Note that JRebel is a commercial product, requiring a license. At the time of writing there is also currently a non-commercial free license (though note this comes with some usage conditions).</p> </div> </div> </div> </div> <div class="sect2"> <h3 id="_cgcon_ide_eclipse">2.2. Developing using Eclipse</h3> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> <div class="paragraph"> <p>This material does not constitute an endorsement; Eclipse foundation is not affiliated to Apache Software Foundation in any way.</p> </div> </td> </tr> </table> </div> <div class="paragraph"> <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&#8217;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&#8217;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="_screencast">2.2.1. Screencast</h4> <div class="paragraph"> <p>The following screencast shows how to import an Apache Isis maven-based application into Eclipse and configure to use with the JDO Objectstore</p> </div> <div class="videoblock"> <div class="content"> <iframe width="640px" height="480px" src="//www.youtube.com/embed/RgcYfjQ8yJA?rel=0" frameborder="0" allowfullscreen></iframe> </div> </div> </div> <div class="sect3"> <h4 id="_importing_the_project">2.2.2. Importing the Project</h4> <div class="paragraph"> <p>Use File &gt; Import, then Maven &gt; Existing Maven Projects.</p> </div> </div> <div class="sect3"> <h4 id="_add_datanucleus_support">2.2.3. Add DataNucleus support</h4> <div class="admonitionblock tip"> <table> <tr> <td class="icon"> <i class="fa icon-tip" title="Tip"></i> </td> <td class="content"> <div class="paragraph"> <p>Make sure you are in the 'Java' Perspective, not the 'Java EE' Perspective.</p> </div> </td> </tr> </table> </div> <div class="paragraph"> <p>In Eclipse, for the <em>domain object model</em> project, first add DataNucleus support:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/appendices/dev-env/eclipse/eclipse-100-project-support.png"><img src="images/appendices/dev-env/eclipse/eclipse-100-project-support.png" alt="eclipse 100 project support" width="600px"></a> </div> </div> <div class="paragraph"> <p>Then turn on Auto-Enhancement:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/appendices/dev-env/eclipse/eclipse-110-project-support.png"><img src="images/appendices/dev-env/eclipse/eclipse-110-project-support.png" alt="eclipse 110 project support" width="600px"></a> </div> </div> <div class="sect4"> <h5 id="_update_the_classpath">Update the classpath</h5> <div class="paragraph"> <p>DataNucleus' enhancer uses the domain object model&#8217;s own classpath to reference DataNucleus JARs. So, even though your domain objects are unlikely to depend on DataNucleus, these references must still be present.</p> </div> <div class="paragraph"> <p>See the earlier section on <a href="ugfun.html#_ugfun_getting-started_datanucleus-enhancer">DataNucleus enhancer</a> for details of the contents of the <code>pom.xml</code>. Chances are it is already set up from running the <a href="ugfun.html#_ugfun_getting-started_simpleapp-archetype">SimpleApp archetype</a>.</p> </div> <div class="paragraph"> <p>Then, tell DataNucleus to use the project classpath:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images//appendices/dev-env/eclipse/eclipse-010-windows-preferences.png"><img src="images//appendices/dev-env/eclipse/eclipse-010-windows-preferences.png" alt="eclipse 010 windows preferences" width="750px"></a> </div> </div> <div class="paragraph"> <p>When the enhancer runs, it will print out to the console:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images//appendices/dev-env/eclipse/eclipse-120-console.png"><img src="images//appendices/dev-env/eclipse/eclipse-120-console.png" alt="eclipse 120 console" width="500px"></a> </div> </div> </div> <div class="sect4"> <h5 id="_workaround_for_path_limits_the_dn_plugin_to_use_the_persistence_xml">Workaround for path limits (the DN plugin to use the persistence.xml)</h5> <div class="paragraph"> <p>If running on Windows then the DataNucleus plugin is very likely to hit the Windows path limit.</p> </div> <div class="paragraph"> <p>To fix this, we configure the enhancer to read from the <code>persistence.xml</code> file.</p> </div> <div class="paragraph"> <p>As a prerequisite, first make sure that your domain object model has a <code>persistence.xml</code> file. Then specify the <code>persistence-unit</code> in the project properties:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images//appendices/dev-env/eclipse/eclipse-025-project-properties.png"><img src="images//appendices/dev-env/eclipse/eclipse-025-project-properties.png" alt="eclipse 025 project properties" width="750px"></a> </div> </div> </div> <div class="sect4"> <h5 id="_workaround_if_the_enhancer_fails">Workaround: If the enhancer fails</h5> <div class="paragraph"> <p>On occasion it appears that Eclipse can attempt to run two instances of the DataNucleus enhancer. This is probably due to multiple Eclipse builders being defined; we&#8217;ve noticed multiple entries in the Eclipse&#8217;s <code>Debug</code> view:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images//appendices/dev-env/eclipse/eclipse-210-enhancer-fails-duplicates.png"><img src="images//appendices/dev-env/eclipse/eclipse-210-enhancer-fails-duplicates.png" alt="eclipse 210 enhancer fails duplicates" width="600px"></a> </div> </div> <div class="paragraph"> <p>At any rate, you&#8217;ll know you&#8217;ve encountered this error if you see the following in the console:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images//appendices/dev-env/eclipse/eclipse-200-enhancer-fails-duplicates.png"><img src="images//appendices/dev-env/eclipse/eclipse-200-enhancer-fails-duplicates.png" alt="eclipse 200 enhancer fails duplicates" width="600px"></a> </div> </div> <div class="paragraph"> <p>The best solution is to remove DataNucleus support and then to re-add it:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images//appendices/dev-env/eclipse/eclipse-220-enhancer-fails-duplicates.png"><img src="images//appendices/dev-env/eclipse/eclipse-220-enhancer-fails-duplicates.png" alt="eclipse 220 enhancer fails duplicates" width="600px"></a> </div> </div> <div class="paragraph"> <p>If you consistently hit problems, then the final recourse is to disable the automatic enhancement and to remember to manually enhance your domain object model before each run.</p> </div> <div class="paragraph"> <p>Not ideal, we know. Please feel free to contribute a better solution :-)</p> </div> </div> </div> <div class="sect3"> <h4 id="_running_the_app_2">2.2.4. 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> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> <div class="paragraph"> <p>The screencast above shows this in action.</p> </div> </td> </tr> </table> </div> </div> <div class="sect3"> <h4 id="_other_domain_projects">2.2.5. 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&#8217;s DataNucleus plugin for these other domain projects.</p> </div> </div> <div class="sect3"> <h4 id="_advanced">2.2.6. 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> <div class="sect4"> <h5 id="_setting_up_dynamic_reloading">Setting up Dynamic Reloading</h5> <div class="paragraph"> <p><a href="github.com/dcevm/dcevm">DCEVM</a> enhances the JVM with true hot-swap adding/removing of methods as well as more reliable hot swapping of the implementation of existing methods.</p> </div> <div class="paragraph"> <p>In the context of Apache Isis, this is very useful for contributed actions and mixins and also view models; you should then be able to write these actions and have them be picked up without restarting the application.</p> </div> <div class="paragraph"> <p>Changing persisting domain entities is more problematic, for two reasons: the JDO/DataNucleus enhancer needs to run on domain entities, and also at runtime JDO/DataNucleus would need to rebuild its own metamodel. You may find that adding actions will work, but adding new properties or collections is much less likely to.</p> </div> <div class="paragraph"> <p>For details of setting up DCEVM, see the <a href="#_cgcon_ide_intellij_advanced_dcevm">corresponding section</a> in the IntelliJ documentation.</p> </div> </div> </div> </div> <div class="sect2"> <h3 id="_cgcon_ide_project-lombok">2.3. Project Lombok</h3> <div class="paragraph"> <p><a href="https://projectlombok.org/">Project Lombok</a> is an open source project to reduce the amount of boilerplate in your code.</p> </div> <div class="paragraph"> <p>For example, rather than write:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="java"><span class="directive">private</span> <span class="predefined-type">String</span> name; <span class="directive">public</span> <span class="predefined-type">String</span> getName() { <span class="keyword">return</span> name; } <span class="directive">public</span> <span class="type">void</span> setName(<span class="predefined-type">String</span> name) { <span class="local-variable">this</span>.name = name; }</code></pre> </div> </div> <div class="paragraph"> <p>you can instead write simply:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="java"><span class="annotation">@Getter</span> <span class="annotation">@Setter</span> <span class="directive">private</span> <span class="predefined-type">String</span> name;</code></pre> </div> </div> <div class="paragraph"> <p>Under the covers it is implemented as an annotation processor; it basically hooks into the Java compiler so that it can emit additional bytecode (eg for the getter and setter). See <a href="#_cg_ide_intellij_other-settings-compiler">here</a> for details of setting up in IntelliJ (Eclipse has very similar support).</p> </div> <div class="paragraph"> <p>Apache Isis supports <a href="https://projectlombok.org/">Project Lombok</a>, in that the annotations that would normally be placed on the getter (namely <a href="rgant.html#_rgant-Property"><code>Property</code></a>, <a href="rgant.html#_rgant-PropertyLayout"><code>@PropertyLayout</code></a>, <a href="rgant.html#_rgant-Collection"><code>@Collection</code></a>, <a href="rgant.html#_rgant-CollectionLayout"><code>@CollectionLayout</code></a> and <a href="rgant.html#_rgant-MemberOrder"><code>@MemberOrder</code></a>) can be placed on the field instead.</p> </div> <div class="paragraph"> <p>There are plugins for Lombok for maven; it&#8217;s just a matter of adding the required dependency. To compile the code within your IDE (eg so that its compiler "knows" that there is, actually, a getter and setter) will require an Lombok plugin appropriate to that IDE. See the <a href="https://projectlombok.org/download.html">Lombok download page</a> for more information.</p> </div> <div class="sect3"> <h4 id="_future_thoughts">2.3.1. Future thoughts</h4> <div class="paragraph"> <p>In the future we might extend/fork Lombok so that it understands Isis' own annotations (ie <a href="rgant.html#_rgant-Property"><code>@Property</code></a> and <a href="rgant.html#_rgant-Collection"><code>@Collection</code></a>) rather than Lombok&#8217;s own <code>@Getter</code> and `@Setter.</p> </div> <div class="paragraph"> <p>It might also be possible to use Lombok to generate the domain event classes for each member.</p> </div> </div> </div> <div class="sect2"> <h3 id="_cgcon_ide_agilej">2.4. AgileJ</h3> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> <div class="paragraph"> <p>This material does not constitute an endorsement; AgileJ Structure Views is not affiliated to Apache Software Foundation in any way.</p> </div> </td> </tr> </table> </div> <div class="paragraph"> <p><a href="http://www.agilej.com/">AgileJ Structure Views</a> is a commercial product to reverse engineer and visualize Java classes from source code.</p> </div> <div class="paragraph"> <p>The key to using the tool is in developing a suitable filter script, a DSL. You can use the following script as a starting point for visualizing Apache Isis domain models:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="AgileJ">// use CTRL+SPACE for completion suggestions hide all fields hide setter methods hide private methods hide methods named compareTo hide methods named toString hide methods named inject* hide methods named disable* hide methods named default* hide methods named hide* hide methods named autoComplete* hide methods named choices* hide methods named title hide methods named iconName hide methods named validate* hide methods named modify* hide protected methods hide types annotated as DomainService hide types named Constants hide types named InvoicingInterval hide enums hide constructors hide inner types named *Event hide inner types named *Functions hide inner types named *Predicates show getter methods in green show methods annotated as Programmatic in orange show methods annotated as Action in largest hide dependency lines hide call lines hide method lines</code></pre> </div> </div> <div class="paragraph"> <p>For more information on AgileJ, see Paul Wells' 8-part tutorial series on Youtube; the first can be found <a href="https://www.youtube.com/watch?v=YrZQ7lMSsH0">here</a> (view the "show more" comments to click through to other parts).</p> </div> </div> </div> </div> <div class="sect1"> <h2 id="_cgcon_ide-templates">3. Code and File Templates</h2> <div class="sectionbody"> <div class="paragraph"> <p>We provide parameterized templates, for both IntelliJ and Eclipse, to help you write your domain applications.</p> </div> <div class="paragraph"> <p>On IntelliJ we provide both file templates (<code>File &gt; Settings &gt; Editor &gt; File and Code Templates</code>) and also live templates (<code>File &gt; Settings &gt; Editor &gt; Live Templates</code>). The former are used to create new classes or files (eg a new domain entity), while the latter are intended to modify an existing file (eg create a new property or add a <code>toString()</code> method etc).</p> </div> <div class="paragraph"> <p>On Eclipse we provide only the latter sort of template (Windows &gt; Preferences &gt; Java &gt; Editor &gt; Templates).</p> </div> <div class="paragraph"> <p>There are templates for writing Apache Isis domain objects, for writing unit tests (JUnit and JMock), and also for writing Asciidoc documentation (see also the <a href="#_cgcon_asciidoc-templates">appendix</a>).</p> </div> <div class="sect2"> <h3 id="_download">3.1. Download</h3> <div class="paragraph"> <p>The following table lists the templates available to download:</p> </div> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 22%;"> <col style="width: 22%;"> <col style="width: 11%;"> <col style="width: 22%;"> <col style="width: 22%;"> </colgroup> <thead> <tr> <th class="tableblock halign-left valign-top">Purpose</th> <th class="tableblock halign-left valign-top">IntelliJ<br> file template</th> <th class="tableblock halign-left valign-top">Prefix</th> <th class="tableblock halign-left valign-top">IntelliJ<br> live template</th> <th class="tableblock halign-left valign-top">Eclipse<br> template</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>Domain Objects</p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="../resources/templates/intellij-settings-file-templates-for-apache-isis.jar">Download</a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>is</code></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="../resources/templates/isis-templates-idea.xml">Download</a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="../resources/templates/isis-templates.xml">Download</a></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>JUnit tests</p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>(none)</p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>ju</code></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="../resources/templates/junit4-templates-idea.xml">Download</a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="../resources/templates/junit4-templates.xml">Download</a></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>JMock tests</p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>(none)</p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>jm</code></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="../resources/templates/jmock2-templates-idea.xml">Download</a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="../resources/templates/jmock2-templates.xml">Download</a></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>Asciidoc</p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>(none)</p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>ad</code></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="../resources/templates/isis-asciidoc-templates-idea.xml">Download</a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>(none)</p> </div></div></td> </tr> </tbody> </table> <div class="paragraph"> <p>The most commonly used domain objects (live) templates are also listed on the <a href="../cheat-sheet.html">Apache Isis cheat sheet</a>.</p> </div> </div> <div class="sect2"> <h3 id="_installation">3.2. Installation</h3> <div class="sect3"> <h4 id="_intellij">3.2.1. IntelliJ</h4> <div class="paragraph"> <p>To install in the live templates IntelliJ (Community edition 15), copy to the relevant <code>config/templates</code> directory, eg:</p> </div> <div class="ulist"> <ul> <li> <p>Windows <code>&lt;User home&gt;\.IdeaIC15\config\templates</code></p> </li> <li> <p>Linux <code>~/.IdeaIC14/config/templates</code></p> </li> <li> <p>Mac OS <code>~/Library/Preferences/IdeaIC15/templates</code></p> </li> </ul> </div> <div class="paragraph"> <p>If using the Ultimate edition, the directory is <code>.IntelliJIdea15</code> rather than <code>IdeaIC15</code>.</p> </div> <div class="paragraph"> <p>To install the file templates, use <code>File &gt; Import Settings</code>.</p> </div> </div> <div class="sect3"> <h4 id="_eclipse">3.2.2. Eclipse</h4> <div class="paragraph"> <p>To install in Eclipse, go to <code>Windows &gt; Preferences &gt; Java &gt; Editor &gt; Templates</code> and choose <code>Import</code>.</p> </div> </div> </div> <div class="sect2"> <h3 id="_usage">3.3. Usage</h3> <div class="paragraph"> <p>For the live templates, enter the prefix in the editor (<code>is</code>, <code>ju</code>, <code>jm</code>) and the IDE will list all available templates in that category.</p> </div> <div class="paragraph"> <p>For the file templates (IntelliJ only), these are available from <code>File &gt; New</code>.</p> </div> </div> </div> </div> <div class="sect1"> <h2 id="_cgcon_cmd-line">4. Command Line and CI</h2> <div class="sectionbody"> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> TODO </td> </tr> </table> </div> </div> </div> <div class="sect1"> <h2 id="_cgcon_isis-maven-plugin">5. Apache Isis Maven Plugin</h2> <div class="sectionbody"> <div class="paragraph"> <p>The Apache Isis Maven plugin defines three goals:</p> </div> <div class="ulist"> <ul> <li> <p><code>validate</code><br></p> <div class="paragraph"> <p>Use to verify at build time that the metamodel of an application is valid. This runs the <code>MetaModelValidator</code> that is also run when the application is started up.</p> </div> </li> <li> <p><code>swagger</code><br></p> <div class="paragraph"> <p>Uses the <a href="rgsvc.html#_rgsvc_api_SwaggerService"><code>SwaggerService</code></a> to generate <a href="http://swagger.io">Swagger</a> spec files that describe the public and/or private RESTful APIs exposed by the <a href="ugvro.html">RestfulObjects viewer</a>.</p> </div> </li> <li> <p><code>xsd</code><br></p> <div class="paragraph"> <p>Uses the <a href="rgsvc.html#_rgsvc_api_JaxbService"><code>JaxbService</code></a> to generate XSD schemas from any JAXB-annotated view models/DTOs.<br></p> </div> <div class="paragraph"> <p>This is instead of and preferable to using the JAXB <a href="https://jaxb.java.net/2.2.4/docs/schemagen.html">schemagen</a> tool, because it uses the framework&#8217;s support (via <a href="rgant.html#_rgant-XmlJavaValueType"><code>@XmlJavaValueType</code></a>) to translate any references to domain objects into <code>OidDto</code>s (as defined by the Apache Isis <a href="rgcms.html#_rgcms_schema-common">common schema</a>).</p> </div> </li> </ul> </div> <div class="paragraph"> <p>The <code>validate</code> goal is by default bound to the <code>test</code> phase, and the <code>swagger</code> goal is by default bound to the <code>package</code> phase; both are typically of your application&#8217;s <code>dom</code> sub-module. The <code>xsd</code> goal meanwhile defaults to the <code>generate-resources</code> phase, and this is generally used in a completely separate sub-module. An example can be found in the (non-ASF) <a href="http://github.com/isisaddons/isis-app-todoapp">Isis addons' todoapp</a> example app; the separate submodule that uses the <code>xsd</code> goal is (also) called <code>todoapp-xsd</code>.</p> </div> <div class="paragraph"> <p>All of these goals require an <a href="rgcms.html#_rgcms_classes_AppManifest-bootstrapping"><code>AppManifest</code></a> to point the plugin at, so that it knows how to bootstrap an Isis runtime. This is discussed below, followed by sections on configuring the two goals.</p> </div> <div class="sect2"> <h3 id="__code_appmanifest_code">5.1. <code>AppManifest</code></h3> <div class="paragraph"> <p>As noted in the introduction, all the goals require an <a href="rgcms.html#_rgcms_classes_AppManifest-bootstrapping"><code>AppManifest</code></a> to point the plugin at, so that it knows how to bootstrap an Isis runtime.</p> </div> <div class="paragraph"> <p>This can be extremely minimal. For example, the <a href="ugfun.html#_ugfun_getting-started_simpleapp-archetype">SimpleApp</a>'s manifest is:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="java"><span class="keyword">package</span> <span class="namespace">domainapp.dom</span>; ... public <span class="type">class</span> <span class="class">DomainAppDomManifest</span> <span class="directive">implements</span> AppManifest { <span class="annotation">@Override</span> <span class="directive">public</span> <span class="predefined-type">List</span>&lt;<span class="predefined-type">Class</span>&lt;?&gt;&gt; getModules() { <span class="keyword">return</span> <span class="predefined-type">Arrays</span>.asList( DomainAppDomainModule.class <span class="comment">// domain (entities and repositories)</span> ); } <span class="annotation">@Override</span> <span class="directive">public</span> <span class="predefined-type">List</span>&lt;<span class="predefined-type">Class</span>&lt;?&gt;&gt; getAdditionalServices() { <span class="keyword">return</span> <span class="predefined-type">Collections</span>.emptyList(); } <span class="annotation">@Override</span> <span class="directive">public</span> <span class="predefined-type">String</span> getAuthenticationMechanism() { <span class="keyword">return</span> <span class="predefined-constant">null</span>; } <span class="annotation">@Override</span> <span class="directive">public</span> <span class="predefined-type">String</span> getAuthorizationMechanism() { <span class="keyword">return</span> <span class="predefined-constant">null</span>; } <span class="annotation">@Override</span> <span class="directive">public</span> <span class="predefined-type">List</span>&lt;<span class="predefined-type">Class</span>&lt;? <span class="directive">extends</span> FixtureScript&gt;&gt; getFixtures() { <span class="keyword">return</span> <span class="predefined-constant">null</span>; } <span class="annotation">@Override</span> <span class="directive">public</span> <span class="predefined-type">Map</span>&lt;<span class="predefined-type">String</span>, <span class="predefined-type">String</span>&gt; getConfigurationProperties() { <span class="keyword">return</span> <span class="predefined-constant">null</span>; } }</code></pre> </div> </div> <div class="paragraph"> <p>where <code>DomainAppDomainModule</code> simply identifies the package for the manifest to search under:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="java"><span class="keyword">package</span> <span class="namespace">domainapp.dom</span>; <span class="directive">public</span> <span class="directive">final</span> <span class="type">class</span> <span class="class">DomainAppDomainModule</span> { }</code></pre> </div> </div> <div class="paragraph"> <p>As you&#8217;ll see below, the configuration for each of the goals both refer to this app manifest.</p> </div> </div> <div class="sect2"> <h3 id="_cgcon_isis-maven-plugin_validate">5.2. <code>validate</code> goal</h3> <div class="paragraph"> <p>The Apache Isis programming model requires that a number of naming conventions are followed.</p> </div> <div class="paragraph"> <p>For example, the validator will detect any orphaned supporting methods (eg <code>hideXxx()</code>) if the corresponding property or action has been renamed or deleted but the supporting method was not also updated. Another example is that a class cannot have a title specified both using <code>title()</code> method and also using <code>@Title</code> annotation.</p> </div> <div class="paragraph"> <p>When running the application these are enforced by the <code>MetaModelValidator</code> component that detects these errors, failing fast.</p> </div> <div class="paragraph"> <p>The purpose of the <code>validate</code> goal of the <code>isis-maven-plugin</code> is to enforce these naming conventions at build time, typically enforced by way of a continuous integration server.</p> </div> <div class="paragraph"> <p>The <code>validate</code> goal defines a single property:</p> </div> <div class="ulist"> <ul> <li> <p><code>appManifest</code> - fully qualified class name for the app manifest used to bootstrap the application (see discussion above)</p> </li> </ul> </div> <div class="paragraph"> <p>The sections below explain how to configure the plugin within an app.</p> </div> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> <div class="paragraph"> <p>The instructions given here relate to <code>1.10.0</code>. This goal was also released for <code>1.9.0</code>, but with a slightly different configuration; see the final section for differences.</p> </div> </td> </tr> </table> </div> <div class="sect3"> <h4 id="__code_dom_code_submodule">5.2.1. <code>dom</code> submodule</h4> <div class="paragraph"> <p>Update the <code>pom.xml</code> (in your project&#8217;s <code>dom</code> module):</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="xml"><span class="tag">&lt;profile&gt;</span> <span class="tag">&lt;id&gt;</span>isis-validate<span class="tag">&lt;/id&gt;</span> <span class="tag">&lt;activation&gt;</span> <span class="tag">&lt;property&gt;</span> <span class="tag">&lt;name&gt;</span>!skip.isis-validate<span class="tag">&lt;/name&gt;</span> <i class="conum" data-value="1"></i><b>(1)</b> <span class="tag">&lt;/property&gt;</span> <span class="tag">&lt;/activation&gt;</span> <span class="tag">&lt;build&gt;</span> <span class="tag">&lt;plugins&gt;</span> <span class="tag">&lt;plugin&gt;</span> <span class="tag">&lt;groupId&gt;</span>org.apache.isis.tool<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>isis-maven-plugin<span class="tag">&lt;/artifactId&gt;</span> <span class="tag">&lt;version&gt;</span>${isis.version}<span class="tag">&lt;/version&gt;</span> <i class="conum" data-value="2"></i><b>(2)</b> <span class="tag">&lt;configuration&gt;</span> <span class="tag">&lt;appManifest&gt;</span>domainapp.dom.DomainAppDomManifest<span class="tag">&lt;/appManifest&gt;</span> <i class="conum" data-value="3"></i><b>(3)</b> <span class="tag">&lt;/configuration&gt;</span> <span class="tag">&lt;dependencies&gt;</span> <span class="tag">&lt;dependency&gt;</span> <span class="tag">&lt;groupId&gt;</span>${project.groupId}<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>simpleapp-dom<span class="tag">&lt;/artifactId&gt;</span> <i class="conum" data-value="4"></i><b>(4)</b> <span class="tag">&lt;version&gt;</span>${project.version}<span class="tag">&lt;/version&gt;</span> <span class="tag">&lt;/dependency&gt;</span> <span class="comment">&lt;!-- workaround to avoid conflict with plexus-default --&gt;</span> <span class="tag">&lt;dependency&gt;</span> <span class="tag">&lt;groupId&gt;</span>com.google.guava<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>guava<span class="tag">&lt;/artifactId&gt;</span> <span class="tag">&lt;version&gt;</span>16.0.1<span class="tag">&lt;/version&gt;</span> <span class="tag">&lt;/dependency&gt;</span> <span class="tag">&lt;/dependencies&gt;</span> <span class="tag">&lt;executions&gt;</span> <span class="tag">&lt;execution&gt;</span> <span class="tag">&lt;phase&gt;</span>test<span class="tag">&lt;/phase&gt;</span> <span class="tag">&lt;goals&gt;</span> <span class="tag">&lt;goal&gt;</span>validate<span class="tag">&lt;/goal&gt;</span> <i class="conum" data-value="5"></i><b>(5)</b> <span class="tag">&lt;/goals&gt;</span> <span class="tag">&lt;/execution&gt;</span> <span class="tag">&lt;/executions&gt;</span> <span class="tag">&lt;/plugin&gt;</span> <span class="tag">&lt;/plugins&gt;</span> <span class="tag">&lt;/build&gt;</span> <span class="tag">&lt;/profile&gt;</span></code></pre> </div> </div> <div class="colist arabic"> <table> <tr> <td><i class="conum" data-value="1"></i><b>1</b></td> <td>the profile is active by default, though can be disabled using <code>-Dskip.isis-validate</code></td> </tr> <tr> <td><i class="conum" data-value="2"></i><b>2</b></td> <td>set to <code>1.10.0</code> (or any later version)</td> </tr> <tr> <td><i class="conum" data-value="3"></i><b>3</b></td> <td>the manifest discussed previously; adjust as required</td> </tr> <tr> <td><i class="conum" data-value="4"></i><b>4</b></td> <td>the <code>dom</code> module for the project; adjust as required</td> </tr> <tr> <td><i class="conum" data-value="5"></i><b>5</b></td> <td>binds the plugin&#8217;s <code>validate</code> goal to the Maven <code>test</code> lifecycle phase (ie the goal will be called when <code>mvn test</code> is run).</td> </tr> </table> </div> </div> <div class="sect3"> <h4 id="_to_run">5.2.2. To run</h4> <div class="paragraph"> <p>The plugin is activated by default, so is run simply using:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">mvn test</code></pre> </div> </div> <div class="paragraph"> <p>This will run any tests, and then also - because the plugin is activated by the <code>isis-validate</code> property and bound to the <code>test</code> phase, will run the plugin&#8217;s <code>validate</code> goal.</p> </div> <div class="paragraph"> <p>If for any reason you want to disable the validation, use:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">mvn test -Dskip.isis-validate</code></pre> </div> </div> </div> <div class="sect3"> <h4 id="_example_of_failure">5.2.3. Example of failure</h4> <div class="paragraph"> <p>In the <a href="ugfun.html#_ugfun_getting-started_simpleapp-archetype">SimpleApp</a> application the <code>SimpleObject</code> defines an <code>updateName</code> action. This has a supporting method:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="java"><span class="directive">public</span> SimpleObject updateName( ... ) { ... } <span class="directive">public</span> <span class="predefined-type">String</span> default0UpdateName() { ... }</code></pre> </div> </div> <div class="paragraph"> <p>We can introduce an error by misspelling the supporting method, for example:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="java"><span class="directive">public</span> <span class="predefined-type">String</span> default0XUpdateName() { ... }</code></pre> </div> </div> <div class="paragraph"> <p>Running <code>mvn test</code> then generates this output:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">[error] [error] [error] [error] domainapp.dom.simple.SimpleObject#default0XUpdateName: has prefix default, is probably a supporting method for a property, collection or action. If the method is intended to be an action, then rename and use @ActionLayout(named=&quot;...&quot;) or ignore completely using @Programmatic [error] [error] [error] [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Simple App ......................................... SUCCESS [ 0.087 s] [INFO] Simple App DOM ..................................... FAILURE [ 4.182 s] [INFO] Simple App Fixtures ................................ SKIPPED [INFO] Simple App Application ............................. SKIPPED [INFO] Simple App Integration Tests ....................... SKIPPED [INFO] Simple App Webapp .................................. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] ... [ERROR] Failed to execute goal org.apache.isis.tool:isis-maven-plugin:1.12.0-SNAPSHOT:validate (default) on project simpleapp-dom: 1 problems found. -&gt; [Help 1]</code></pre> </div> </div> <div class="paragraph"> <p>If one were to attempt to run the application, the same error would appear in the log files on startup (and the application would not boot).</p> </div> </div> <div class="sect3"> <h4 id="_custom_validation_rules">5.2.4. Custom validation rules</h4> <div class="paragraph"> <p>It is also possible to customize the validation, explained <a href="ugbtb.html#_ugbtb_programming-model_custom-validator">here</a>. For example, you could enforce project-specific conventions by implementing a custom <code>MetaModelValidator</code>, and registering using a configuration property.</p> </div> <div class="paragraph"> <p>To support this using <code>AppManifest`s, override its `getConfigurationProperties()</code> method:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="ini">public class DomainAppDomManifest implements AppManifest { ... public Map&lt;String, String&gt; getConfigurationProperties() { final Map&lt;String, String&gt; map = Maps.newTreeMap(); map.put(&quot;isis.reflector.validator&quot;,&quot;com.mycompany.myapp.MyMetaModelValidator&quot;); return map; } }</code></pre> </div> </div> </div> <div class="sect3"> <h4 id="_1_9_0_version">5.2.5. 1.9.0 version</h4> <div class="paragraph"> <p>The <code>1.9.0</code> version of the plugin requires slightly different configuratoin. Rather than using an <code>AppManifest</code>, instead the configuration directory containing <code>isis.properties</code> is specified:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="xml"><span class="tag">&lt;profile&gt;</span> <span class="tag">&lt;id&gt;</span>isis-validate<span class="tag">&lt;/id&gt;</span> <span class="tag">&lt;activation&gt;</span> <span class="tag">&lt;activeByDefault&gt;</span>false<span class="tag">&lt;/activeByDefault&gt;</span> <i class="conum" data-value="1"></i><b>(1)</b> <span class="tag">&lt;/activation&gt;</span> <span class="tag">&lt;build&gt;</span> <span class="tag">&lt;plugins&gt;</span> <span class="tag">&lt;plugin&gt;</span> <span class="tag">&lt;groupId&gt;</span>org.apache.isis.tool<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>isis-maven-plugin<span class="tag">&lt;/artifactId&gt;</span> <span class="tag">&lt;version&gt;</span>1.9.0-SNAPSHOT<span class="tag">&lt;/version&gt;</span> <span class="tag">&lt;configuration&gt;</span> <span class="tag">&lt;isisConfigDir&gt;</span>../webapp/src/main/webapp/WEB-INF<span class="tag">&lt;/isisConfigDir&gt;</span> <i class="conum" data-value="2"></i><b>(2)</b> <span class="tag">&lt;/configuration&gt;</span> <span class="tag">&lt;dependencies&gt;</span> <span class="tag">&lt;dependency&gt;</span> <span class="tag">&lt;groupId&gt;</span>org.apache.isis.example.application<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>simpleapp-dom<span class="tag">&lt;/artifactId&gt;</span> <span class="tag">&lt;version&gt;</span>1.9.0-SNAPSHOT<span class="tag">&lt;/version&gt;</span> <span class="tag">&lt;/dependency&gt;</span> <span class="comment">&lt;!-- workaround to avoid conflict with plexus-default --&gt;</span> <span class="tag">&lt;dependency&gt;</span> <span class="tag">&lt;groupId&gt;</span>com.google.guava<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>guava<span class="tag">&lt;/artifactId&gt;</span> <span class="tag">&lt;version&gt;</span>16.0.1<span class="tag">&lt;/version&gt;</span> <span class="tag">&lt;/dependency&gt;</span> <span class="tag">&lt;/dependencies&gt;</span> <span class="tag">&lt;executions&gt;</span> <span class="tag">&lt;execution&gt;</span> <span class="tag">&lt;phase&gt;</span>test<span class="tag">&lt;/phase&gt;</span> <span class="tag">&lt;goals&gt;</span> <span class="tag">&lt;goal&gt;</span>validate<span class="tag">&lt;/goal&gt;</span> <span class="tag">&lt;/goals&gt;</span> <span class="tag">&lt;/execution&gt;</span> <span class="tag">&lt;/executions&gt;</span> <span class="tag">&lt;/plugin&gt;</span> <span class="tag">&lt;/plugins&gt;</span> <span class="tag">&lt;/build&gt;</span> <span class="tag">&lt;/profile&gt;</span></code></pre> </div> </div> <div class="colist arabic"> <table> <tr> <td><i class="conum" data-value="1"></i><b>1</b></td> <td>activated using the <code>-P</code> profile flag rather than a <code>-D</code> system property</td> </tr> <tr> <td><i class="conum" data-value="2"></i><b>2</b></td> <td>specify the <code>isisConfigDir</code> directory (containing the <code>isis.properties</code> file).</td> </tr> </table> </div> <div class="paragraph"> <p>To use the <code>1.9.0</code> version, use:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">mvn -P isis-validate test</code></pre> </div> </div> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> <div class="paragraph"> <p>Note that the <code>isisConfigDir</code> property was removed in <code>1.10.0</code>; only the <code>AppManifest</code> approach is supported.</p> </div> </td> </tr> </table> </div> </div> </div> <div class="sect2"> <h3 id="_cgcon_isis-maven-plugin_swagger">5.3. <code>swagger</code> goal</h3> <div class="paragraph"> <p>The <code>swagger</code> goal of the <code>isis-maven-plugin</code> uses the <a href="rgsvc.html#_rgsvc_api_SwaggerService"><code>SwaggerService</code></a> to generate <a href="http://swagger.io">Swagger</a> spec files to describe the public and/or private RESTful APIs exposed by the <a href="ugvro.html">RestfulObjects viewer</a>.</p> </div> <div class="paragraph"> <p>These spec files, once generated, can then be used in the build pipeline to generate client-side stubs, typically using Swagger&#8217;s own <a href="https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen-maven-plugin">swagger-codegen-maven</a> plugin.</p> </div> <div class="paragraph"> <p>The <code>swagger</code> goal defines the following properties:</p> </div> <div class="ulist"> <ul> <li> <p><code>appManifest</code> - fully qualified class name for the app manifest used to bootstrap the application (see discussion above)</p> </li> <li> <p><code>fileNamePrefix</code> - (optional) a prefix to the generated file names (is suffixed by the requested visibilities, see below).<br></p> <div class="paragraph"> <p>Defaults to <code>swagger</code>.</p> </div> </li> <li> <p><code>visibilities</code> - (optional) list of required visibilities.<br></p> <div class="paragraph"> <p>Defaults to [<code>PUBLIC</code>, <code>PRIVATE</code>] (meaning that two spec files will be created).</p> </div> </li> <li> <p><code>format</code> - (optional) which format to generate, either <code>JSON</code> or <code>YAML</code>.<br></p> <div class="paragraph"> <p>Defaults to <code>JSON</code>.</p> </div> </li> <li> <p><code>output</code> - (optional) subdirectory under the <code>target</code> directory to generate the swagger spec files<br></p> <div class="paragraph"> <p>Defaults to <code>generated-resources/isis-swagger</code></p> </div> </li> </ul> </div> <div class="sect3"> <h4 id="__code_dom_code_submodule_2">5.3.1. <code>dom</code> submodule</h4> <div class="paragraph"> <p>Update the <code>pom.xml</code> (in your project&#8217;s <code>dom</code> module):</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="xml"><span class="tag">&lt;profile&gt;</span> <span class="tag">&lt;id&gt;</span>isis-swagger<span class="tag">&lt;/id&gt;</span> <span class="tag">&lt;activation&gt;</span> <span class="tag">&lt;property&gt;</span> <span class="tag">&lt;name&gt;</span>!skip.isis-swagger<span class="tag">&lt;/name&gt;</span> <i class="conum" data-value="1"></i><b>(1)</b> <span class="tag">&lt;/property&gt;</span> <span class="tag">&lt;/activation&gt;</span> <span class="tag">&lt;build&gt;</span> <span class="tag">&lt;plugins&gt;</span> <span class="tag">&lt;plugin&gt;</span> <span class="tag">&lt;groupId&gt;</span>org.apache.isis.tool<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>isis-maven-plugin<span class="tag">&lt;/artifactId&gt;</span> <span class="tag">&lt;version&gt;</span>${isis.version}<span class="tag">&lt;/version&gt;</span> <i class="conum" data-value="2"></i><b>(2)</b> <span class="tag">&lt;configuration&gt;</span> <span class="tag">&lt;appManifest&gt;</span>domainapp.dom.DomainAppDomManifest<span class="tag">&lt;/appManifest&gt;</span> <i class="conum" data-value="3"></i><b>(3)</b> <span class="tag">&lt;visibilities&gt;</span> <i class="conum" data-value="4"></i><b>(4)</b> <span class="tag">&lt;visibility&gt;</span>PUBLIC<span class="tag">&lt;/visibility&gt;</span> <span class="tag">&lt;visibility&gt;</span>PRIVATE<span class="tag">&lt;/visibility&gt;</span> <span class="tag">&lt;/visibilities&gt;</span> <span class="tag">&lt;format&gt;</span>JSON<span class="tag">&lt;/format&gt;</span> <i class="conum" data-value="5"></i><b>(5)</b> <span class="tag">&lt;fileNamePrefix&gt;</span>swagger<span class="tag">&lt;/fileNamePrefix&gt;</span> <i class="conum" data-value="5"></i><b>(5)</b> <span class="tag">&lt;/configuration&gt;</span> <span class="tag">&lt;dependencies&gt;</span> <span class="tag">&lt;dependency&gt;</span> <span class="tag">&lt;groupId&gt;</span>${project.groupId}<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>simpleapp-dom<span class="tag">&lt;/artifactId&gt;</span> <i class="conum" data-value="6"></i><b>(6)</b> <span class="tag">&lt;version&gt;</span>${project.version}<span class="tag">&lt;/version&gt;</span> <span class="tag">&lt;/dependency&gt;</span> <span class="tag">&lt;dependency&gt;</span> <span class="tag">&lt;groupId&gt;</span>com.google.guava<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>guava<span class="tag">&lt;/artifactId&gt;</span> <span class="tag">&lt;version&gt;</span>16.0.1<span class="tag">&lt;/version&gt;</span> <span class="tag">&lt;/dependency&gt;</span> <span class="tag">&lt;/dependencies&gt;</span> <span class="tag">&lt;executions&gt;</span> <span class="tag">&lt;execution&gt;</span> <span class="tag">&lt;phase&gt;</span>package<span class="tag">&lt;/phase&gt;</span> <span class="tag">&lt;goals&gt;</span> <span class="tag">&lt;goal&gt;</span>swagger<span class="tag">&lt;/goal&gt;</span> <i class="conum" data-value="7"></i><b>(7)</b> <span class="tag">&lt;/goals&gt;</span> <span class="tag">&lt;/execution&gt;</span> <span class="tag">&lt;/executions&gt;</span> <span class="tag">&lt;/plugin&gt;</span> <span class="tag">&lt;/plugins&gt;</span> <span class="tag">&lt;/build&gt;</span> <span class="tag">&lt;/profile&gt;</span></code></pre> </div> </div> <div class="colist arabic"> <table> <tr> <td><i class="conum" data-value="1"></i><b>1</b></td> <td>the profile is active by default, though can be disabled using <code>-Dskip.isis-swagger</code></td> </tr> <tr> <td><i class="conum" data-value="2"></i><b>2</b></td> <td>set to <code>1.11.0</code> (or any later version)</td> </tr> <tr> <td><i class="conum" data-value="3"></i><b>3</b></td> <td>the manifest discussed previously; adjust as required</td> </tr> <tr> <td><i class="conum" data-value="4"></i><b>4</b></td> <td>the visibilities to create (one swagger spec file per visibility listed)</td> </tr> <tr> <td><i class="conum" data-value="5"></i><b>5</b></td> <td>which file format to generate the spec files as.</td> </tr> <tr> <td><i class="conum" data-value="6"></i><b>6</b></td> <td>the <code>dom</code> module for the project; adjust as required</td> </tr> <tr> <td><i class="conum" data-value="7"></i><b>7</b></td> <td>binds the plugin&#8217;s <code>swagger</code> goal to the Maven <code>package</code> lifecycle phase (ie the goal will be called when <code>mvn package</code> is run).</td> </tr> </table> </div> </div> <div class="sect3"> <h4 id="_to_run_2">5.3.2. To run</h4> <div class="paragraph"> <p>The plugin is activated by default, so is run simply using:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">mvn package</code></pre> </div> </div> </div> </div> <div class="sect2"> <h3 id="_cgcon_isis-maven-plugin_xsd">5.4. <code>xsd</code> goal</h3> <div class="paragraph"> <p>The <code>xsd</code> goal of the <code>isis-maven-plugin</code> uses the <a href="rgsvc.html#_rgsvc_api_JaxbService"><code>JaxbService</code></a> to generate XSD schemas from any JAXB-annotated <a href="ugbtb.html#_ugbtb_view-models">view model/DTOs</a>.</p> </div> <div class="paragraph"> <p>This is instead of and preferable to using the JAXB <a href="https://jaxb.java.net/2.2.4/docs/schemagen.html">schemagen</a> tool, because it uses the framework&#8217;s support (via <a href="rgant.html#_rgant-XmlJavaValueType"><code>@XmlJavaValueType</code></a>) to translate any references to domain objects into <code>OidDto</code>s (as defined by the Apache Isis <a href="rgcms.html#_rgcms_schema-common">common schema</a>).</p> </div> <div class="paragraph"> <p>The <code>xsd</code> goal defines the following properties:</p> </div> <div class="ulist"> <ul> <li> <p><code>appManifest</code> - fully qualified class name for the app manifest used to bootstrap the application (see discussion above)</p> </li> <li> <p><code>jaxbClasses</code> - a list of <a href="rg.html#_ugbtb_view-models_jaxb">JAXB-annotated view model</a> classes;</p> </li> <li> <p><code>output</code> - (optional) subdirectory under the <code>target</code> directory to generate the XSDs<br></p> <div class="paragraph"> <p>Defaults to <code>generated-resources/isis-xsd</code></p> </div> </li> <li> <p><code>separate</code> - (optional) whether to create separate directories for each JAXB-class.<br></p> <div class="paragraph"> <p>Defaults to <code>false</code>. Most DTO classes will reference one another or the <a href="rgcms.html#_rgcms_schema-common">common schema</a>. Normally it&#8217;s fine to merge all these XSDs together. This property, if set, results in each a separate directory for each generation of its XSD or XSDs.</p> </div> </li> </ul> </div> <div class="paragraph"> <p>As a convenience to any (Java) consumers, the XSDs generated from the view models can then in turn be generated into DTOs. The original view models and these DTOs are similar but not identical: while the view models can only be used within the Isis application (they may reference underlying domain entities) whereas the DTO classes generated from the XSDs can be used standalone, eg by a Java subscriber running on an ESB such as Apache Camel.</p> </div> <div class="paragraph"> <p>The rest of this section explains how to configure a new <code>xsd</code> submodule that uses the <code>isis-maven-plugin</code> along with other standard plugins in order to generate both XSDs and DTOs. The <code>pom.xml</code> described below uses Maven profiles to separate out these two responsibilities.</p> </div> <div class="sect3"> <h4 id="_cgcon_isis-maven-plugin_xsd">5.4.1. <code>xsd</code> submodule</h4> <div class="paragraph"> <p>We recommend creating a new submodule that will perform the following build steps:</p> </div> <div class="ulist"> <ul> <li> <p>run the <code>xsd</code> goal (in the <code>generate-resources</code> phase) to generate the XSDs from the specified view model/DTOs</p> </li> <li> <p>use the <a href="http://maven.apache.org/plugins/maven-assembly-plugin/">maven-assembly-plugin</a> to bundle the generated XSD files into a zip file.</p> </li> <li> <p>use the <code>xjc-gen</code> to generate corresponding DTO classes from the XSDs.<br></p> <div class="paragraph"> <p>These are <em>not</em> the same as the original view models; they are provided as a convenience for subscribers to marshall XML documents into Java classes, but running as a standalone process (not part of the Isis app)</p> </div> </li> </ul> </div> <div class="paragraph"> <p>These two main responsibilities can then be placed into separate Maven profiles, for better modularity. The diagram below shows the overall design:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/maven-plugin/xsd-goal.png"><img src="images/maven-plugin/xsd-goal.png" alt="xsd goal" width="800px"></a> </div> </div> <div class="paragraph"> <p>For example, here is the <code>pom.xml</code> file for the (non-ASF) <a href="http://github.com/isisaddons/isis-app-todoapp">Isis addons' todoapp</a> example app&#8217;s <code>todoapp-xsd</code> submodule.</p> </div> <div class="paragraph"> <p>First, the usual boilerplate:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="xml"><span class="preprocessor">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span> <span class="tag">&lt;project</span> <span class="attribute-name">xmlns</span>=<span class="string"><span class="delimiter">&quot;</span><span class="content">http://maven.apache.org/POM/4.0.0</span><span class="delimiter">&quot;</span></span> <span class="attribute-name">xmlns:xsi</span>=<span class="string"><span class="delimiter">&quot;</span><span class="content">http://www.w3.org/2001/XMLSchema-instance</span><span class="delimiter">&quot;</span></span> <span class="attribute-name">xsi:schemaLocation</span>=<span class="string"><span class="delimiter">&quot;</span><span class="content">http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd</span><span class="delimiter">&quot;</span></span><span class="tag">&gt;</span> <span class="tag">&lt;modelVersion&gt;</span>4.0.0<span class="tag">&lt;/modelVersion&gt;</span> <span class="tag">&lt;parent&gt;</span> <span class="tag">&lt;groupId&gt;</span>org.isisaddons.app<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>todoapp<span class="tag">&lt;/artifactId&gt;</span> <span class="tag">&lt;version&gt;</span>1.12.0-SNAPSHOT<span class="tag">&lt;/version&gt;</span> <span class="tag">&lt;/parent&gt;</span> <span class="tag">&lt;artifactId&gt;</span>todoapp-xsd<span class="tag">&lt;/artifactId&gt;</span> <span class="tag">&lt;name&gt;</span>Isis Addons ToDoApp XSD<span class="tag">&lt;/name&gt;</span> <span class="tag">&lt;dependencies&gt;</span> <span class="tag">&lt;dependency&gt;</span> <span class="tag">&lt;groupId&gt;</span>${project.groupId}<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>todoapp-app<span class="tag">&lt;/artifactId&gt;</span> <i class="conum" data-value="1"></i><b>(1)</b> <span class="tag">&lt;/dependency&gt;</span> <span class="tag">&lt;/dependencies&gt;</span> <span class="tag">&lt;profiles&gt;</span> <span class="tag">&lt;profile&gt;</span> <span class="tag">&lt;id&gt;</span>isis-xsd<span class="tag">&lt;/id&gt;</span> <i class="conum" data-value="2"></i><b>(2)</b> ... <span class="tag">&lt;/profile&gt;</span> <span class="tag">&lt;profile&gt;</span> <span class="tag">&lt;id&gt;</span>xjc<span class="tag">&lt;/id&gt;</span> <i class="conum" data-value="3"></i><b>(3)</b> ... <span class="tag">&lt;/profile&gt;</span> <span class="tag">&lt;/profiles&gt;</span> <span class="tag">&lt;/project&gt;</span></code></pre> </div> </div> <div class="colist arabic"> <table> <tr> <td><i class="conum" data-value="1"></i><b>1</b></td> <td>depends on the rest of the application&#8217;s modules</td> </tr> <tr> <td><i class="conum" data-value="2"></i><b>2</b></td> <td>XSD generation, to run the <code>xsd</code> goal and then assemble into a zip file; within a profile for modularity</td> </tr> <tr> <td><i class="conum" data-value="3"></i><b>3</b></td> <td>XJC generation, to run the <code>xjc</code> to generate Java DTO classes from XSDs; within a profile for modularity</td> </tr> </table> </div> <div class="sect4"> <h5 id="_xsd_profile">XSD profile</h5> <div class="paragraph"> <p>The <code>isis-xsd</code> profile runs the <code>xsd</code> goal of the <code>isis-maven-plugin</code>; these are then zipped up by the assembly plugin:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="xml"><span class="tag">&lt;profile&gt;</span> <span class="tag">&lt;id&gt;</span>isis-xsd<span class="tag">&lt;/id&gt;</span> <span class="tag">&lt;activation&gt;</span> <span class="tag">&lt;property&gt;</span> <span class="tag">&lt;name&gt;</span>!skip.isis-xsd<span class="tag">&lt;/name&gt;</span> <i class="conum" data-value="1"></i><b>(1)</b> <span class="tag">&lt;/property&gt;</span> <span class="tag">&lt;/activation&gt;</span> <span class="tag">&lt;build&gt;</span> <span class="tag">&lt;plugins&gt;</span> <span class="tag">&lt;plugin&gt;</span> <span class="tag">&lt;groupId&gt;</span>org.apache.isis.tool<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>isis-maven-plugin<span class="tag">&lt;/artifactId&gt;</span> <span class="tag">&lt;version&gt;</span>${isis.version}<span class="tag">&lt;/version&gt;</span> <span class="tag">&lt;configuration&gt;</span> <span class="tag">&lt;appManifest&gt;</span>todoapp.dom.ToDoAppDomManifest<span class="tag">&lt;/appManifest&gt;</span> <i class="conum" data-value="2"></i><b>(2)</b> <span class="tag">&lt;jaxbClasses&gt;</span> <i class="conum" data-value="3"></i><b>(3)</b> <span class="tag">&lt;jaxbClass&gt;</span>todoapp.app.viewmodels.todoitem.v1_0.ToDoItemDto<span class="tag">&lt;/jaxbClass&gt;</span> <span class="tag">&lt;jaxbClass&gt;</span>todoapp.app.viewmodels.todoitem.v1_1.ToDoItemDto<span class="tag">&lt;/jaxbClass&gt;</span> <span class="tag">&lt;/jaxbClasses&gt;</span> <span class="tag">&lt;/configuration&gt;</span> <span class="tag">&lt;dependencies&gt;</span> <span class="tag">&lt;dependency&gt;</span> <span class="tag">&lt;groupId&gt;</span>${project.groupId}<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>todoapp-dom<span class="tag">&lt;/artifactId&gt;</span> <span class="tag">&lt;version&gt;</span>${project.version}<span class="tag">&lt;/version&gt;</span> <span class="tag">&lt;/dependency&gt;</span> <span class="tag">&lt;dependency&gt;</span> <i class="conum" data-value="4"></i><b>(4)</b> <span class="tag">&lt;groupId&gt;</span>com.google.guava<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>guava<span class="tag">&lt;/artifactId&gt;</span> <span class="tag">&lt;version&gt;</span>16.0.1<span class="tag">&lt;/version&gt;</span> <span class="tag">&lt;/dependency&gt;</span> <span class="tag">&lt;/dependencies&gt;</span> <span class="tag">&lt;executions&gt;</span> <span class="tag">&lt;execution&gt;</span> <span class="tag">&lt;phase&gt;</span>generate-sources<span class="tag">&lt;/phase&gt;</span> <i class="conum" data-value="5"></i><b>(5)</b> <span class="tag">&lt;goals&gt;</span> <span class="tag">&lt;goal&gt;</span>xsd<span class="tag">&lt;/goal&gt;</span> <i class="conum" data-value="6"></i><b>(6)</b> <span class="tag">&lt;/goals&gt;</span> <span class="tag">&lt;/execution&gt;</span> <span class="tag">&lt;/executions&gt;</span> <span class="tag">&lt;/plugin&gt;</span> <span class="tag">&lt;plugin&gt;</span> <span class="tag">&lt;artifactId&gt;</span>maven-assembly-plugin<span class="tag">&lt;/artifactId&gt;</span> <i class="conum" data-value="7"></i><b>(7)</b> <span class="tag">&lt;version&gt;</span>2.5.3<span class="tag">&lt;/version&gt;</span> <span class="tag">&lt;configuration&gt;</span> <span class="tag">&lt;descriptor&gt;</span>src/assembly/dep.xml<span class="tag">&lt;/descriptor&gt;</span> <i class="conum" data-value="8"></i><b>(8)</b> <span class="tag">&lt;/configuration&gt;</span> <span class="tag">&lt;executions&gt;</span> <span class="tag">&lt;execution&gt;</span> <span class="tag">&lt;id&gt;</span>create-archive<span class="tag">&lt;/id&gt;</span> <span class="tag">&lt;phase&gt;</span>package<span class="tag">&lt;/phase&gt;</span> <span class="tag">&lt;goals&gt;</span> <span class="tag">&lt;goal&gt;</span>single<span class="tag">&lt;/goal&gt;</span> <span class="tag">&lt;/goals&gt;</span> <span class="tag">&lt;/execution&gt;</span> <span class="tag">&lt;/executions&gt;</span> <span class="tag">&lt;/plugin&gt;</span> <span class="tag">&lt;/plugins&gt;</span> <span class="tag">&lt;/build&gt;</span> <span class="tag">&lt;/profile&gt;</span></code></pre> </div> </div> <div class="colist arabic"> <table> <tr> <td><i class="conum" data-value="1"></i><b>1</b></td> <td>enabled <em>unless</em> <code>skip.isis-xsd</code> property specified</td> </tr> <tr> <td><i class="conum" data-value="2"></i><b>2</b></td> <td>specify the app manifest to bootstrap the Isis runtime within the maven plugin</td> </tr> <tr> <td><i class="conum" data-value="3"></i><b>3</b></td> <td>enumerate all JAXB-annotated view models</td> </tr> <tr> <td><i class="conum" data-value="4"></i><b>4</b></td> <td>workaround to avoid conflict with plexus-default</td> </tr> <tr> <td><i class="conum" data-value="5"></i><b>5</b></td> <td>by default is bound to <code>generate-resources</code>, but bind instead to <code>generate-sources</code> if also running the <code>xjc</code> profile: the XSD are an input to <code>xjc</code>, but it is bound by default to <code>generate-sources</code> and the <code>generate-sources</code> phase runs before the <code>generate-resources</code>.</td> </tr> <tr> <td><i class="conum" data-value="6"></i><b>6</b></td> <td>run the <code>xsd</code> goal</td> </tr> <tr> <td><i class="conum" data-value="7"></i><b>7</b></td> <td>define the assembly plugin</td> </tr> <tr> <td><i class="conum" data-value="8"></i><b>8</b></td> <td>assembles the XSD schemas into a zip file, as defined by the <code>dep.xml</code> file (see below).</td> </tr> </table> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="xml"><span class="tag">&lt;assembly</span> <span class="attribute-name">xmlns</span>=<span class="string"><span class="delimiter">&quot;</span><span class="content">http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2</span><span class="delimiter">&quot;</span></span> <span class="attribute-name">xmlns:xsi</span>=<span class="string"><span class="delimiter">&quot;</span><span class="content">http://www.w3.org/2001/XMLSchema-instance</span><span class="delimiter">&quot;</span></span> <span class="attribute-name">xsi:schemaLocation</span>=<span class="string"><span class="delimiter">&quot;</span><span class="content">http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2</span> <span class="content">http://maven.apache.org/xsd/assembly-1.1.2.xsd</span><span class="delimiter">&quot;</span></span><span class="tag">&gt;</span> <span class="tag">&lt;id&gt;</span>xsd<span class="tag">&lt;/id&gt;</span> <span class="tag">&lt;formats&gt;</span> <span class="tag">&lt;format&gt;</span>zip<span class="tag">&lt;/format&gt;</span> <span class="tag">&lt;/formats&gt;</span> <span class="tag">&lt;fileSets&gt;</span> <span class="tag">&lt;fileSet&gt;</span> <span class="tag">&lt;directory&gt;</span>${project.build.directory}/generated-resources/isis-xsd<span class="tag">&lt;/directory&gt;</span> <i class="conum" data-value="1"></i><b>(1)</b> <span class="tag">&lt;outputDirectory&gt;</span>/<span class="tag">&lt;/outputDirectory&gt;</span> <span class="tag">&lt;/fileSet&gt;</span> <span class="tag">&lt;/fileSets&gt;</span> <span class="tag">&lt;/assembly&gt;</span></code></pre> </div> </div> <div class="colist arabic"> <table> <tr> <td><i class="conum" data-value="1"></i><b>1</b></td> <td>the location that the <code>xsd</code> goal writes to.</td> </tr> </table> </div> </div> <div class="sect4"> <h5 id="_xjc_profile">XJC profile</h5> <div class="paragraph"> <p>The <code>xjc</code> profile reads the XSD generated by the <code>xsd</code> goal, and from it generates Java DTOs. Note that this isn&#8217;t round-tripping: the original view model is only for use within the Isis app, whereas the DTO generated from the XSDs is for use in a standalone context, eg in a Java subscriber on an event bus.</p> </div> <div class="paragraph"> <p>The <code>xjc</code> profile is defined as:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="xml"><span class="tag">&lt;profile&gt;</span> <span class="tag">&lt;id&gt;</span>xjc<span class="tag">&lt;/id&gt;</span> <span class="tag">&lt;activation&gt;</span> <span class="tag">&lt;property&gt;</span> <span class="tag">&lt;name&gt;</span>!skip.xjc<span class="tag">&lt;/name&gt;</span> <i class="conum" data-value="1"></i><b>(1)</b> <span class="tag">&lt;/property&gt;</span> <span class="tag">&lt;/activation&gt;</span> <span class="tag">&lt;build&gt;</span> <span class="tag">&lt;plugins&gt;</span> <span class="tag">&lt;plugin&gt;</span> <span class="tag">&lt;groupId&gt;</span>org.jvnet.jaxb2.maven2<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>maven-jaxb2-plugin<span class="tag">&lt;/artifactId&gt;</span> <span class="tag">&lt;version&gt;</span>0.12.3<span class="tag">&lt;/version&gt;</span> <span class="tag">&lt;executions&gt;</span> <span class="tag">&lt;execution&gt;</span> <span class="tag">&lt;id&gt;</span>xjc-generate<span class="tag">&lt;/id&gt;</span> <span class="tag">&lt;phase&gt;</span>generate-sources<span class="tag">&lt;/phase&gt;</span> <span class="tag">&lt;goals&gt;</span> <span class="tag">&lt;goal&gt;</span>generate<span class="tag">&lt;/goal&gt;</span> <span class="tag">&lt;/goals&gt;</span> <span class="tag">&lt;/execution&gt;</span> <span class="tag">&lt;/executions&gt;</span> <span class="tag">&lt;configuration&gt;</span> <span class="tag">&lt;removeOldOutput&gt;</span>true<span class="tag">&lt;/removeOldOutput&gt;</span> <span class="tag">&lt;schemaDirectory&gt;</span> <i class="conum" data-value="2"></i><b>(2)</b> target/generated-resources/isis-xsd/viewmodels.app.todoapp/todoitem <span class="tag">&lt;/schemaDirectory&gt;</span> <span class="tag">&lt;schemaIncludes&gt;</span> <i class="conum" data-value="3"></i><b>(3)</b> <span class="tag">&lt;schemaInclude&gt;</span>v1_0/todoitem.xsd<span class="tag">&lt;/schemaInclude&gt;</span> <span class="tag">&lt;schemaInclude&gt;</span>v1_1/todoitem.xsd<span class="tag">&lt;/schemaInclude&gt;</span> <span class="tag">&lt;/schemaIncludes&gt;</span> <span class="tag">&lt;catalog&gt;</span>src/main/resources/catalog.xml<span class="tag">&lt;/catalog&gt;</span> <i class="conum" data-value="4"></i><b>(4)</b> <span class="tag">&lt;/configuration&gt;</span> <span class="tag">&lt;/plugin&gt;</span> <span class="tag">&lt;plugin&gt;</span> <span class="tag">&lt;groupId&gt;</span>org.codehaus.mojo<span class="tag">&lt;/groupId&gt;</span> <span class="tag">&lt;artifactId&gt;</span>build-helper-maven-plugin<span class="tag">&lt;/artifactId&gt;</span> <i class="conum" data-value="5"></i><b>(5)</b> <span class="tag">&lt;version&gt;</span>1.9.1<span class="tag">&lt;/version&gt;</span> <span class="tag">&lt;executions&gt;</span> <span class="tag">&lt;execution&gt;</span> <span class="tag">&lt;id&gt;</span>add-source<span class="tag">&lt;/id&gt;</span> <span class="tag">&lt;phase&gt;</span>generate-sources<span class="tag">&lt;/phase&gt;</span> <span class="tag">&lt;goals&gt;</span> <span class="tag">&lt;goal&gt;</span>add-source<span class="tag">&lt;/goal&gt;</span> <span class="tag">&lt;/goals&gt;</span> <span class="tag">&lt;configuration&gt;</span> <span class="tag">&lt;sources&gt;</span> <span class="tag">&lt;source&gt;</span>target/generated-sources/xjc<span class="tag">&lt;/source&gt;</span> <i class="conum" data-value="6"></i><b>(6)</b> <span class="tag">&lt;/sources&gt;</span> <span class="tag">&lt;/configuration&gt;</span> <span class="tag">&lt;/execution&gt;</span> <span class="tag">&lt;/executions&gt;</span> <span class="tag">&lt;/plugin&gt;</span> <span class="tag">&lt;/plugins&gt;</span> <span class="tag">&lt;/build&gt;</span> <span class="tag">&lt;/profile&gt;</span></code></pre> </div> </div> <div class="colist arabic"> <table> <tr> <td><i class="conum" data-value="1"></i><b>1</b></td> <td>enabled <em>unless</em> <code>skip.xjc</code> property specified</td> </tr> <tr> <td><i class="conum" data-value="2"></i><b>2</b></td> <td>specifies the directory that the XSD schemas were generated to by the <code>isis-maven-plugin</code></td> </tr> <tr> <td><i class="conum" data-value="3"></i><b>3</b></td> <td>specify each of the XSDs to be processed</td> </tr> <tr> <td><i class="conum" data-value="4"></i><b>4</b></td> <td>catalog file indicates the location of the referenced <a href="_rgcms_schema-common">common schema</a> XSDs.</td> </tr> <tr> <td><i class="conum" data-value="5"></i><b>5</b></td> <td>the <code>build-helper-maven-plugin</code> adds the Java source generated by the <code>xjc</code> plugin so that it can be compiled and packaged as any other code</td> </tr> <tr> <td><i class="conum" data-value="6"></i><b>6</b></td> <td>the location that the <code>xjc</code> plugin generates its source code.</td> </tr> </table> </div> <div class="paragraph"> <p>The referenced <code>catalog.xml</code> file instructs the <code>xjc</code> plugin how to resolve referenced schema locations. Only a reference for the Apache Isis <a href="_rgcms_schema-common">common schema</a> is likely to be needed:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="xml"><span class="preprocessor">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span> <span class="doctype">&lt;!DOCTYPE catalog PUBLIC &quot;-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN&quot; &quot;http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd&quot;&gt;</span> <span class="tag">&lt;catalog</span> <span class="attribute-name">xmlns</span>=<span class="string"><span class="delimiter">&quot;</span><span class="content">urn:oasis:names:tc:entity:xmlns:xml:catalog</span><span class="delimiter">&quot;</span></span><span class="tag">&gt;</span> <span class="tag">&lt;public</span> <span class="attribute-name">publicId</span>=<span class="string"><span class="delimiter">&quot;</span><span class="content">http://isis.apache.org/schema/common</span><span class="delimiter">&quot;</span></span> <span class="attribute-name">uri</span>=<span class="string"><span class="delimiter">&quot;</span><span class="content">http://isis.apache.org/schema/common/common.xsd</span><span class="delimiter">&quot;</span></span><span class="tag">/&gt;</span> <i class="conum" data-value="1"></i><b>(1)</b> <span class="tag">&lt;/catalog&gt;</span></code></pre> </div> </div> <div class="colist arabic"> <table> <tr> <td><i class="conum" data-value="1"></i><b>1</b></td> <td>resolve the common schema from the Apache Isis website</td> </tr> </table> </div> </div> </div> <div class="sect3"> <h4 id="_to_run_3">5.4.2. To run</h4> <div class="paragraph"> <p>The plugin is activated by default, so is run simply using:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">mvn package</code></pre> </div> </div> <div class="paragraph"> <p>This will generate the XSDs, the DTOs from the XSDs, and package up the XSDs into a ZIP file and the generated DTO class files into a regular JAR package.</p> </div> <div class="paragraph"> <p>If for any reason you want to disable the generation of the DTOs, use:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">mvn package -Dskip.xjc</code></pre> </div> </div> <div class="paragraph"> <p>If you want to disable the generation of both the XSDs and the DTOs, use:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">mvn package -Dskip.xjc -Dskip.isis-xsd</code></pre> </div> </div> </div> </div> </div> </div> <div class="sect1"> <h2 id="_cgcon_building-isis">6. Building Apache Isis</h2> <div class="sectionbody"> <div class="sect2"> <h3 id="_git">6.1. Git</h3> <div class="paragraph"> <p>The Apache Isis source code lives in a git repo.</p> </div> <div class="sect3"> <h4 id="_installation_2">6.1.1. Installation</h4> <div class="paragraph"> <p>The easiest place to get hold of command-line git is probably the <a href="http://git-scm.com/downloads">github download page</a>.</p> </div> <div class="paragraph"> <p>On Windows, this also installs the rather good mSysGit Unix shell. We recommend that you enable git for both the mSysgit and the Windows command prompt:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/building-isis/setting-up-git.png"><img src="images/building-isis/setting-up-git.png" alt="setting up git" width="350px"></a> </div> </div> <div class="paragraph"> <p>Once git is installed, the two main command line tools to note are:</p> </div> <div class="ulist"> <ul> <li> <p><code>git</code> command line tool</p> </li> <li> <p><code>gitk</code> for viewing the commit history</p> </li> </ul> </div> <div class="paragraph"> <p>If using Windows, note that github also have a dedicated <a href="https://help.github.com/articles/set-up-git">Windows client</a>. With a little <a href="http://haacked.com/archive/2012/05/30/using-github-for-windows-with-non-github-repositories.aspx">hacking around</a>, it can also be made to work with non-github repositories.</p> </div> <div class="paragraph"> <p>If using Mac, you might also want to check out Atlassian&#8217;s <a href="http://www.atlassian.com/software/sourcetree/overview">Sourcetree</a>.</p> </div> <div class="sect4"> <h5 id="_cloning_the_apache_isis_repo">Cloning the Apache Isis repo</h5> <div class="paragraph"> <p>First, clone the Apache Isis repo.</p> </div> <div class="paragraph"> <p>If you are a <strong>committer</strong>, then clone from the Apache read/write repo:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git clone https://git-wip-us.apache.org/repos/asf/isis.git</code></pre> </div> </div> <div class="paragraph"> <p>If you are <strong>not a committer</strong>, please see the <a href="#_cgcon_contributing">contributing</a> page for details on which repo to clone from.</p> </div> </div> <div class="sect4"> <h5 id="_configuring_git">Configuring Git</h5> <div class="paragraph"> <p>Next up is to configure your user name and password; see also <a href="https://git-wip-us.apache.org/">Apache&#8217;s git</a> docs:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git config user.name &quot;&lt;i&gt;My Name Here&lt;/i&gt;&quot; git config user.email &lt;i&gt;myusername@apache.org&lt;/i&gt;</code></pre> </div> </div> <div class="paragraph"> <p>Next, configure the <code>core.autocrlf</code> so that line endings are normalized to LF (Unix style) in the rep; again see <a href="https://git-wip-us.apache.org/">Apache&#8217;s git</a> page:</p> </div> <div class="ulist"> <ul> <li> <p>on Windows, use:<br></p> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git config core.autocrlf true</code></pre> </div> </div> </li> <li> <p>on Mac/Linux, use:<br></p> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git config core.autocrlf input</code></pre> </div> </div> </li> </ul> </div> <div class="paragraph"> <p>The Windows setting means that files are converted back to CRLF on checkout; the Mac/Linux setting means that the file is left as LF on checkout.</p> </div> <div class="paragraph"> <p>We also recommend setting <code>core.safecrlf</code>, which aims to ensure that any line ending conversion is repeatable. Do this on all platforms:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git config core.safecrlf true</code></pre> </div> </div> <div class="paragraph"> <p>Note that these settings are supplemented in the repo by the <code>.gitattributes</code> file and that explicitly specifies line handling treatment for most of the common file types that we have.</p> </div> <div class="paragraph"> <p>Next, we recommend you setup this a refspec so that you can distinguish remote tags from local ones. To do that, locate the <code>[remote &quot;origin&quot;]</code> section in your <code>.git/config</code> and add the third entry shown below:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">[remote &quot;origin&quot;] url = ... whatever ... fetch = ... whatever ... fetch = +refs/tags/*:refs/tags/origin/*</code></pre> </div> </div> <div class="paragraph"> <p>This will ensure that a <code>git fetch</code> or <code>git pull</code> places any remote tags under <code>origin/xxx. For example, the`isis-1.0.0`tag on the origin will appear under`origin/isis-1.0.0</code>.</p> </div> <div class="paragraph"> <p>If you don&#8217;t use git outside of Apache, you can add the <code>--global</code> flag so that the above settings apply for all repos managed by git on your PC.</p> </div> </div> </div> <div class="sect3"> <h4 id="_getting_help">6.1.2. Getting help</h4> <div class="paragraph"> <p>Three commands of git that in particular worth knowing:</p> </div> <div class="ulist"> <ul> <li> <p><code>git help <em>command</em></code><br></p> <div class="paragraph"> <p>will open the man page in your web browser</p> </div> </li> <li> <p><code>git gui</code><br></p> <div class="paragraph"> <p>will open up a basic GUI client to staging changes and making commits.</p> </div> </li> <li> <p><code>gitk --all</code><br></p> <div class="paragraph"> <p>will open the commit history for all branches. In particular, you should be able to see the local <code>master</code>, which branch you are working on (the <code>HEAD</code>), and also the last known position of the <code>master</code> branch from the central repo, called <code>origin/master</code>.</p> </div> </li> </ul> </div> <div class="paragraph"> <p>You might also want to explore using a freely available equivalent such as <a href="https://www.sourcetreeapp.com/">Atlassian SourceTree</a>.</p> </div> <div class="paragraph"> <p>For further reading, see:</p> </div> <div class="ulist"> <ul> <li> <p><a href="http://www.kernel.org/pub/software/scm/git/docs/git-config.html">git config man page</a></p> </li> <li> <p><a href="http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html">.gitattributes man page</a></p> </li> <li> <p><a href="http://git-scm.com/docs/gitattributes">.gitattributes git-scm.com docs</a></p> </li> </ul> </div> </div> </div> <div class="sect2"> <h3 id="_installing_maven">6.2. Installing Maven</h3> <div class="paragraph"> <p>Install Maven 3.0.x, downloadable <a href="http://maven.apache.org/download.html">here</a>.</p> </div> <div class="paragraph"> <p>Set <code>MAVEN_OPTS</code> environment variable:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">export MAVEN_OPTS=&quot;-Xms512m -Xmx1024m&quot;</code></pre> </div> </div> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> <div class="paragraph"> <p>Previously we suggested <code>-XX:MaxPermSize=256m</code>, but this option has been removed in Java 8. (As of 1.9.0, Apache Isis is built using Java 8 but with source and target set to JDK 1.7).</p> </div> </td> </tr> </table> </div> </div> <div class="sect2"> <h3 id="_building_all_of_apache_isis">6.3. Building all of Apache Isis</h3> <div class="paragraph"> <p>To build the source code from the command line, simply go to the root directory and type:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">mvn clean install</code></pre> </div> </div> <div class="paragraph"> <p>The first time you do this, you&#8217;ll find it takes a while since Maven needs to download all of the Apache Isis prerequisites.</p> </div> <div class="paragraph"> <p>Thereafter you can speed up the build by adding the <code>-o</code> (offline flag). To save more time still, we also recommend that you build in parallel. (Per this <a href="http://zeroturnaround.com/rebellabs/your-maven-build-is-slow-speed-it-up/">blog post</a>), you could also experiment with a number of JDK parameters that we&#8217;ve found also speed up Maven:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">export MAVEN_OPTS=&quot;-Xms512m -Xmx1024m -XX:+TieredCompilation -XX:TieredStopAtLevel=1&quot; mvn clean install -o -T1C</code></pre> </div> </div> <div class="paragraph"> <p>For the most part, though, you may want to rely on an IDE such as Eclipse to build the codebase for you. Both Eclipse and Idea (12.0+) support incremental background compilation.</p> </div> <div class="paragraph"> <p>When using Eclipse, a Maven profile is configured such that Eclipse compiles to <code>target-ide</code> directory rather than the usual <code>target</code> directory. You can therefore switch between Eclipse and Maven command line without one interfering with the other.</p> </div> </div> <div class="sect2"> <h3 id="_checking_for_vulnerabilities">6.4. Checking for Vulnerabilities</h3> <div class="paragraph"> <p>Apache Isis configures the <a href="https://www.owasp.org/index.php/Main_Page">OWASP</a> <a href="https://www.owasp.org/index.php/OWASP_Dependency_Check">dependency check</a> <a href="http://jeremylong.github.io/DependencyCheck/dependency-check-maven/index.html">Maven plugin</a> to determine whether the framework uses libraries that are known to have security vulnerabilities.</p> </div> <div class="paragraph"> <p>To check, run:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">mvn org.owasp:dependency-check-maven:aggregate -Dowasp</code></pre> </div> </div> <div class="paragraph"> <p>This will generate a single report under <code>target/dependency-check-report.html</code>.</p> </div> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> <div class="paragraph"> <p>The first time this runs can take 10~20 minutes to download the NVD data feeds.</p> </div> </td> </tr> </table> </div> <div class="paragraph"> <p>To disable, either run in offline mode (add <code>-o</code> or <code>--offline</code>) or omit the <code>owasp</code> property.</p> </div> </div> <div class="sect2"> <h3 id="_checking_for_use_of_internal_jdk_apis">6.5. Checking for use of internal JDK APIs</h3> <div class="paragraph"> <p>Apache Isis configures the <a href="https://maven.apache.org/plugins-archives/maven-jdeps-plugin-3.0.0/">jdeps maven plugin</a> to check for any usage of internal JDK APIs. This is in preparation for Java 9 module system (Jigsaw) which will prevent such usage of APIs.</p> </div> <div class="paragraph"> <p>To check, run:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">mvn clean install -Djdeps</code></pre> </div> </div> <div class="paragraph"> <p>This will fail the build on any module that currently uses an internal JDK API.</p> </div> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> <div class="paragraph"> <p>At the time of writing the <code>isis-core-schema</code> module fails the build.</p> </div> </td> </tr> </table> </div> </div> </div> </div> <div class="sect1"> <h2 id="_cgcon_contributing">7. Contributing</h2> <div class="sectionbody"> <div class="paragraph"> <p>This page explains how you can contribute to Apache Isis. You&#8217;ll probably also want <a href="#_cgcon_ide">set up your IDE</a> and learn <a href="#_cgcon_building-isis">how to build Apache Isis</a>.</p> </div> <div class="paragraph"> <p>Thanks for considering to help out, your contributions are appreciated!</p> </div> <div class="sect2"> <h3 id="_recommended_workflow_github">7.1. Recommended Workflow (github)</h3> <div class="paragraph"> <p>Apache Isis' source code is hosted in an Apache git repo (<a href="https://git-wip-us.apache.org/repos/asf/isis.git">https</a>, <a href="http://git-wip-us.apache.org/repos/asf/isis.git">http</a>), with a clone on github (<a href="https://github.com/apache/isis.git">https</a>, or ssh: <code>git@github.com:apache/isis.git</code>.</p> </div> <div class="paragraph"> <p>As you might imagine, only committers are permitted to push changes to the central git repo. As a contributor, we recommend that you fork the <a href="https://github.com/apache/isis.git">apache/isis</a> repo in github, and then use your fork as a way of publishing your patches for the Apache Isis committers to apply.</p> </div> <div class="paragraph"> <p>The diagram below illustrates the process:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/contributing/git-workflow.png"><img src="images/contributing/git-workflow.png" alt="git workflow" width="600px"></a> </div> </div> <div class="paragraph"> <p>That is:</p> </div> <div class="olist arabic"> <ol class="arabic"> <li> <p>as a one-time activity, you fork the <a href="https://github.com/apache/isis.git">github.com/apache/isis</a> repo into your own fork on github.com</p> </li> <li> <p>as a one-time activity, you clone your fork to your local computer</p> </li> <li> <p>you set the <a href="https://github.com/apache/isis.git">github.com/apache/isis</a> as your upstream branch; this will allow you to keep your local clone up-to-date with new commits</p> <div class="ulist"> <ul> <li> <p>note the asymmetry here: the <code>upstream</code> repo (the Apache github repo) is <strong>not</strong> the same as the <code>origin</code> repo (your fork).</p> </li> </ul> </div> </li> <li> <p>you work on your changes locally; when done, you push them to your github fork</p> </li> <li> <p>to contribute back a change, raise a <a href="https://issues.apache.org/jira/browse/ISIS">JIRA</a> ticket, and ensure your commit message is in the form: <code>ISIS-nnnn: &#8230;&#8203;</code> so that changes can be tracked (more discussion on this point below). In any case, before you decide to start hacking with Apache Isis, it&#8217;s always worth creating a ticket in JIRA and then have a discussion about it on the <a href="http://isis.apache.org/support.html">mailing lists</a>.</p> </li> <li> <p>Use github to raise a <a href="https://help.github.com/articles/using-pull-requests/">pull request</a> for your feature</p> </li> <li> <p>An Apache Isis committer will review your change, and apply it if suitable.</p> </li> </ol> </div> </div> <div class="sect2"> <h3 id="_alternative_workflow_jira_patches">7.2. Alternative Workflow (JIRA patches)</h3> <div class="paragraph"> <p>As an alternative, you may decide to clone directly from <a href="https://github.com/apache/isis.git">github.com/apache/isis</a> rather than create your own fork:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/contributing/git-workflow-2.png"><img src="images/contributing/git-workflow-2.png" alt="git workflow 2" width="600px"></a> </div> </div> <div class="paragraph"> <p>In this case your <code>upstream</code> repo is the same as your <code>origin</code> repo, which might seem more straightforward. On the other hand, if you go this route then you&#8217;ll need create patches locally and attach them to the JIRA ticket.</p> </div> <div class="paragraph"> <p>For the Apache Isis committers it really doesn&#8217;t matter which route you take, so go with whatever&#8217;s most comfortable.</p> </div> </div> <div class="sect2"> <h3 id="_setting_up_your_fork_clone">7.3. Setting up your fork/clone</h3> <div class="paragraph"> <p>If you choose to create your own fork then you&#8217;ll need an account on <a href="https://github.com">github.com</a>. You then fork simply by pressing the "Fork" button:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/contributing/github-forking.png"><img src="images/contributing/github-forking.png" alt="github forking" width="600px"></a> </div> </div> <div class="paragraph"> <p>An account isn&#8217;t needed if you just clone straight from the <a href="http://github.com/apache/isis">github.com/apache/isis</a>.</p> </div> <div class="paragraph"> <p>Whether you&#8217;ve forked or not, you then need to clone the repo onto your computer. Github makes this very easy to do:</p> </div> <div class="ulist"> <ul> <li> <p>for Windows users, we suggest you use github&#8217;s 'Clone in Windows' feature</p> </li> <li> <p>for Mac/Linux users, create a clone from the command line:</p> </li> </ul> </div> <div class="paragraph"> <p>Again, the info is easily found in the github page:</p> </div> <div class="imageblock"> <div class="content"> <a class="image" href="images/contributing/github-cloning.png"><img src="images/contributing/github-cloning.png" alt="github cloning" width="600px"></a> </div> </div> <div class="paragraph"> <p>If you&#8217;ve created your own fork, then you need to add the <code>upstream</code> remote to the <a href="https://github.com/apache/isis">github.com/apache/isis</a>. This remote is traditionally called <code>upstream</code>. You should then arrange for your <code>master</code> branch to track the <code>upstream/master</code> remote branch:</p> </div> <div class="paragraph"> <p>If you didn&#8217;t create your own fork, you can omit the above step. Either way around, you can now fetch new commits using simply:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git fetch</code></pre> </div> </div> <div class="paragraph"> <p>For more info on tracking branches <a href="http://git-scm.com/book/en/Git-Branching-Remote-Branches">here</a> and <a href="http://gitready.com/beginner/2009/03/09/remote-tracking-branches.html">here</a>.</p> </div> </div> <div class="sect2"> <h3 id="_commit_messages">7.4. Commit messages</h3> <div class="paragraph"> <p>Although with git your commits are always performed on your local repo, those commit messages become public when the patch is applied by an Apache Isis committer. You should take time to write a meaningful commit message that helps explain what the patch refers to; if you don&#8217;t then there&#8217;s a chance that your patch may be rejected and not applied. No-one likes hard work to go to waste!</p> </div> <div class="paragraph"> <p>We therefore recommend that your commit messages are as follows [1]:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="other">ISIS-999: Make the example in CONTRIBUTING imperative and concrete Without this patch applied the example commit message in the CONTRIBUTING document is not a concrete example. This is a problem because the contributor is left to imagine what the commit message should look like based on a description rather than an example. This patch fixes the problem by making the example concrete and imperative. The first line is a real life imperative statement with a ticket number from our issue tracker. The body describes the behavior without the patch, why this is a problem, and how the patch fixes the problem when applied.</code></pre> </div> </div> <div class="paragraph"> <p>Once your git repo is setup, the next thing you&#8217;ll most likely want to do is to setup your development environment. See <a href="development-environment.html">here</a> for more details.</p> </div> </div> <div class="sect2"> <h3 id="_creating_the_patch_file">7.5. Creating the patch file</h3> <div class="paragraph"> <p>If you are working without a github fork of Apache Isis, then you can create the patches from your own local git repository.</p> </div> <div class="paragraph"> <p>As per <a href="http://stackoverflow.com/questions/6658313/generate-a-git-patch-for-a-specific-commit">this stackoverflow question</a>, create the patch using <code>git format-patch</code>:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git format-patch -10 HEAD --stdout &gt; 0001-last-10-commits.patch</code></pre> </div> </div> <div class="paragraph"> <p>Here <code>-10</code> is the last 10 commits you have done. You need to change that integer according to the commits you need to apply into the patch.</p> </div> </div> <div class="sect2"> <h3 id="_sample_contribution_workflow">7.6. Sample Contribution Workflow</h3> <div class="paragraph"> <p>Assuming you&#8217;re development environment is all setup, let&#8217;s walk through how you might make contribute a patch. In this example, suppose that you&#8217;ve decided to work on JIRA ticket #123, an enhancement to support Blob/Clob datatypes.</p> </div> <div class="sect3"> <h4 id="_update_your_master_branch">7.6.1. Update your master branch</h4> <div class="paragraph"> <p>The first thing to do is to make sure your local clone is up-to-date. We do this by retrieving new commits from upstream repo and then merging them as a fast-forward into your local branch.</p> </div> <div class="paragraph"> <p>Irrespective of whether you are using a github fork, the upstream for your local <code>master</code> branch will be tracking the appropriate remote&#8217;s <code>master</code> branch. So n either case, the same commands work:</p> </div> <div class="paragraph"> <p>Alternatively, you can combine the <code>git fetch</code> and <code>git merge</code> and just use <code>git pull</code>: &lt;pre&gt; git checkout master git pull –ff-only &lt;/pre&gt;</p> </div> <div class="paragraph"> <p>If the <code>merge</code> or <code>pull</code> fails, it means that you must have made commits and there have been changes meanwhile on the remote <code>master&#8217;s branch. You can use `gitk --all</code> to confirm. If this fails, see our <a href="git-cookbook.html">git cookbook</a> page for a procedure to retrospectively sort out this situation.</p> </div> </div> <div class="sect3"> <h4 id="_create_a_topic_branch">7.6.2. Create a topic branch</h4> <div class="paragraph"> <p>We recommend you name topic branches by the JIRA ticket, ie &lt;tt&gt;ISIS-nnn-description&lt;/tt&gt;. So let&#8217;s create a new branch based off <code>master</code> and call it "ISIS-123-blobs"</p> </div> <div class="paragraph"> <p>You can confirm the branch is there and is your new <code>HEAD</code> using either <code>gitk --all</code>. Alternatively, use the command line:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">$ git checkout -b ISIS-123-blobs</code></pre> </div> </div> <div class="paragraph"> <p>The command line prompt should also indicate you are on a branch, isolated from any changes that might happen on the <code>master</code> branch.</p> </div> </div> <div class="sect3"> <h4 id="_make_file_changes_and_commit">7.6.3. Make File Changes and Commit</h4> <div class="paragraph"> <p>Next, make changes to your files using the usual commands (see also our <a href="#_cgcon_git-cookbook">git cookbook</a> section):</p> </div> <div class="ulist"> <ul> <li> <p><code>git add</code></p> </li> <li> <p><code>git mv</code></p> </li> <li> <p><code>git rm</code></p> </li> <li> <p><code>git commit</code></p> </li> <li> <p><code>git status</code></p> </li> </ul> </div> <div class="paragraph"> <p>and so on.</p> </div> <div class="paragraph"> <p>Continue this way until happy with the change. Remember to run all your tests on the topic branch (including a full <code>mvn clean install</code>).</p> </div> </div> <div class="sect3"> <h4 id="_rebasing_with_code_master_code">7.6.4. Rebasing with <code>master</code></h4> <div class="paragraph"> <p>Before you can share your change, you should rebase (in other words replay) your changes on top of the <code>master</code> branch.</p> </div> <div class="paragraph"> <p>The first thing to do is to pull down any changes made in upstream remote&#8217;s <code>master</code> since you started your topic branch:</p> </div> <div class="paragraph"> <p>These are the same commands that you would have run before you created your topic branch. If you use <code>gitk --all</code>, there&#8217;s a good chance that new commits have come in.</p> </div> <div class="paragraph"> <p>Next, we reintegrate our topic branch by rebasing onto <code>master</code>: &lt;pre&gt; git checkout ISIS-123-blobs git rebase master &lt;/pre&gt;</p> </div> <div class="paragraph"> <p>This takes all of the commits in your branch, and applies them on top of the new <code>master</code> branch. When your change is eventually integrated back in, it will result in a nice clear linear history on the public repo.</p> </div> <div class="paragraph"> <p>If the rebase fails because of a conflict, then you&#8217;ll be dumped into REBASE mode. Edit the file that has the conflict, and make the appropriate edits. Once done:</p> </div> <div class="paragraph"> <p>Once the rebase has completed, re-run your tests to confirm that everything is still good.</p> </div> </div> <div class="sect3"> <h4 id="_raising_a_pull_request">7.6.5. Raising a pull request</h4> <div class="paragraph"> <p>If you have your own fork, you can now simply push the changes you&#8217;ve made locally to your fork:</p> </div> <div class="paragraph"> <p>This will create a corresponding branch in the remote github repo. If you use <code>gitk --all</code>, you&#8217;ll also see a <code>remotes/origin/ISIS-123-blobs</code> branch.</p> </div> <div class="paragraph"> <p>Then, use github to raise a <a href="https://help.github.com/articles/using-pull-requests/">pull request</a>. Pull requests sent to the Apache GitHub repositories will forward a pull request e-mail to the <a href="../support.html">dev mailing list</a>. You&#8217;ll probably want to sign up to the dev mailing list first before issuing your first pull request (though that isn&#8217;t mandatory).</p> </div> <div class="paragraph"> <p>The process to raise the pull request, broadly speaking:</p> </div> <div class="ulist"> <ul> <li> <p>Open a web browser to your github fork of isis</p> </li> <li> <p>Select your topic branch (pushed in the previous step) so that the pull request references the topic branch.</p> </li> <li> <p>Click the <code>Pull Request</code> button.</p> </li> <li> <p>Check that the Apache Isis mailing list email came through.</p> </li> </ul> </div> </div> </div> <div class="sect2"> <h3 id="_if_your_pull_request_is_accepted">7.7. If your pull request is accepted</h3> <div class="paragraph"> <p>To double check that your pull request is accepted, update your <code>master</code> branch from the <code>upstream</code> remote:</p> </div> <div class="paragraph"> <p>You can then use <code>gitk --all</code> (or <code>git log</code> if you prefer the command line) to check your contribution has been added.</p> </div> <div class="paragraph"> <p>You can now delete your topic branch and remove the branch in your github:</p> </div> <div class="paragraph"> <p>Finally, you might want to push the latest changes in master back up to your github fork. If so, use:</p> </div> <div class="sect3"> <h4 id="_if_your_pull_request_is_rejected">7.7.1. If your pull request is rejected</h4> <div class="paragraph"> <p>If your pull request is rejected, then you&#8217;ll need to update your branch from the main repository and then address the rejection reason.</p> </div> <div class="paragraph"> <p>You&#8217;ll probably also want to remove the remote branch on github:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git push origin –delete ISIS-123-blobs</code></pre> </div> </div> <div class="paragraph"> <p>… and continue as before until you are ready to resubmit your change.</p> </div> <div class="paragraph"> <p>[1] inspiration for the recommended commit format comes from the <a href="https://github.com/puppetlabs/puppet">puppet</a> project&#8217;s <a href="https://github.com/puppetlabs/puppet/blob/master/CONTRIBUTING.md">contributing</a> page.</p> </div> </div> </div> </div> </div> <div class="sect1"> <h2 id="_cgcon_policies">8. Policies</h2> <div class="sectionbody"> <div class="paragraph"> <p>This chapter pulls together various policy documents relating to the development of Apache Isis'.</p> </div> <div class="sect2"> <h3 id="_cgcom_versioning-policy">8.1. Versioning Policy</h3> <div class="sect3"> <h4 id="_semantic_versioning">8.1.1. Semantic Versioning</h4> <div class="paragraph"> <p>Starting from v1.0.0, Apache Isis has adopted <a href="http://semver.org">semantic versioning</a> for its versioning policy.</p> </div> <div class="paragraph"> <p>Version numbers are in the form <code>x.y.z</code>:</p> </div> <div class="ulist"> <ul> <li> <p>x is bumped up whenever there a breaking API change</p> </li> <li> <p>y is bumped up whenever there is a new feature that does not break API</p> </li> <li> <p>z is bumped up for minor bug fixes.</p> </li> </ul> </div> <div class="paragraph"> <p>This scheme would be adopted for both core and components.</p> </div> </div> <div class="sect3"> <h4 id="_version_ranges">8.1.2. Version ranges</h4> <div class="paragraph"> <p>Version ranges may not be used. If necessary, end-users can use <code>&lt;dependencyManagement</code> elements to have combine components built against different versions of core.</p> </div> <div class="paragraph"> <p>That said, this can introduce instability and so generally we recommend that end-users configure the <code>maven-enforcer-plugin</code> and its <a href="http://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html">DependencyConvergence</a> rule. This will help avoid "jar hell" (components having conflicting dependencies of core).</p> </div> <div class="paragraph"> <p>If there is a conflict, we would ask that end-users engage with Apache Isis committers to have an updated version of the component(s) pushed out.</p> </div> </div> </div> <div class="sect2"> <h3 id="_cgcon_policies_git-policy">8.2. Git Policy</h3> <div class="paragraph"> <p>These notes recommend how contributors should work with git. To understand these notes, the only real concepts that you need to grok are:</p> </div> <div class="ulist"> <ul> <li> <p>git commits form an acyclic graph, with each commit pointing to its parent commit (or commit<strong>s</strong>, if a merge)</p> </li> <li> <p>a branch is merely a pointer to one of these commits; git calls the main branch <code>master</code></p> </li> <li> <p>git commits happen in two steps: first they are added to the index (also called the staging area), then they are committed.</p> </li> </ul> </div> <div class="paragraph"> <p>For more background reading, see:</p> </div> <div class="ulist"> <ul> <li> <p><a href="http://git-scm.com/book">Pro Git</a> book (free in electronic form)</p> </li> <li> <p><a href="https://github.s3.amazonaws.com/media/book.pdf">Git community book</a></p> </li> <li> <p><a href="http://git-scm.com/2011/07/11/reset.html">git reset demystified</a> - differentiating the working directory vs index/staging area</p> </li> </ul> </div> <div class="paragraph"> <p>And, of course, there is loads of good advice on <a href="http://stackoverflow.com/questions/tagged/git">stackoverflow.com</a></p> </div> <div class="sect3"> <h4 id="_workflow">8.2.1. Workflow</h4> <div class="paragraph"> <p>There are many ways of using Git, but the Apache Isis committers have adopted the following workflow:</p> </div> <div class="ulist"> <ul> <li> <p>create a topic branch for a feature<br></p> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git checkout -b ISIS-999</code></pre> </div> </div> </li> <li> <p>periodically, push the branch to origin (for safekeeping):<br></p> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git push origin ISIS-999</code></pre> </div> </div> </li> <li> <p><code>rebase</code> the topic branch periodically on master.<br></p> <div class="paragraph"> <p>How often you do this will depend on whether you are collaborating with others on the feature. You need to ensure that your co-worker has no outstanding work before you do this; otherwise it&#8217;ll create merge conflict hell for them:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git checkout master git pull git checkout ISIS-999 git rebase master git push origin ISIS-999 --force</code></pre> </div> </div> </li> <li> <p>when feature is complete, rebase once more (as above), then switch to master and perform a <code>merge --no-ff</code>:<br></p> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git checkout master git merge --no-ff ISIS-999</code></pre> </div> </div> </li> <li> <p>finally, remove the branch<br></p> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git branch -d ISIS-999 git push origin --delete ISIS-999</code></pre> </div> </div> </li> </ul> </div> <div class="paragraph"> <p>This way of working gives us the full history on the branch as to what the thought processes were for the feature, but only a single commit on to <code>master</code> to see the ultimate impact of the changes (acting a bit like a summary).</p> </div> </div> <div class="sect3"> <h4 id="_commit_message">8.2.2. Commit message</h4> <div class="paragraph"> <p>The minimum we expect in a commit messages is:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">ISIS-nnn: brief summary here - optionally, longer details - should be written here - in bullet points</code></pre> </div> </div> <div class="paragraph"> <p>where <code>ISIS-nnn</code> is a ticket raised in our <a href="https://issues.apache.org/jira/browse/ISIS">JIRA issue tracker</a>.</p> </div> <div class="paragraph"> <p>For non-committers we typically expect more detail again; see the <a href="#_cgcon_contributing">contributing</a> page for the longer format recommended for contributors to use.</p> </div> </div> </div> </div> </div> <div class="sect1"> <h2 id="_cgcon_asciidoc">9. AsciiDoc Documentation</h2> <div class="sectionbody"> <div class="paragraph"> <p>Apache Isis' documentation (meaning the website and the users' guide, the reference guide and this contributors' guide) is written using <a href="http://www.methods.co.nz/asciidoc/">Asciidoc</a>, specifically the <a href="asciidoctor.org/">Asciidoctor</a> implementation.</p> </div> <div class="paragraph"> <p>The website and guides are created by running build tools (documented below) which create the HTML version of the site and guides. You can therefore easily check the documentation before raising a pull request (as a contributor) or publishing the site (if a committer).</p> </div> <div class="paragraph"> <p>Publishing is performed by copying the generated HTML to a different git repository (<a href="https://git-wip-us.apache.org/repos/asf?p=isis-site.git">isis-site</a>). This is synced by ASF infrastructure over to <a href="http://isis.apache.org">isis.apache.org</a>.</p> </div> <div class="paragraph"> <p>And to help write the Asciidoc text itself, we provide some <a href="#_cgcon__cg_ide-templates">templates</a>.</p> </div> <div class="sect2"> <h3 id="_where_to_find_the_docs">9.1. Where to find the Docs</h3> <div class="paragraph"> <p>The (Asciidoc) source code can be found at <code>adocs/documentation</code> (relative to root). Online you&#8217;ll find it <a href="https://github.com/apache/isis/tree/master/adocs/documentation">cloned to github here</a>.</p> </div> </div> <div class="sect2"> <h3 id="_naming_conventions">9.2. Naming Conventions</h3> <div class="paragraph"> <p>For documents with inclusions, use '_' to separate out the logical hierarchy:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code>xxx-xxx/xxx-xxx.adoc _xxx-xxx_ppp-ppp.adoc _xxx-xxx_qqq-qqq.adoc _xxx-xxx_qqq-qqq_mmm-mmm.adoc _xxx-xxx_qqq-qqq_nnn-nnn.adoc</code></pre> </div> </div> <div class="paragraph"> <p>Any referenced images should be in subdirectories of the <code>images</code> directory:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code>xxx-xxx/images/. /ppp-ppp/. /qqq-qqq/. /mmm-mmm /nnn-nnn</code></pre> </div> </div> <div class="paragraph"> <p>And similarly any resources should be in the <code>resources</code> subdirectory:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code>xxx-xxx/resources/. ppp-ppp/. qqq-qqq/. /mmm-mmm/ /nnn-nnn/</code></pre> </div> </div> </div> <div class="sect2"> <h3 id="_writing_the_docs">9.3. Writing the docs</h3> <div class="paragraph"> <p>We highly recommend that you install the (IntelliJ) live templates for Asciidoctor, as described in <a href="#_cgcon_ide-templates">IDE templates</a>. These provide a large number of helper templates.</p> </div> <div class="paragraph"> <p>An <a href="#_cgcon_appendix_asciidoc-templates">appendix</a> lists all the templates available, demonstrating their intended usage and output.</p> </div> </div> <div class="sect2"> <h3 id="_build_and_review_using_maven">9.4. Build and Review (using Maven)</h3> <div class="paragraph"> <p>To (re)build the documentation locally prior to release, change into the <code>adocs/documentation</code> directory and use:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code>mvn clean compile</code></pre> </div> </div> <div class="paragraph"> <p>The site will be generated at <code>target/site/index.html</code>.</p> </div> <div class="paragraph"> <p>You could then use a web server such as Python&#8217;s SimpleHTTPServer to preview (so that all Javascript works correctly). However, instead we recommend using instant preview, described next.</p> </div> </div> <div class="sect2"> <h3 id="_instant_rebuild_using_ruby">9.5. Instant Rebuild (using Ruby)</h3> <div class="paragraph"> <p>The ruby script, <code>monitor.rb</code> emulates the <code>mvn compile</code> command, regenerating any changed Asciidoctor files to the relevant <code>target/site</code> directory. Moreover if any included files are changed then it rebuilds the parent (per the above naming convention).</p> </div> <div class="sect3"> <h4 id="_one_time_setup">9.5.1. One-time setup</h4> <div class="paragraph"> <p>To setup:</p> </div> <div class="ulist"> <ul> <li> <p>download and install ruby 2.0.0, from <a href="rubyinstaller.org/downloads"><a href="http://rubyinstaller.org/downloads/" class="bare">http://rubyinstaller.org/downloads/</a></a></p> </li> <li> <p>download devkit for the Ruby 2.0 installation, also from <a href="rubyinstaller.org/downloads"><a href="http://rubyinstaller.org/downloads/" class="bare">http://rubyinstaller.org/downloads/</a></a>. Then follow the <a href="https://github.com/oneclick/rubyinstaller/wiki/Development-Kit">installation instructions</a> on their wiki</p> </li> </ul> </div> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> <div class="paragraph"> <p>We use Ruby 2.0 rather than 2.1 because the wdm gem (required to monitor the filesystem if running on Windows) is not currently compatible with Ruby 2.1.</p> </div> </td> </tr> </table> </div> <div class="paragraph"> <p>To download the required Ruby dependencies, use:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">gem install bundler bundle install</code></pre> </div> </div> </div> <div class="sect3"> <h4 id="_instant_rebuild">9.5.2. Instant Rebuild</h4> <div class="paragraph"> <p>To run, we typically just use:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">sh monitor.sh</code></pre> </div> </div> <div class="paragraph"> <p>This script simply runs <code>mvn clean compile &amp;&amp; ruby monitor.rb -b</code>. The <code>mvn</code> command performs a clean rebuild of the site, and then the ruby script monitors for any further changes under <code>src/main/asciidoc</code>.</p> </div> <div class="paragraph"> <p>The script also starts up a web server on port 4000 so you can review results. If any <code>.adoc</code> changes, then the appropriate HTML will be regenerated. And, if any new assets (CSS, images etc) are added, they will be copied across. The <code>-b</code> flag passed through means that the script also starts a web browser pointing at the newly generated docs.</p> </div> <div class="paragraph"> <p>The <code>monitor.rb</code> script has a couple of other options, use <code>-h</code> flag for usage:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">ruby monitor.rb -h</code></pre> </div> </div> <div class="paragraph"> <p>which should print:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code>usage: monitor.rb [options] -p, --port port (default: 4000) -b, --browser launch browser -h, --help help</code></pre> </div> </div> </div> </div> <div class="sect2"> <h3 id="_publish_procedure">9.6. Publish procedure</h3> <div class="paragraph"> <p>Only Apache Isis committers can publish to <a href="http://isis.apache.org">isis.apache.org</a>. We&#8217;ve decided to include these procedures here here (rather than put them in the <a href="cgcom.html">Committers' Guide</a>), just to keep things together.</p> </div> <div class="sect3"> <h4 id="_one_time_setup_2">9.6.1. One-time setup</h4> <div class="paragraph"> <p>The generated site is published by copying into the <code>content/</code> directory of the <a href="https://git-wip-us.apache.org/repos/asf/isis-site.git">isis-site git repo</a>. You therefore need to check this out this repo.</p> </div> <div class="paragraph"> <p>The procedure assumes that two git repos (for <a href="https://git-wip-us.apache.org/repos/asf/isis.git">isis</a> itself and for isis-site) are checked out into the same parent directory, eg:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code>/APACHE/ isis/ # checkout of isis.git adocs/ documentation/ README.adoc # this file you are reading right now ... isis-site/ # checkout of isis-site.git content/ # the published website</code></pre> </div> </div> <div class="paragraph"> <p>If this isn&#8217;t the case, then it is possible to override the relative directory by passing in a system property to the mvn goal; see below.</p> </div> <div class="paragraph"> <p>You also need to know that ASF&#8217;s publishing script work from the 'asf-site' branch, NOT from the 'master' branch. Therefore, in the <code>isis.git</code> repo site:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git checkout asf-site</code></pre> </div> </div> </div> <div class="sect3"> <h4 id="_publishing">9.6.2. Publishing</h4> <div class="paragraph"> <p>Back in the <code>adocs/documentation</code> directory of the main <code>isis-git.repo</code>, to copy the generated documents to the <code>isis-site.git</code> repo, run:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">mvn clean package</code></pre> </div> </div> <div class="paragraph"> <p>This deletes the entire content of <code>contents</code>, and replaces with the content under <code>target/site</code>. It also fixes up line endings, standardizing on unix-style LFs.</p> </div> <div class="admonitionblock tip"> <table> <tr> <td class="icon"> <i class="fa icon-tip" title="Tip"></i> </td> <td class="content"> <div class="paragraph"> <p>If you have checked out the <code>isis-site.git</code> repo into some other directory (relative to <code>isis.site.git), then this can be overridden by specifying `-Disis-site.dir=&#8230;&#8203;</code> when calling <code>mvn</code>.</p> </div> </td> </tr> </table> </div> <div class="paragraph"> <p>To copy and to also commit the generated documents to the <code>isis-site.git</code> repo , run:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">sh publish.sh &quot;ISIS-nnnn: a custom commit message&quot;</code></pre> </div> </div> <div class="paragraph"> <p>Behind the scenes this just calls <code>mvn clean install -Dmessage=&#8230;&#8203;</code>.</p> </div> <div class="paragraph"> <p>Pushing the commits (in the <code>isis-site.git</code> directory, of course) will publishing the changes:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git push</code></pre> </div> </div> <div class="paragraph"> <p>Double check at <a href="http://isis.apache.org">isis.apache.org</a>.</p> </div> </div> </div> </div> </div> <div class="sect1"> <h2 id="_cgcon_git-cookbook">10. Appendix: Git Cookbook</h2> <div class="sectionbody"> <div class="paragraph"> <p>This appendix describes the commands often used while working with git. In addition to these basic commands, please make sure you have read:</p> </div> <div class="ulist"> <ul> <li> <p><a href="#_cgcon_building-isis">building Apache Isis</a></p> </li> <li> <p><a href="#_cgcon_policies_git-policy">Git policy</a></p> </li> <li> <p><a href="#_cgcon_contributing">Contributing</a></p> </li> </ul> </div> <div class="sect2"> <h3 id="_modifying_existing_files">10.1. Modifying existing files</h3> <div class="paragraph"> <p>To modify existing files:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git add filename git commit -m &quot;ISIS-nnn: yada yada&quot;</code></pre> </div> </div> <div class="paragraph"> <p>The <code>git add</code> command adds the changes to the file(s) to the git index (aka staging area). If you were to make subsequent changes to the file these would not be committed.</p> </div> <div class="paragraph"> <p>The <code>git commit</code> takes all the staged changes and commits them locally. Note that these changes are not shared public with Apache Isis' central git repo.</p> </div> <div class="paragraph"> <p>You can combine these two commands using <code>-am</code> flag to git commit:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git commit -am &quot;ISIS-nnn: yada yada&quot;</code></pre> </div> </div> </div> <div class="sect2"> <h3 id="_adding_new_files">10.2. Adding new files</h3> <div class="paragraph"> <p>To add a new file:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git add . git commit -m &quot;ISIS-nnn: yada yada&quot;</code></pre> </div> </div> <div class="paragraph"> <p>Note that this sequence of commands is identical to modifying an existing file. However, it isn&#8217;t possible to combine the two steps using <code>git commit -am</code>; the <code>git add</code> is always needed when adding new files to the repo.</p> </div> </div> <div class="sect2"> <h3 id="_deleting_files">10.3. Deleting files</h3> <div class="paragraph"> <p>To delete a file:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git rm filename git commit -m &quot;ISIS-nnn: yada yada&quot;</code></pre> </div> </div> </div> <div class="sect2"> <h3 id="_renaming_or_moving_files">10.4. Renaming or moving files</h3> <div class="paragraph"> <p>To rename or move a file:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git mv &lt;i&gt;filename&lt;/i&gt; &lt;i&gt;newfilename&lt;/i&gt; git commit -m &quot;ISIS-nnn: yada yada&quot;</code></pre> </div> </div> </div> <div class="sect2"> <h3 id="_common_workflows">10.5. Common Workflows</h3> <div class="paragraph"> <p>The <a href="#_cgcon_contributing">contributing</a> page describes the workflow for non-committers. The <a href="#_cgcon_policies_git-policy">Git policy</a> page describes a workflow for Apache Isis <strong>committers</strong>.</p> </div> </div> <div class="sect2"> <h3 id="_backing_up_a_local_branch">10.6. Backing up a local branch</h3> <div class="paragraph"> <p>If committing to a local branch, the changes are still just that: local, and run risk of a disk failure or other disaster.</p> </div> <div class="paragraph"> <p>To create a new, similarly named branch on the central repo, use:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git push -u origin &lt;i&gt;branchname&lt;/i&gt;</code></pre> </div> </div> <div class="paragraph"> <p>Using <code>gitk --all</code> will show you this new branch, named <strong>origin/branchname</strong>.</p> </div> <div class="paragraph"> <p>Thereafter, you can push subsequent commits using simply:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git push</code></pre> </div> </div> <div class="paragraph"> <p>Doing this also allows others to collaborate on this branch, just as they would for <code>master</code>.</p> </div> <div class="paragraph"> <p>When, eventually, you have reintegrated this branch, you can delete the remote branch using:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git push origin --delete &lt;i&gt;branchname&lt;/i&gt;</code></pre> </div> </div> <div class="paragraph"> <p>For more detail, see these blogs/posts <a href="http://www.mariopareja.com/blog/archive/2010/01/11/how-to-push-a-new-local-branch-to-a-remote.aspx">here</a> and <a href="http://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-both-locally-and-in-github">here</a>.</p> </div> </div> <div class="sect2"> <h3 id="_quick_change_stashing_changes">10.7. Quick change: stashing changes</h3> <div class="paragraph"> <p>If you are working on something but are not ready to commit, then use:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git stash</code></pre> </div> </div> <div class="paragraph"> <p>If you use <code>gitk --all</code> then you&#8217;ll see new commits are made that hold the current state of your working directory and staging area.</p> </div> <div class="paragraph"> <p>You can then, for example, pull down the latest changes using <code>git pull --rebase</code> (see above).</p> </div> <div class="paragraph"> <p>To reapply your stash, then use:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git stash pop</code></pre> </div> </div> <div class="paragraph"> <p>Note that stashing works even if switching branches</p> </div> </div> <div class="sect2"> <h3 id="_ignoring_files">10.8. Ignoring files</h3> <div class="paragraph"> <p>Put file patterns into <code>.gitignore</code>. There is one at the root of the git repo, but they can additionally appear in subdirectories (the results are cumulative).</p> </div> <div class="paragraph"> <p>See also:</p> </div> <div class="ulist"> <ul> <li> <p><a href="https://help.github.com/articles/ignoring-files">github&#8217;s help page</a></p> </li> <li> <p><a href="http://www.kernel.org/pub/software/scm/git/docs/gitignore.html">man page</a></p> </li> </ul> </div> </div> <div class="sect2"> <h3 id="_more_advanced_use_cases">10.9. More advanced use cases</h3> <div class="sect3"> <h4 id="_if_accidentally_push_to_remote">10.9.1. If accidentally push to remote</h4> <div class="paragraph"> <p>Suppose you committed to <code>master</code>, and then pushed the change, and then decided that you didn&#8217;t intend to do that:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">C1 - C2 - C3 - C4 - C5 - C6 - C7 ^ master ^ origin/master</code></pre> </div> </div> <div class="paragraph"> <p>To go back to an earlier commit, first we wind back the local <code>master</code>:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git reset --hard C5</code></pre> </div> </div> <div class="paragraph"> <p>where <code>C5</code> is the long sha-id for that commit.</p> </div> <div class="paragraph"> <p>This gets us to:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">C1 - C2 - C3 - C4 - C5 - C6 - C7 ^ master ^ origin/master</code></pre> </div> </div> <div class="paragraph"> <p>Then, do a force push:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git push origin master --force</code></pre> </div> </div> <div class="paragraph"> <p>If this doesn&#8217;t work, it may be that the remote repo has disabled this feature. There are other hacks to get around this, see for example <a href="http://stackoverflow.com/questions/1377845/git-reset-hard-and-a-remote-repository">here</a>.</p> </div> </div> </div> <div class="sect2"> <h3 id="_if_you_ve_accidentally_worked_on_code_master_code_branch">10.10. If you&#8217;ve accidentally worked on <code>master</code> branch</h3> <div class="paragraph"> <p>If at any time the <code>git pull</code> from your upstream fails, it most likely means that you must have made commits on the <code>master</code> branch. You can use <code>gitk --all</code> to confirm; at some point in time both <code>master</code> and <code>origin\master</code> will have a common ancestor.</p> </div> <div class="paragraph"> <p>You can retrospectively create a topic branch for the work you&#8217;ve accidentally done on <code>master</code>.</p> </div> <div class="paragraph"> <p>First, create a branch for your current commit:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git branch &lt;i&gt;newbranch&lt;/i&gt;</code></pre> </div> </div> <div class="paragraph"> <p>Next, make sure you have no outstanding edits. If you do, you should commit them or stash them:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git stash</code></pre> </div> </div> <div class="paragraph"> <p>Finally, locate the shaId of the commit you want to roll back to (easily obtained in <code>gitk -all</code>), and wind <code>master</code> branch back to that commit:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git checkout master git reset --hard &lt;i&gt;shaId&lt;/i&gt; # move master branch shaId of common ancestor</code></pre> </div> </div> </div> <div class="sect2"> <h3 id="_if_you_ve_forgotten_to_prefix_your_commits_but_not_pushed">10.11. If you&#8217;ve forgotten to prefix your commits (but not pushed)</h3> <div class="paragraph"> <p>One of our committers, Alexander Krasnukhin, has put together some git scripts to help his workflow. Using one of these, <code>git prefix</code>, you can just commit with proper message without bothering about prefix and add prefix only in the end <strong>before</strong> the final push.</p> </div> <div class="paragraph"> <p>For example, to prefix all not yet prefixed commits <code>master..isis/666</code> with <code>ISIS-666</code> prefix, use:</p> </div> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="bash">git prefix ISIS-666 master..isis/666</code></pre> </div> </div> <div class="paragraph"> <p>You can grab this utility, and others, from <a href="https://github.com/themalkolm/git-boots">this repo</a>.</p> </div> </div> </div> </div> <div class="sect1"> <h2 id="_cgcon_asciidoc-templates">11. Appendix: Asciidoc Templates</h2> <div class="sectionbody"> <div class="paragraph"> <p>This appendix lists the (IntelliJ) live templates available for <a href="#_cgcon_asciidoc">writing documentation</a> using Asciidoc. Instructions for installing the templates can be found <a href="#_cgcon_ide-templates">here</a>.</p> </div> <div class="paragraph"> <p>In the examples below the text <code>xxx</code>, <code>yyy</code>, <code>zzz</code> are correspond to template variables (ie placeholders).</p> </div> <div class="sect2"> <h3 id="_callouts">11.1. Callouts</h3> <div class="paragraph"> <p>The Asciidoctor terminology is an "admonition".</p> </div> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 14%;"> <col style="width: 57%;"> <col style="width: 28%;"> </colgroup> <thead> <tr> <th class="tableblock halign-left valign-top">Abbrev.</th> <th class="tableblock halign-left valign-top">Produces</th> <th class="tableblock halign-left valign-top">Example</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adadmimportant</code></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>[IMPORTANT]<br> ====<br> xxx<br> ====</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="admonitionblock important"> <table> <tr> <td class="icon"> <i class="fa icon-important" title="Important"></i> </td> <td class="content"> <div class="paragraph"> <p>xxx</p> </div> </td> </tr> </table> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adadmnote</code></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>[NOTE]<br> ====<br> xxx<br> ====</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> <div class="paragraph"> <p>xxx</p> </div> </td> </tr> </table> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adadmtip</code></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>[TIP]<br> ====<br> xxx<br> ====</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="admonitionblock tip"> <table> <tr> <td class="icon"> <i class="fa icon-tip" title="Tip"></i> </td> <td class="content"> <div class="paragraph"> <p>xxx</p> </div> </td> </tr> </table> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adadmwarning</code></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>[WARNING]<br> ====<br> xxx<br> ====</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="admonitionblock warning"> <table> <tr> <td class="icon"> <i class="fa icon-warning" title="Warning"></i> </td> <td class="content"> <div class="paragraph"> <p>xxx</p> </div> </td> </tr> </table> </div></div></td> </tr> </tbody> </table> </div> <div class="sect2"> <h3 id="_todo_notes">11.2. TODO notes</h3> <div class="paragraph"> <p>Add as a placeholder for documentation still to be written or which is work-in-progress.</p> </div> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 14%;"> <col style="width: 57%;"> <col style="width: 28%;"> </colgroup> <thead> <tr> <th class="tableblock halign-left valign-top">Abbrev.</th> <th class="tableblock halign-left valign-top">Produces</th> <th class="tableblock halign-left valign-top">Example</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adtodo</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre>NOTE: TODO</pre></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> TODO </td> </tr> </table> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adwip</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre>NOTE: WIP - xxx</pre></p> </div> <div class="paragraph"> <p>where:</p> </div> <div class="ulist"> <ul> <li> <p><code>xxx</code> is additional explanatory text</p> </li> </ul> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> WIP - cool new feature </td> </tr> </table> </div></div></td> </tr> </tbody> </table> </div> <div class="sect2"> <h3 id="_xref_to_guides">11.3. Xref to Guides</h3> <div class="paragraph"> <p>Cross-references (links) to the various guides</p> </div> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 14%;"> <col style="width: 57%;"> <col style="width: 28%;"> </colgroup> <thead> <tr> <th class="tableblock halign-left valign-top">Abbrev.</th> <th class="tableblock halign-left valign-top">Produces</th> <th class="tableblock halign-left valign-top">Example</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adcgcom</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre>xref:cgcom.adoc#xxx[ttt]</pre></p> </div> <div class="paragraph"> <p>a hyperlink to a bookmark within the committers' guide, where:</p> </div> <div class="ulist"> <ul> <li> <p><code>xxx</code> is the bookmark&#8217;s anchor</p> </li> <li> <p><code>ttt</code> is the text to display as the hyperlink</p> </li> </ul> </div> <div class="paragraph"> <p>for example:</p> </div> <div class="paragraph"> <p><pre>xref:cgcon.adoc#_cgcom_cutting-a-release[Cutting a release]</pre></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adcgcon</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre>xref:cgcom.adoc#xxx[ttt]</pre> </p><p class="tableblock">a hyperlink to a bookmark within the contributors' guide, where: </p><p class="tableblock">* <code>xxx</code> is the bookmark&#8217;s anchor * <code>ttt</code> is the text to display as the hyperlink </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:cgcon.adoc#_cgcon_asciidoc-templates[Asciidoc templates]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="#_cgcon_asciidoc-templates">Asciidoc templates</a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adrgcfg</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre>xref:rgcfg.adoc#xxx[ttt]</pre> </p><p class="tableblock">a hyperlink to a bookmark within configuration properties guide, where: </p><p class="tableblock">* <code>xxx</code> is the bookmark * <code>ttt</code> is the text to display as the hyperlink </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:rgcfg.adoc#_rgcfg_configuring-core[Configuring Core]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="rgcfg.html#_rgcfg_configuring-core">Configuring Core</a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adrgcs</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre>xref:rgcms.adoc#_rgcms_classes_super_xxx[`xxx`]</pre> </p><p class="tableblock">a hyperlink to the "man page" for a superclass, where: </p><p class="tableblock">* <code>xxx</code> is the superclass (eg <code>AbstractDomainService</code>) </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:rgcms.adoc#_rgcms_classes_super_AbstractService[`AbstractService`]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="rgcms.html#_rgcms_classes_super_AbstractService"><code>AbstractService</code></a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adrgcu</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre>xref:rgcms.adoc#_rgcms_classes_utility_xxx[`xxx`]</pre> </p><p class="tableblock">a hyperlink to the "man page" for a utility class, where: </p><p class="tableblock">* <code>xxx</code> is the utility class (eg <code>TitleBuffer</code>) </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:rgcms.adoc#_rgcms_classes_utility_TitleBuffer[`TitleBuffer`]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="rgcms.html#_rgcms_classes_utility_TitleBuffer"><code>TitleBuffer</code></a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adrgcv</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre>xref:rgcms.adoc#_rgcms_classes_value-types_xxx[`xxx`]</pre> </p><p class="tableblock"></p><p class="tableblock">a hyperlink to the "man page" for an applib value class, where: </p><p class="tableblock">* <code>xxx</code> is the utility class (eg <code>Blob</code>) </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:rgcms.adoc#_rgcms_classes_value-types_Blob[`Blob`]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="rgcms.html#_rgcms_classes_value-types_Blob"><code>Blob</code></a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adrgmp</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre>xref:rgcms.adoc#_rgcms_methods_prefixes_xxx[`xxx...()`]</pre> </p><p class="tableblock">a hyperlink to the "man page" for a prefixed method, where: </p><p class="tableblock">* <code>xxx</code> is the method prefix (eg <code>disable&#8230;&#8203;()</code>) </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:rgcms.adoc#_rgcms_methods_prefixes_disable[`disable...()`]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="rgcms.html#_rgcms_methods_prefixes_disable"><code>disable&#8230;&#8203;()</code></a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adrgmr</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre></pre> </p><p class="tableblock">a hyperlink to the "man page" for a reserved method, where: </p><p class="tableblock">* <code>xxx</code> is the method prefix (eg <code>title()</code>) </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:rgcms.adoc#_rgcms_methods_reserved_title[`title()`]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="rgcms.html#_rgcms_methods_reserved_title"><code>title()</code></a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adrgna</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre>xref:rgant.adoc#_rgant-xxx[`@xxx`&lt;/pre&gt;] </p><p class="tableblock">a hyperlink to the "man page" for an annotation, where: </p><p class="tableblock">* <code>xxx</code> is the annotation type (eg <code>@Action</code>) </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:rgant.adoc#_rgant-Action[`@Action`]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="rgant.html#_rgant-Action"><code>@Action</code></a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adrgnt</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre>xref:rgant.adoc#_rgant-xxx_ttt[`@xxx#ttt()`&lt;/pre&gt;] </p><p class="tableblock">a hyperlink to the "man page" for the specific attribute (field) of an annotation, where: </p><p class="tableblock">* <code>xxx</code> is the annotation type (eg <code>@Action</code>) * <code>ttt</code> is the attribute (eg <code>@semantics</code>) </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:rgant.adoc#_rgant-Action_semantics[`@Action#semantics()`]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="rgant.html#_rgant-Action_semantics"><code>@Action#semantics()</code></a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adrgsa</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre></pre> </p><p class="tableblock">a hyperlink to the "man page" for an (API) domain service, where: </p><p class="tableblock">* <code>xxx</code> is the domain service (eg <code>DomainObjectContainer</code>) </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="rgsvc.html#_rgsvc_api_DomainObjectContainer"><code>DomainObjectContainer</code></a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adrgss</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre></pre> </p><p class="tableblock">a hyperlink to the "man page" for an (SPI) domain service, where: </p><p class="tableblock">* <code>xxx</code> is the domain service (eg <code>ContentMappingService</code>) </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="rgsvc.html#_rgsvc_spi_ContentMappingService"><code>ContentMappingService</code></a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adugfun</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre>xref:ugfun.adoc#xxx[ttt]</pre> </p><p class="tableblock">a hyperlink to a bookmark within the fundamentals users' guide, where: </p><p class="tableblock">* <code>xxx</code> is the bookmark&#8217;s anchor * <code>ttt</code> is the text to display as the hyperlink </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:ugfun.adoc#_ugfun_core-concepts[Core concepts]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="ugfun.html#_ugfun_core-concepts">Core concepts</a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adugvw</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre>xref:ugvw.adoc#xxx[ttt]</pre> </p><p class="tableblock">A hyperlink to a bookmark within the Wicket viewer guide, where: </p><p class="tableblock">* <code>xxx</code> is the bookmark&#8217;s anchor * <code>ttt</code> is the text to display as the hyperlink. </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:ugvw.adoc#_ugvw_customisation[Customisation]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="ugvw.html#_ugvw_customisation">Customisation</a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adugvro</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre>xref:ugvro.adoc#xxx[ttt]</pre> </p><p class="tableblock">A hyperlink to a bookmark within the Restful Objects viewer guide, where: </p><p class="tableblock">* <code>xxx</code> is the bookmark&#8217;s anchor * <code>ttt</code> is the text to display as the hyperlink. </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:ugvro.adoc#_ugvro_ro-spec[RestfulObjects specification]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="ugvro.html#_ugvro_ro-spec">RestfulObjects specification</a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adugsec</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre>xref:ugsec.adoc#xxx[ttt]</pre> </p><p class="tableblock">A hyperlink to a bookmark within the Secrurity guide, where: </p><p class="tableblock">* <code>xxx</code> is the bookmark&#8217;s anchor * <code>ttt</code> is the text to display as the hyperlink. </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:ugsec.adoc#_ugsec_shiro-caching[Caching and other Shiro Features]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="ugsec.html#_ugsec_shiro-caching">Caching and other Shiro Features</a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adugtst</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre>xref:ugtst.adoc#xxx[ttt]</pre> </p><p class="tableblock">A hyperlink to a bookmark within the Testing guide, where: </p><p class="tableblock">* <code>xxx</code> is the bookmark&#8217;s anchor * <code>ttt</code> is the text to display as the hyperlink. </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:ugtst.adoc#_ugtst_bdd-spec-support[BDD Spec Support]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="ugtst.html#_ugtst_bdd-spec-support">BDD Spec Support</a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adugbtb</code></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><pre>xref:ugbtb.adoc#xxx[ttt]</pre> </p><p class="tableblock">A hyperlink to a bookmark within the 'Beyond the Basics' user guide, where: </p><p class="tableblock">* <code>xxx</code> is the bookmark&#8217;s anchor * <code>ttt</code> is the text to display as the hyperlink. </p><p class="tableblock">for example: </p><p class="tableblock"><pre>xref:ugbtb.adoc#_ugbtb_deployment_externalized-configuration[Externalized Configuration]</pre></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="ugbtb.html#_ugbtb_deployment_externalized-configuration">Externalized Configuration</a></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>adugsimpleapp</code></p> </div></div></td> </tr> </tbody> </table> </div> <div class="sect2"> <h3 id="_link_to_isis_addons">11.4. Link to Isis Addons</h3> <div class="paragraph"> <p>Links to (non-ASF) <a href="http://isisaddons.org">Isis Addons</a></p> </div> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 14%;"> <col style="width: 57%;"> <col style="width: 28%;"> </colgroup> <thead> <tr> <th class="tableblock halign-left valign-top">Abbrev.</th> <th class="tableblock halign-left valign-top">Produces</th> <th class="tableblock halign-left valign-top">Example</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adlinkaddons</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre>(non-ASF) link:http://isisaddons.org[Isis Addons]</pre></p> </div> <div class="paragraph"> <p>link to the Isis Addons website.</p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>(non-ASF) <a href="http://isisaddons.org">Isis Addons</a></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adlinkaddonsapp</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre>(non-ASF) http://github.com/isisaddons/isis-app-xxx[Isis addons' xxx&lt;/pre&gt;]</p> </div> <div class="paragraph"> <p>link to the github repo for an example app from the Isis addons; where:</p> </div> <div class="ulist"> <ul> <li> <p><code>xxx</code> is the name of the example app being linked to</p> </li> </ul> </div> <div class="paragraph"> <p>for example:</p> </div> <div class="paragraph"> <p><pre>(non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp]</pre></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>(non-ASF) <a href="http://github.com/isisaddons/isis-app-todoapp">Isis addons' todoapp</a></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adlinkaddonsmodule</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre></pre></p> </div> <div class="paragraph"> <p>link to the github repo for a module from the Isis addons; where:</p> </div> <div class="ulist"> <ul> <li> <p><code>xxx</code> is the name of the module being linked to</p> </li> </ul> </div> <div class="paragraph"> <p>for example:</p> </div> <div class="paragraph"> <p><pre>(non-ASF) http://github.com/isisaddons/isis-module-security[Isis addons' security] module</pre></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>(non-ASF) <a href="http://github.com/isisaddons/isis-module-security">Isis addons' security</a> module</p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adlinkaddonswicket</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre></pre></p> </div> <div class="paragraph"> <p>link to the github repo for a wicket UI component from the Isis addons; where:</p> </div> <div class="ulist"> <ul> <li> <p><code>xxx</code> is the name of the wicket UI component being linked to</p> </li> </ul> </div> <div class="paragraph"> <p>for example:</p> </div> <div class="paragraph"> <p><pre>(non-ASF) http://github.com/isisaddons/isis-wicket-gmap3[Isis addons' gmap3 ] wicket extension</pre></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>(non-ASF) <a href="http://github.com/isisaddons/isis-wicket-gmap3">Isis addons' gmap3 </a> wicket extension</p> </div></div></td> </tr> </tbody> </table> </div> <div class="sect2"> <h3 id="_source_code">11.5. Source code</h3> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 14%;"> <col style="width: 57%;"> <col style="width: 28%;"> </colgroup> <thead> <tr> <th class="tableblock halign-left valign-top">Abbrev.</th> <th class="tableblock halign-left valign-top">Produces</th> <th class="tableblock halign-left valign-top">Example</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adsrcjava</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>[source,java]<br> ----<br> xxx<br> ----</code></p> </div> <div class="paragraph"> <p>where:</p> </div> <div class="ulist"> <ul> <li> <p><code>xxx</code> is the source code snippet.</p> </li> </ul> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="java"><span class="directive">public</span> <span class="type">class</span> <span class="class">Foo</span> { ... }</code></pre> </div> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adsrcjavac</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>as for <code>adsrcjava</code>, but with a caption above</p> </div></div></td> <td class="tableblock halign-left valign-top"><div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adsrcjavascript</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>[source,javascript]<br> ----<br> xxx<br> ----</code></p> </div> <div class="paragraph"> <p>where:</p> </div> <div class="ulist"> <ul> <li> <p><code>xxx</code> is the source code snippet.</p> </li> </ul> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="javascript"><span class="predefined">$</span>(document).ready(<span class="keyword">function</span>() { ... });</code></pre> </div> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adsrcjavascriptc</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>as for <code>adsrcjavascript</code>, but with a caption above</p> </div></div></td> <td class="tableblock halign-left valign-top"><div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adsrcother</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>[source,nnn]<br> ----<br> xxx<br> ----</code></p> </div> <div class="paragraph"> <p>where:</p> </div> <div class="ulist"> <ul> <li> <p><code>nnn</code> is the programming language</p> </li> <li> <p><code>xxx</code> is the source code snippet.</p> </li> </ul> </div></div></td> <td class="tableblock halign-left valign-top"><div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adsrcotherc</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>as for <code>adsrcother</code>, but with a caption above</p> </div></div></td> <td class="tableblock halign-left valign-top"><div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adsrcxml</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><code>[source,javascript]<br> ----<br> xxx<br> ----</code></p> </div> <div class="paragraph"> <p>where:</p> </div> <div class="ulist"> <ul> <li> <p><code>xxx</code> is the source code snippet.</p> </li> </ul> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="xml"><span class="tag">&lt;html&gt;</span> <span class="tag">&lt;title&gt;</span> hello world! <span class="tag">&lt;/title&gt;</span> <span class="tag">&lt;/html&gt;</span></code></pre> </div> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adsrcxmlc</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>as for <code>adsrcxml</code>, but with a caption above</p> </div></div></td> <td class="tableblock halign-left valign-top"><div></div></td> </tr> </tbody> </table> </div> <div class="sect2"> <h3 id="_images">11.6. Images</h3> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 14%;"> <col style="width: 57%;"> <col style="width: 28%;"> </colgroup> <thead> <tr> <th class="tableblock halign-left valign-top">Abbrev.</th> <th class="tableblock halign-left valign-top">Produces</th> <th class="tableblock halign-left valign-top">Example</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adimgfile</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre>image::{_imagesdir}xxx/yyy.png[width="WWWpx",link="{_imagesdir}xxx/yyy.png"]</pre></p> </div> <div class="paragraph"> <p>embeds specified image, where:</p> </div> <div class="ulist"> <ul> <li> <p><code>xxx</code> is the subdirectory under the <code>images/</code> directory</p> </li> <li> <p><code>yyy</code> is the image</p> </li> <li> <p><code>WWW</code> is the width, in pixels.</p> </li> </ul> </div> <div class="paragraph"> <p>for example:</p> </div> <div class="paragraph"> <p><pre>image::{_imagesdir}wicket-viewer/layouts/estatio-Lease.png[width="300px",link="{_imagesdir}wicket-viewer/layouts/estatio-Lease.png"]</pre></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="imageblock"> <div class="content"> <a class="image" href="images/wicket-viewer/layouts/estatio-Lease.png"><img src="images/wicket-viewer/layouts/estatio-Lease.png" alt="estatio Lease" width="300px"></a> </div> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adimgfilec</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>as for <code>adimgfile</code>, but with a caption above</p> </div></div></td> <td class="tableblock halign-left valign-top"><div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adimgurl</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre>image::xxx[width="WWWpx",link="xxx"]</pre></p> </div> <div class="paragraph"> <p>embeds image from specified URL, where:</p> </div> <div class="ulist"> <ul> <li> <p><code>xxx</code> is the URL to the image</p> </li> <li> <p><code>WWW</code> is the width, in pixels.</p> </li> </ul> </div></div></td> <td class="tableblock halign-left valign-top"><div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adimgurlc</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>as for <code>adimgurl</code>, but with a caption above</p> </div></div></td> <td class="tableblock halign-left valign-top"><div></div></td> </tr> </tbody> </table> </div> <div class="sect2"> <h3 id="_youtube_screencasts">11.7. YouTube (screencasts)</h3> <div class="paragraph"> <p>Embedded youtube screencasts</p> </div> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 14%;"> <col style="width: 57%;"> <col style="width: 28%;"> </colgroup> <thead> <tr> <th class="tableblock halign-left valign-top">Abbrev.</th> <th class="tableblock halign-left valign-top">Produces</th> <th class="tableblock halign-left valign-top">Example</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adyoutube</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre>video::xxx[youtube,width="WWWpx",height="HHHpx"]</pre></p> </div> <div class="paragraph"> <p>where:</p> </div> <div class="ulist"> <ul> <li> <p><code>xxx</code> is the youtube reference</p> </li> <li> <p><code>WWW</code> is the width, in pixels</p> </li> <li> <p><code>HHH</code> is the height, in pixels</p> </li> </ul> </div> <div class="paragraph"> <p>for example:</p> </div> <div class="paragraph"> <p><pre>video::bj8735nBRR4[youtube,width="210px",height="118px"] </pre></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="videoblock"> <div class="content"> <iframe width="210px" height="118px" src="//www.youtube.com/embed/bj8735nBRR4?rel=0" frameborder="0" allowfullscreen></iframe> </div> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adyoutubec</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>as for <code>youtube</code>, but with a caption above</p> </div></div></td> <td class="tableblock halign-left valign-top"><div></div></td> </tr> </tbody> </table> </div> <div class="sect2"> <h3 id="_tables">11.8. Tables</h3> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 14%;"> <col style="width: 57%;"> <col style="width: 28%;"> </colgroup> <thead> <tr> <th class="tableblock halign-left valign-top">Abbrev.</th> <th class="tableblock halign-left valign-top">Produces</th> <th class="tableblock halign-left valign-top">Example</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adtbl3</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>Table with 3 columns, 3 rows.</p> </div></div></td> <td class="tableblock halign-left valign-top"><div></div></td> </tr> </tbody> </table> </div> <div class="sect2"> <h3 id="_misc">11.9. Misc.</h3> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 14%;"> <col style="width: 57%;"> <col style="width: 28%;"> </colgroup> <thead> <tr> <th class="tableblock halign-left valign-top">Abbrev.</th> <th class="tableblock halign-left valign-top">Produces</th> <th class="tableblock halign-left valign-top">Example</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adai</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre>Apache Isis</pre><br></p> </div> <div class="paragraph"> <p>That is, the literal text "Apache Isis".</p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p>Apache Isis</p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adlink</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre>link:xxx[ttt]</pre></p> </div> <div class="paragraph"> <p>, where:</p> </div> <div class="ulist"> <ul> <li> <p><code>xxx</code> is</p> </li> <li> <p><code>ttt</code> is the text to display as the hyperlink</p> </li> </ul> </div> <div class="paragraph"> <p>for example:</p> </div> <div class="paragraph"> <p><pre>link:http://isis.apache.org[Apache Isis website]</pre></p> </div></div></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><a href="http://isis.apache.org">Apache Isis website</a></p> </div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adanchany</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre>= anchor:[xxx]</pre></p> </div> <div class="paragraph"> <p>defines an inline anchor to any heading, where:</p> </div> <div class="ulist"> <ul> <li> <p><code>xxx</code> is the anchor text.</p> </li> </ul> </div> <div class="paragraph"> <p>For example:</p> </div> <div class="paragraph"> <p><pre>= anchor:[_ugfun_i18n] Internationalization</pre></p> </div> <div class="paragraph"> <p>An alternative (more commonly used in our documentation) is to use the <code>[[&#8230;&#8203;]]</code> directly above the heading:</p> </div> <div class="paragraph"> <p><pre>[[_ugfun_i18n]] = Internationalization</pre></p> </div></div></td> <td class="tableblock halign-left valign-top"><div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adxrefany</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre>xref:[xxx]</pre></p> </div> <div class="paragraph"> <p>cross-reference to any document/anchor, where:</p> </div> <div class="ulist"> <ul> <li> <p><code>xxx</code> is the fully qualified document with optional anchor</p> </li> </ul> </div></div></td> <td class="tableblock halign-left valign-top"><div></div></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>adfootnote</code></p></td> <td class="tableblock halign-left valign-top"><div><div class="paragraph"> <p><pre>.footnote:[]</pre></p> </div> <div class="paragraph"> <p>defines a footnote</p> </div></div></td> <td class="tableblock halign-left valign-top"><div></div></td> </tr> </tbody> </table> </div> </div> </div> </div> <footer> <hr> <p class="small"> Copyright &copy; 2010~2015 The Apache&nbsp;Software&nbsp;Foundation, licensed under the Apache&nbsp;License,&nbsp;v2.0. <br/> Apache, the Apache feather logo, Apache&nbsp;Isis, and the Apache&nbsp;Isis project logo are all trademarks of The&nbsp;Apache&nbsp;Software&nbsp;Foundation. </p> </footer> </div> <div id="doc-content-right" class="large-3 medium-3 xcolumns"> <div id="toc" class="toc2"> <div class="fallback-toc"> <ul class="sectlevel1"> <li><a href="#_cgcon">1. Contributors' Guide</a> <ul class="sectlevel2"> <li><a href="#_other_guides">1.1. Other Guides</a></li> </ul> </li> <li><a href="#_cgcon_ide">2. Using an IDE</a> <ul class="sectlevel2"> <li><a href="#_cgcon_ide_intellij">2.1. Developing using IntelliJ IDEA</a> <ul class="sectlevel3"> <li><a href="#_installing_and_setting_up">2.1.1. Installing and Setting up</a> <ul class="sectlevel4"> <li><a href="#_download_and_install">Download and Install</a></li> <li><a href="#_new_project">New Project</a></li> <li><a href="#_import_settings">Import Settings</a></li> <li><a href="#_cgcon_ide_intellij_other-settings-compiler">Other Settings (Compiler)</a></li> <li><a href="#_cgcon_ide_intellij_other-settings-maven">Other Settings (Maven)</a></li> <li><a href="#_other_settings_misc">Other Settings (Misc)</a></li> </ul> </li> <li><a href="#_importing_maven_modules">2.1.2. Importing Maven Modules</a></li> <li><a href="#_running">2.1.3. Running</a> <ul class="sectlevel4"> <li><a href="#_running_the_app">Running the App</a></li> <li><a href="#_running_the_unit_tests">Running the Unit Tests</a></li> <li><a href="#_running_the_integration_tests">Running the Integration Tests</a></li> </ul> </li> <li><a href="#_hints_and_tips">2.1.4. Hints and Tips</a> <ul class="sectlevel4"> <li><a href="#_keyboard_cheat_sheets">Keyboard Cheat Sheets</a></li> <li><a href="#_switch_between_tools_editors">Switch between Tools &amp; Editors</a></li> <li><a href="#_navigating_around">Navigating Around</a></li> <li><a href="#_editing">Editing</a></li> <li><a href="#_intentions_and_code_completion">Intentions and Code Completion</a></li> <li><a href="#_refactoring">Refactoring</a></li> <li><a href="#_plugins">Plugins</a></li> <li><a href="#_troubleshooting">Troubleshooting</a></li> </ul> </li> <li><a href="#_running_integration_tests">2.1.5. Running Integration Tests</a></li> <li><a href="#_cgcon_ide_intellij_advanced">2.1.6. Advanced</a> <ul class="sectlevel4"> <li><a href="#_cgcon_ide_intellij_advanced_dcevm">Setting up Dynamic Reloading</a></li> <li><a href="#_setting_up_jrebel">Setting up JRebel</a></li> </ul> </li> </ul> </li> <li><a href="#_cgcon_ide_eclipse">2.2. Developing using Eclipse</a> <ul class="sectlevel3"> <li><a href="#_screencast">2.2.1. Screencast</a></li> <li><a href="#_importing_the_project">2.2.2. Importing the Project</a></li> <li><a href="#_add_datanucleus_support">2.2.3. Add DataNucleus support</a> <ul class="sectlevel4"> <li><a href="#_update_the_classpath">Update the classpath</a></li> <li><a href="#_workaround_for_path_limits_the_dn_plugin_to_use_the_persistence_xml">Workaround for path limits (the DN plugin to use the persistence.xml)</a></li> <li><a href="#_workaround_if_the_enhancer_fails">Workaround: If the enhancer fails</a></li> </ul> </li> <li><a href="#_running_the_app_2">2.2.4. Running the App</a></li> <li><a href="#_other_domain_projects">2.2.5. Other domain projects.</a></li> <li><a href="#_advanced">2.2.6. Advanced</a> <ul class="sectlevel4"> <li><a href="#_setting_up_dynamic_reloading">Setting up Dynamic Reloading</a></li> </ul> </li> </ul> </li> <li><a href="#_cgcon_ide_project-lombok">2.3. Project Lombok</a> <ul class="sectlevel3"> <li><a href="#_future_thoughts">2.3.1. Future thoughts</a></li> </ul> </li> <li><a href="#_cgcon_ide_agilej">2.4. AgileJ</a></li> </ul> </li> <li><a href="#_cgcon_ide-templates">3. Code and File Templates</a> <ul class="sectlevel2"> <li><a href="#_download">3.1. Download</a></li> <li><a href="#_installation">3.2. Installation</a> <ul class="sectlevel3"> <li><a href="#_intellij">3.2.1. IntelliJ</a></li> <li><a href="#_eclipse">3.2.2. Eclipse</a></li> </ul> </li> <li><a href="#_usage">3.3. Usage</a></li> </ul> </li> <li><a href="#_cgcon_cmd-line">4. Command Line and CI</a></li> <li><a href="#_cgcon_isis-maven-plugin">5. Apache Isis Maven Plugin</a> <ul class="sectlevel2"> <li><a href="#__code_appmanifest_code">5.1. <code>AppManifest</code></a></li> <li><a href="#_cgcon_isis-maven-plugin_validate">5.2. <code>validate</code> goal</a> <ul class="sectlevel3"> <li><a href="#__code_dom_code_submodule">5.2.1. <code>dom</code> submodule</a></li> <li><a href="#_to_run">5.2.2. To run</a></li> <li><a href="#_example_of_failure">5.2.3. Example of failure</a></li> <li><a href="#_custom_validation_rules">5.2.4. Custom validation rules</a></li> <li><a href="#_1_9_0_version">5.2.5. 1.9.0 version</a></li> </ul> </li> <li><a href="#_cgcon_isis-maven-plugin_swagger">5.3. <code>swagger</code> goal</a> <ul class="sectlevel3"> <li><a href="#__code_dom_code_submodule_2">5.3.1. <code>dom</code> submodule</a></li> <li><a href="#_to_run_2">5.3.2. To run</a></li> </ul> </li> <li><a href="#_cgcon_isis-maven-plugin_xsd">5.4. <code>xsd</code> goal</a> <ul class="sectlevel3"> <li><a href="#_cgcon_isis-maven-plugin_xsd">5.4.1. <code>xsd</code> submodule</a> <ul class="sectlevel4"> <li><a href="#_xsd_profile">XSD profile</a></li> <li><a href="#_xjc_profile">XJC profile</a></li> </ul> </li> <li><a href="#_to_run_3">5.4.2. To run</a></li> </ul> </li> </ul> </li> <li><a href="#_cgcon_building-isis">6. Building Apache Isis</a> <ul class="sectlevel2"> <li><a href="#_git">6.1. Git</a> <ul class="sectlevel3"> <li><a href="#_installation_2">6.1.1. Installation</a> <ul class="sectlevel4"> <li><a href="#_cloning_the_apache_isis_repo">Cloning the Apache Isis repo</a></li> <li><a href="#_configuring_git">Configuring Git</a></li> </ul> </li> <li><a href="#_getting_help">6.1.2. Getting help</a></li> </ul> </li> <li><a href="#_installing_maven">6.2. Installing Maven</a></li> <li><a href="#_building_all_of_apache_isis">6.3. Building all of Apache Isis</a></li> <li><a href="#_checking_for_vulnerabilities">6.4. Checking for Vulnerabilities</a></li> <li><a href="#_checking_for_use_of_internal_jdk_apis">6.5. Checking for use of internal JDK APIs</a></li> </ul> </li> <li><a href="#_cgcon_contributing">7. Contributing</a> <ul class="sectlevel2"> <li><a href="#_recommended_workflow_github">7.1. Recommended Workflow (github)</a></li> <li><a href="#_alternative_workflow_jira_patches">7.2. Alternative Workflow (JIRA patches)</a></li> <li><a href="#_setting_up_your_fork_clone">7.3. Setting up your fork/clone</a></li> <li><a href="#_commit_messages">7.4. Commit messages</a></li> <li><a href="#_creating_the_patch_file">7.5. Creating the patch file</a></li> <li><a href="#_sample_contribution_workflow">7.6. Sample Contribution Workflow</a> <ul class="sectlevel3"> <li><a href="#_update_your_master_branch">7.6.1. Update your master branch</a></li> <li><a href="#_create_a_topic_branch">7.6.2. Create a topic branch</a></li> <li><a href="#_make_file_changes_and_commit">7.6.3. Make File Changes and Commit</a></li> <li><a href="#_rebasing_with_code_master_code">7.6.4. Rebasing with <code>master</code></a></li> <li><a href="#_raising_a_pull_request">7.6.5. Raising a pull request</a></li> </ul> </li> <li><a href="#_if_your_pull_request_is_accepted">7.7. If your pull request is accepted</a> <ul class="sectlevel3"> <li><a href="#_if_your_pull_request_is_rejected">7.7.1. If your pull request is rejected</a></li> </ul> </li> </ul> </li> <li><a href="#_cgcon_policies">8. Policies</a> <ul class="sectlevel2"> <li><a href="#_cgcom_versioning-policy">8.1. Versioning Policy</a> <ul class="sectlevel3"> <li><a href="#_semantic_versioning">8.1.1. Semantic Versioning</a></li> <li><a href="#_version_ranges">8.1.2. Version ranges</a></li> </ul> </li> <li><a href="#_cgcon_policies_git-policy">8.2. Git Policy</a> <ul class="sectlevel3"> <li><a href="#_workflow">8.2.1. Workflow</a></li> <li><a href="#_commit_message">8.2.2. Commit message</a></li> </ul> </li> </ul> </li> <li><a href="#_cgcon_asciidoc">9. AsciiDoc Documentation</a> <ul class="sectlevel2"> <li><a href="#_where_to_find_the_docs">9.1. Where to find the Docs</a></li> <li><a href="#_naming_conventions">9.2. Naming Conventions</a></li> <li><a href="#_writing_the_docs">9.3. Writing the docs</a></li> <li><a href="#_build_and_review_using_maven">9.4. Build and Review (using Maven)</a></li> <li><a href="#_instant_rebuild_using_ruby">9.5. Instant Rebuild (using Ruby)</a> <ul class="sectlevel3"> <li><a href="#_one_time_setup">9.5.1. One-time setup</a></li> <li><a href="#_instant_rebuild">9.5.2. Instant Rebuild</a></li> </ul> </li> <li><a href="#_publish_procedure">9.6. Publish procedure</a> <ul class="sectlevel3"> <li><a href="#_one_time_setup_2">9.6.1. One-time setup</a></li> <li><a href="#_publishing">9.6.2. Publishing</a></li> </ul> </li> </ul> </li> <li><a href="#_cgcon_git-cookbook">10. Appendix: Git Cookbook</a> <ul class="sectlevel2"> <li><a href="#_modifying_existing_files">10.1. Modifying existing files</a></li> <li><a href="#_adding_new_files">10.2. Adding new files</a></li> <li><a href="#_deleting_files">10.3. Deleting files</a></li> <li><a href="#_renaming_or_moving_files">10.4. Renaming or moving files</a></li> <li><a href="#_common_workflows">10.5. Common Workflows</a></li> <li><a href="#_backing_up_a_local_branch">10.6. Backing up a local branch</a></li> <li><a href="#_quick_change_stashing_changes">10.7. Quick change: stashing changes</a></li> <li><a href="#_ignoring_files">10.8. Ignoring files</a></li> <li><a href="#_more_advanced_use_cases">10.9. More advanced use cases</a> <ul class="sectlevel3"> <li><a href="#_if_accidentally_push_to_remote">10.9.1. If accidentally push to remote</a></li> </ul> </li> <li><a href="#_if_you_ve_accidentally_worked_on_code_master_code_branch">10.10. If you&#8217;ve accidentally worked on <code>master</code> branch</a></li> <li><a href="#_if_you_ve_forgotten_to_prefix_your_commits_but_not_pushed">10.11. If you&#8217;ve forgotten to prefix your commits (but not pushed)</a></li> </ul> </li> <li><a href="#_cgcon_asciidoc-templates">11. Appendix: Asciidoc Templates</a> <ul class="sectlevel2"> <li><a href="#_callouts">11.1. Callouts</a></li> <li><a href="#_todo_notes">11.2. TODO notes</a></li> <li><a href="#_xref_to_guides">11.3. Xref to Guides</a></li> <li><a href="#_link_to_isis_addons">11.4. Link to Isis Addons</a></li> <li><a href="#_source_code">11.5. Source code</a></li> <li><a href="#_images">11.6. Images</a></li> <li><a href="#_youtube_screencasts">11.7. YouTube (screencasts)</a></li> <li><a href="#_tables">11.8. Tables</a></li> <li><a href="#_misc">11.9. Misc.</a></li> </ul> </li> </ul> </div> </div> </div> </div> <script src="../js/foundation/5.5.1/vendor/jquery.js"></script> <script src="../js/foundation/5.5.1/foundation.min.js"></script> <link href="../css/jquery.tocify/1.9.0/jquery.tocify.css" rel="stylesheet"> <script src="../js/jqueryui/1.11.4/jquery-ui.min.js"></script> <script src="../js/jquery.tocify/1.9.0/jquery.tocify.js"></script> <script type="text/javascript"> $(function () { $("#toc").tocify({ scrollTo: 50, extendPage: true, context: "#doc-content", highlightOnScroll: true, hashGenerator: "pretty", hideEffect: "slideUp", selectors: "h2,h3,h4,h5" }); $(".fallback-toc").hide(); }); </script> <script type="text/javascript"> /**** $(document).foundation(); $(document).ready(function(){ // Cache selectors var lastId, topMenu = $("div#toc ul"), topMenuHeight = 100, menuItems = topMenu.find("a"), menuItemsHrefs = menuItems.map(function(){ var item = $($(this).attr("href")); if (item.length) { return item; } }); // Bind click handler to menu items to scroll animation menuItems.click(function(e){ var href = $(this).attr("href"), offsetTop = href === "#" ? 0 : $(href).offset().top-topMenuHeight+1; $('html, body').stop().animate({ scrollTop: offsetTop }, 300); e.preventDefault(); }); // Bind to scroll of window $( window ).scroll(function(){ // Get container scroll position var fromTop = $(this).scrollTop()+topMenuHeight; var cur = menuItemsHrefs.map(function(){ if ($(this).offset().top < fromTop) return this; }); // Get the id of the current element cur = cur[cur.length-1]; var id = cur && cur.length ? cur[0].id : ""; if (lastId !== id && id) { scrollTo(id); } window.history.pushState({}, "", window.location.origin + window.location.pathname + "#" + id); }); scrollTo = function(id) { lastId = id; menuItems .removeClass("active"); menuItems .parents() .removeClass("active-region"); menuItems .parents("ul").hide(); menuItems .filter("[href=#"+id+"]") .addClass("active"); menuItems .filter("[href=#"+id+"]") .parents("ul").show(); menuItems .filter("[href=#"+id+"]") .parent().children("ul").show(); menuItems .filter("[href=#"+id+"]") .parents("li").addClass("active-region"); } menuItems .removeClass("active"); menuItems .parents() .removeClass("active-region"); var syncMenuItem; if(window.location.hash!=="") { var menuItemFor = $.grep(menuItems, function(e) { return e.hash === window.location.hash; }); console.log(menuItemFor); if(menuItemFor.length === 1) { syncMenuItem = menuItemFor[0]; } } if(!syncMenuItem){ syncMenuItem = menuItems[0]; } $(syncMenuItem).click(); }); ***/ </script> <script type="text/javascript"> $(document).ready(function(){ if("Documentation" === "Contributors Guide") { console.log( "processing 'Documentation'" ); $("#doc-content-left").removeClass("large-9").removeClass("medium-9").addClass("large-12").addClass("medium-12"); $("#doc-content-right").removeClass("large-3").removeClass("medium-3").hide(); } }); </script> <script> $( document ).ready(function() { (function() { $(function() { return $("#doc-content h2, #doc-content h3, #doc-content h4, #doc-content h5, #doc-content h6").each(function(i, el) { var $el, icon, id; $el = $(el); id = $el.attr('id'); icon = '<i class="fa fa-link"></i>'; if (id) { return $el.prepend($("<a />").addClass("header-link").attr("href", "#" + id).html(icon)); } }); }); }).call(this); /* http://osvaldas.info/auto-hide-sticky-header MIT license */ ;( function( $, window, document, undefined ) { 'use strict'; var elSelector = '.header', elClassHidden = 'header--hidden', throttleTimeout = 500, $element = $( elSelector ); if( !$element.length ) return true; var $window = $( window ), wHeight = 0, wScrollCurrent = 0, wScrollBefore = 0, wScrollDiff = 0, $document = $( document ), dHeight = 0, throttle = function( delay, fn ) { var last, deferTimer; return function() { var context = this, args = arguments, now = +new Date; if( last && now < last + delay ) { clearTimeout( deferTimer ); deferTimer = setTimeout( function(){ last = now; fn.apply( context, args ); }, delay ); } else { last = now; fn.apply( context, args ); } }; }; $window.on( 'scroll', throttle( throttleTimeout, function() { dHeight = $document.height(); wHeight = $window.height(); wScrollCurrent = $window.scrollTop(); wScrollDiff = wScrollBefore - wScrollCurrent; if( wScrollCurrent <= 0 ) // scrolled to the very top; element sticks to the top $element.removeClass( elClassHidden ); else if( wScrollDiff > 0 && $element.hasClass( elClassHidden ) ) // scrolled up; element slides in $element.removeClass( elClassHidden ); else if( wScrollDiff < 0 ) // scrolled down { if( wScrollCurrent + wHeight >= dHeight && $element.hasClass( elClassHidden ) ) // scrolled to the very bottom; element slides in $element.removeClass( elClassHidden ); else // scrolled down; element slides out $element.addClass( elClassHidden ); } wScrollBefore = wScrollCurrent; })); })( jQuery, window, document ); }); </script> </body> </html>