<!doctype html><htmllang=enclass="js csstransforms3d"><head><metacharset=utf-8><metaname=viewportcontent="width=device-width,initial-scale=1"><metaname=generatorcontent="Hugo 0.80.0"><metaname=descriptioncontent="Strolch is a parameterized framework for use on servers and IoT"><metaname=authorcontent="Strolch"><linkrel=iconhref=/favicon.icotype=image/ico><title>Development - Strolch</title><linkhref=/css/nucleus.css?1626091329rel=stylesheet><linkhref=/css/fontawesome-all.min.css?1626091329rel=stylesheet><linkhref=/css/hybrid.css?1626091329rel=stylesheet><linkhref=/css/featherlight.min.css?1626091329rel=stylesheet><linkhref=/css/perfect-scrollbar.min.css?1626091329rel=stylesheet><linkhref=/css/auto-complete.css?1626091329rel=stylesheet><linkhref=/css/atom-one-dark-reasonable.css?1626091329rel=stylesheet><linkhref=/css/theme.css?1626091329rel=stylesheet><linkhref=/css/hugo-theme.css?1626091329rel=stylesheet><linkhref=/css/theme-green.css?1626091329rel=stylesheet><scriptsrc=/js/jquery-3.3.1.min.js?1626091329></script><style>:root#header+#content>#left>#rlblock_left{display:none!important}</style></head><bodydata-url=/development/><navid=sidebar><divid=header-wrapper><divid=header><aid=logohref=/><imgsrc=/logo.png></a></div><divclass=searchbox><labelfor=search-by><iclass="fas fa-search"></i></label><inputdata-search-inputid=search-bytype=searchplaceholder=Search...>
<spandata-search-clear><iclass="fas fa-times"></i></span></div><scripttype=text/javascriptsrc=/js/lunr.min.js?1626091329></script><scripttype=text/javascriptsrc=/js/auto-complete.js?1626091329></script><scripttype=text/javascript>varbaseurl="https:\/\/strolch.li\/";</script><scripttype=text/javascriptsrc=/js/search.js?1626091329></script></div><sectionid=homelinks><ul><li><aclass=paddinghref=/><iclass="fas fa-home"></i>Home</a></li></ul></section><divclass=highlightable><ulclass=topics><lidata-nav-id=/api/title=APIclass=dd-item><ahref=/api/>API</a></li><lidata-nav-id=/history/title=Historyclass=dd-item><ahref=/history/>History</a></li><lidata-nav-id=/documentation/title=Documentationclass=dd-item><ahref=/documentation/>Documentation</a><ul><lidata-nav-id=/documentation/architecture/title=Architectureclass=dd-item><ahref=/documentation/architecture/>Architecture</a></li><lidata-nav-id=/documentation/model/title=Modelclass=dd-item><ahref=/documentation/model/>Model</a></li><lidata-nav-id=/documentation/do-and-donts/title="Do and Don't"class=dd-item><ahref=/documentation/do-and-donts/>Do and Don't</a></li><lidata-nav-id=/documentation/runtime-configuration/title="Runtime Configuration"class=dd-item><ahref=/documentation/runtime-configuration/>Runtime Configuration</a></li><lidata-nav-id=/documentation/realms/title=Realmsclass=dd-item><ahref=/documentation/realms/>Realms</a></li><lidata-nav-id=/documentation/components/title=Componentsclass=dd-item><ahref=/documentation/components/>Components</a></li><lidata-nav-id=/documentation/services-and-commands/title="Services and Commands"class=dd-item><ahref=/documentation/services-and-commands/>Services and Commands</a></li><lidata-nav-id=/documentation/searches/title=Searchesclass=dd-item><ahref=/documentation/searches/>Searches</a></li><lidata-nav-id=/documentation/queries/title=Queriesclass=dd-item><ahref=/documentation/queries/>Queries</a></li><lidata-nav-id=/documentation/transactions/title=Transactionsclass=dd-item><ahref=/documentation/transactions/>Transactions</a></li><lidata-nav-id=/documentation/policies/title=Policiesclass=dd-item><ahref=/documentation/policies/>Policies</a></li><lidata-nav-id=/documentation/observers/title=Observersclass=dd-item><ahref=/documentation/observers/>Observers</a></li><lidata-nav-id=/documentation/versioning/title=Versioningclass=dd-item><ahref=/documentation/versioning/>Versioning</a></li><lidata-nav-id=/documentation/reports/title=Reportsclass=dd-item><ahref=/documentation/reports/>Reports</a></li><lidata-nav-id=/documentation/priviles/title=Privilegesclass=dd-item><ahref=/documentation/priviles/>Privileges</a></li></ul></li><lidata-nav-id=/plc/title=PLCclass=dd-item><ahref=/plc/>PLC</a><ul><lidata-nav-id=/plc/architecture/title=Architectureclass=dd-item><ahref=/plc/architecture/>Architecture</a></li><lidata-nav-id=/plc/example-set-up/title="Example Set-Up"class=dd-item><ahref=/plc/example-set-up/>Example Set-Up</a></li></ul></li><lidata-nav-id=/tutorial/title=Tutorialclass=dd-item><ahref=/tutorial/>Tutorial</a><ul><lidata-nav-id=/tutorial/configuration/title=Configurationclass=dd-item><ahref=/tutorial/configuration/>Configuration</a></li><lidata-nav-id=/tutorial/model/title=Modelclass=dd-item><ahref=/tutorial/model/>Model</a></li><lidata-nav-id=/tutorial/crud-book/title="CRUD Book"class=dd-item><ahref=/tutorial/crud-book/>CRUD Book</a></li></ul></li><lidata-nav-id=/download/title=Downloadclass=dd-item><ahref=/download/>Download</a></li><lidata-nav-id=/development/title=Developmentclass="dd-item
active"><ahref=/development/>Development</a></li></ul><sectionid=shortcuts><h3>More</h3><ul><li><aclass=paddinghref=https://strolch.li/tags><iclass="fas fa-tags"></i>Tags</a></li><li><aclass=paddinghref=https://github.com/strolch-li><iclass="fab fa-github"></i>GitHub project</a></li></ul></section><sectionid=footer><p>Built with <ahref=https://github.com/matcornic/hugo-theme-learn><iclass="fas fa-heart"></i></a>from <ahref=https://getgrav.org>Grav</a> and <ahref=https://gohugo.io/>Hugo</a></p></section></div></nav><sectionid=body><divid=overlay></div><divclass="padding highlightable"><div><divid=top-bar><divid=top-github-link><aclass=github-linktitle="Edit this page"href=https://github.com/Pi4J/pi4j.github.io/tree/main/contentdevelopment/_index.mdtarget=blank><iclass="fas fa-code-branch"></i><spanid=top-github-link-text>Edit this page</span></a></div><divid=breadcrumbsitemscopeitemtype=http://data-vocabulary.org/Breadcrumb><spanid=sidebar-toggle-span><ahref=#id=sidebar-toggledata-sidebar-toggle><iclass="fas fa-bars"></i></a></span><spanid=toc-menu><iclass="fas fa-list-alt"></i></span><spanclass=links><ahref=/>Strolch Overview</a> > Development</span></div><divclass=progress><divclass=wrapper><navid=TableOfContents><ul><li><ahref=#prerequisites>Prerequisites</a></li><li><ahref=#building-strolch>Building Strolch</a></li><li><ahref=#creating-a-strolch-app>Creating a Strolch App</a><ul><li><ahref=#creating-a-java-strolch-web-app>Creating a Java Strolch Web App</a></li><li><ahref=#creating-a-simple-java-strolch-app>Creating a simple Java Strolch App</a></li></ul></li><li><ahref=#tools-used>Tools used</a></li></ul></nav></div></div></div></div><divid=head-tags></div><divid=body-inner><h1>Development</h1><h2id=prerequisites>Prerequisites</h2><p>To start developing Strolch you need an installed:</p><ul><li>Java JDK 11</li><li>Apache Maven 3.x</li></ul><h2id=building-strolch>Building Strolch</h2><p>Setting up Strolch is just a few lines:</p><divclass=highlight><prestyle=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><codeclass=language-shelldata-lang=shell>git clone https://github.com/4treesCH/strolch.git
</code></pre></div><divclass="notices tip"><p>Note: To run the tests you will need to configure the PostgreSQL Databases. See
the README in the module.</p></div><p>After running the Maven build, you will have a full build of all Strolch
projects. Now you can start modifying the projects, and add your own features,
or, far more interesting, start developing your projects using the Strolch
agent.</p><h2id=creating-a-strolch-app>Creating a Strolch App</h2><p>To create your own Strolch App, you can use Maven’s archetype generation. There
are two versions, one is a simple Java App which you can use to directly access
the Strolch runtime, and the second is to create a Java Web App, which is the
usual way to run Strolch runtimes.</p><divclass="notices tip"><p>Note: you need to have installed Strolch to your local maven repo, otherwise the
archetype won’t be available.</p></div><h3id=creating-a-java-strolch-web-app>Creating a Java Strolch Web App</h3><p>The following shows the maven command to create the new maven project. Note that you should replace the placeholders in the brackets:</p><divclass=highlight><prestyle=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><codeclass=language-shelldata-lang=shell>mvn archetype:generate <spanstyle=color:#ae81ff>\
</code></pre></div><h4id=install-the-web-dependencies>Install the web dependencies</h4><p>The Strolch Web App uses <ahref=https://nodejs.org/download/release/v11.15.0/>NodeJS v11.x</a> to build the web dependencies. Please
download the relevant platform’s package, unpack it, and add the <code>bin</code> directory
to your path variable.</p><p>Once NodeJS is installed, then you can prepare the web dependencies:</p><divclass=highlight><prestyle=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><codeclass=language-shelldata-lang=shell>cd src/main/webapp/
npm install gulp -g
npm install
gulp
</code></pre></div><divclass="notices tip"><p>Note: Whenever the bower.json is changed then you should
again call npm install inside the webapp folder.</p></div><h4id=building-the-war>Building the WAR</h4><p>Building the WAR uses the <code>package</code> maven goal, but to have the optimized WAR
use the <code>release</code> profile:</p><divclass=highlight><prestyle=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><codeclass=language-shelldata-lang=shell>mvn clean package -Prelease
</code></pre></div><p>Happy coding =))</p><h3id=creating-a-simple-java-strolch-app>Creating a simple Java Strolch App</h3><p>The following shows the maven command to create the new maven project. Note that
you should replace the placeholders in the brackets:</p><divclass=highlight><prestyle=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><codeclass=language-shelldata-lang=shell>mvn archetype:generate <spanstyle=color:#ae81ff>\
</code></pre></div><p>You change into the directory of the new project and then build the project by calling:</p><divclass=highlight><prestyle=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><codeclass=language-shelldata-lang=shell>cd <my-artifactId>
mvn clean package
</code></pre></div><p>Start the program using:</p><divclass=highlight><prestyle=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><codeclass=language-shelldata-lang=shell>mvn exec:java
</code></pre></div><p>Happy coding =))</p><h2id=tools-used>Tools used</h2><p>The following tools are used to develop Strolch and Strolch-based projects:</p><ul><li><ahref="https://www.jetbrains.com/idea/download/#section=linux"target=_blank>IntelliJ</a></li><li><ahref=https://maven.apache.org/target=_blank>Apache Maven</a></li><li><ahref=http://git-scm.com/target=_blank>Git SCM</a></li></ul><footerclass=footline></footer></div></div><divid=navigation><aclass="nav nav-prev"href=/download/title=Download><iclass="fa fa-chevron-left"></i></a><aclass="nav nav-next"href=/api/title=APIstyle=margin-right:0><iclass="fa fa-chevron-right"></i></a></div></section><divstyle=left:-1000px;overflow:scroll;position:absolute;top:-1000px;border:none;box-sizing:content-box;height:200px;margin:0;padding:0;width:200px><divstyle=border:none;box-sizing:content-box;height:200px;margin:0;padding:0;width:200px></div></div><scriptsrc=/js/clipboard.min.js?1626091329></script><scriptsrc=/js/perfect-scrollbar.min.js?1626091329></script><scriptsrc=/js/perfect-scrollbar.jquery.min.js?1626091329></script><scriptsrc=/js/jquery.sticky.js?1626091329></script><scriptsrc=/js/featherlight.min.js?1626091329></script><scriptsrc=/js/highlight.pack.js?1626091329></script><script>hljs.initHighlightingOnLoad();</script><scriptsrc=/js/modernizr.custom-3.6.0.js?1626091329></script><scriptsrc=/js/learn.js?1626091329></script><scriptsrc=/js/hugo-learn.js?1626091329></script><scriptsrc=/mermaid/mermaid.js?1626091329></script><script>mermaid.initialize({startOnLoad:true});</script></body></html>