497 lines
20 KiB
HTML
497 lines
20 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="google-site-verification" content="CPhbjooaiTdROm7Vs4E7kuHZvBfkeLUtonGgcVUbTL8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="description" content="">
|
|
<meta name="author" content="">
|
|
<link rel="shortcut icon" href="ico/favicon.ico">
|
|
|
|
<title>Strolch: Development</title>
|
|
|
|
<!-- Bootstrap core CSS -->
|
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
<!-- Custom styles for this template -->
|
|
<link href="css/custom.css" rel="stylesheet">
|
|
|
|
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --><!--[if lt IE 9]>
|
|
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
|
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script><![endif]-->
|
|
</head>
|
|
<body>
|
|
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
|
<div class="container">
|
|
<div class="navbar-header">
|
|
<a class="navbar-brand" href="index.html">Strolch</a>
|
|
</div>
|
|
<div class="collapse navbar-collapse">
|
|
<ul class="nav navbar-nav">
|
|
<li><a href="index.html">Overview</a></li>
|
|
<li><a href="api.html">API</a></li>
|
|
<li><a href="documentation.html">Documentation</a></li>
|
|
<li><a href="tutorial.html">Tutorial</a></li>
|
|
<li><a href="downloads.html">Downloads</a></li>
|
|
<li class="active"><a href="development.html">Development</a></li>
|
|
<li><a href="blog.html">Blog</a></li>
|
|
</ul>
|
|
</div><!--/.nav-collapse -->
|
|
</div>
|
|
</div>
|
|
|
|
<div class="container">
|
|
|
|
<div class="page-header">
|
|
<h1 class="page-title">Development</h1>
|
|
<p class="lead page-description">This page describes how to setup the development environment.</p>
|
|
</div>
|
|
|
|
<div class="content">
|
|
<h2>Prerequisites</h2>
|
|
To start developing Strolch you need an installed:
|
|
<ul>
|
|
<li>Java JDK 8</li>
|
|
<li>Apache Maven 3</li>
|
|
</ul>
|
|
|
|
<h2>Getting Started</h2>
|
|
<p>Setting up Strolch is just a few lines:</p>
|
|
<pre class="pre">
|
|
git clone https://github.com/4treesCH/strolch.git
|
|
cd strolch
|
|
mvn clean install -DskipTests</pre>
|
|
|
|
<p><b>Note:</b> To run the tests you will need to configure the PostgreSQL Databases. See the README in the
|
|
module.</p>
|
|
|
|
<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>
|
|
|
|
<h2>Strolch Project Configuration</h2>
|
|
<p>To use Strolch in your own projects, look at the two tutorial apps on how they are configured. You can also
|
|
simply copy the projects, modify the Maven POMs and remove what ever you do not need.</p>
|
|
|
|
<p>The following sections describe the Strolch configuration files and folder structure.</p>
|
|
|
|
<p>You can also use the minimal project structures:</p>
|
|
<ul>
|
|
<li><a href="https://github.com/4treesCH/strolch/tree/develop/strolch_minimal">strolch_minimal</a></li>
|
|
<li><a href="https://github.com/4treesCH/strolch/tree/develop/strolch_minimal_rest">strolch_minimal_rest</a>
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Project Structure</h3>
|
|
<p>Strolch requires two main directories under the Strolch root:</p>
|
|
<ul>
|
|
<li>../config/ → contains the Strolch runtime configuration
|
|
<ul>
|
|
<li>StrolchConfiguration.xml → Main Strolch configuration file. There you configure the
|
|
different realms, environments etc.
|
|
</li>
|
|
<li>PrivilegeConfig.xml → Configuration of the Privilege library</li>
|
|
<li>PrivilegeModel.xml → Configuration file with the differen users, roles and privileges</li>
|
|
</ul>
|
|
</li>
|
|
<li>../data/ → contains the Strolch model and any other data which is modified at runtime.
|
|
<ul>
|
|
<li>StrolchModel.xml → main model file which is read when Strolch is in <i>TRANSIENT</i> mode.
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Maven POM</h3>
|
|
<p>Strolch is built using Maven, so here we show the minimum Maven POM.</p>
|
|
|
|
<h4>Simple Java App POM</h4>
|
|
<p>This POM creates a compressed file which contains a runnable Strolch instance. Just unpack and run the <i>startup.sh</i>
|
|
script.</p>
|
|
<pre class="pre-scrollable">
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<properties>
|
|
<strolch.version>1.0.0-SNAPSHOT</strolch.version>
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
<finalName>strolch_app</finalName>
|
|
<m2eclipse.wtp.contextRoot>${finalName}</m2eclipse.wtp.contextRoot>
|
|
<buildTimestamp>${maven.build.timestamp}</buildTimestamp>
|
|
</properties>
|
|
|
|
<groupId>org.example</groupId>
|
|
<artifactId>org.example.strolch.app</artifactId>
|
|
<version>1.2.3</version>
|
|
<name>org.example.strolch.app</name>
|
|
|
|
<scm>
|
|
<developerConnection>scm:git:https://git.example.org/strolch_app.git</developerConnection>
|
|
</scm>
|
|
|
|
<dependencyManagement>
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>li.strolch</groupId>
|
|
<artifactId>li.strolch.bom</artifactId>
|
|
<type>pom</type>
|
|
<version>${strolch.version}</version>
|
|
</dependency>
|
|
</dependencies>
|
|
</dependencyManagement>
|
|
|
|
<dependencies>
|
|
<!-- main -->
|
|
<dependency>
|
|
<groupId>li.strolch</groupId>
|
|
<artifactId>li.strolch.model</artifactId>
|
|
<version>${strolch.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>li.strolch</groupId>
|
|
<artifactId>li.strolch.agent</artifactId>
|
|
<version>${strolch.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>li.strolch</groupId>
|
|
<artifactId>li.strolch.service</artifactId>
|
|
<version>${strolch.version}</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.slf4j</groupId>
|
|
<artifactId>slf4j-log4j12</artifactId>
|
|
<scope>runtime</scope>
|
|
<version>1.7.2</version>
|
|
</dependency>
|
|
|
|
<!-- test dependencies -->
|
|
<dependency>
|
|
<groupId>junit</groupId>
|
|
<artifactId>junit</artifactId>
|
|
<scope>test</scope>
|
|
<version>4.11</version>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
<build>
|
|
<finalName>${finalName}</finalName>
|
|
<resources>
|
|
<resource>
|
|
<directory>src/main/resources</directory>
|
|
<filtering>true</filtering>
|
|
<includes>
|
|
<include>**/componentVersion.properties</include>
|
|
</includes>
|
|
</resource>
|
|
<resource>
|
|
<directory>src/main/resources</directory>
|
|
<filtering>false</filtering>
|
|
<excludes>
|
|
<exclude>**/componentVersion.properties</exclude>
|
|
</excludes>
|
|
</resource>
|
|
</resources>
|
|
<plugins>
|
|
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<version>3.0</version>
|
|
<configuration>
|
|
<source>1.7</source>
|
|
<target>1.7</target>
|
|
<showDeprecation>true</showDeprecation>
|
|
<showWarnings>true</showWarnings>
|
|
<compilerArgument>-Xlint:all</compilerArgument>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
<plugin>
|
|
<groupId>org.codehaus.mojo</groupId>
|
|
<artifactId>buildnumber-maven-plugin</artifactId>
|
|
<version>1.2</version>
|
|
<executions>
|
|
<execution>
|
|
<phase>validate</phase>
|
|
<goals>
|
|
<goal>create</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
<configuration>
|
|
<doCheck>false</doCheck>
|
|
<doUpdate>false</doUpdate>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-jar-plugin</artifactId>
|
|
<configuration>
|
|
<archive>
|
|
<manifest>
|
|
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
|
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
|
|
|
|
<!-- When creating an executable jar, use copy-dependencies plugin with libs in lib/ dir: -->
|
|
<mainClass>li.strolch.tutorialapp.main.Main</mainClass>
|
|
<addClasspath>true</addClasspath>
|
|
<classpathPrefix>lib/</classpathPrefix>
|
|
</manifest>
|
|
</archive>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-assembly-plugin</artifactId>
|
|
<configuration>
|
|
<descriptor>src/assembly/bin.xml</descriptor>
|
|
<finalName>tutorial-app-${project.version}</finalName>
|
|
</configuration>
|
|
<executions>
|
|
<execution>
|
|
<phase>package</phase>
|
|
<goals>
|
|
<goal>single</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</project></pre>
|
|
|
|
<h4>Webapp POM</h4>
|
|
<p>This creates a simple WAR which starts Strolch after deployed to a servlet container.</p>
|
|
<pre class="pre-scrollable">
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<properties>
|
|
<strolch.version>1.2.3</strolch.version>
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
<warFinalName>strolch_webapp</warFinalName>
|
|
<m2eclipse.wtp.contextRoot>${warFinalName}</m2eclipse.wtp.contextRoot>
|
|
<buildTimestamp>${maven.build.timestamp}</buildTimestamp>
|
|
</properties>
|
|
|
|
<groupId>org.example</groupId>
|
|
<artifactId>org.example.strolch.webapp</artifactId>
|
|
<version>1.0.0-SNAPSHOT</version>
|
|
<name>org.example.strolch.webapp</name>
|
|
<packaging>war</packaging>
|
|
|
|
<scm>
|
|
<developerConnection>scm:git:https://git.example.org/strolch_webapp.git</developerConnection>
|
|
</scm>
|
|
|
|
<dependencyManagement>
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>li.strolch</groupId>
|
|
<artifactId>li.strolch.bom</artifactId>
|
|
<type>pom</type>
|
|
<version>${strolch.version}</version>
|
|
</dependency>
|
|
</dependencies>
|
|
</dependencyManagement>
|
|
|
|
<dependencies>
|
|
<!-- main -->
|
|
<dependency>
|
|
<groupId>li.strolch</groupId>
|
|
<artifactId>li.strolch.model</artifactId>
|
|
<version>${strolch.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>li.strolch</groupId>
|
|
<artifactId>li.strolch.agent</artifactId>
|
|
<version>${strolch.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>li.strolch</groupId>
|
|
<artifactId>li.strolch.service</artifactId>
|
|
<version>${strolch.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>li.strolch</groupId>
|
|
<artifactId>li.strolch.rest</artifactId>
|
|
<version>${strolch.version}</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.slf4j</groupId>
|
|
<artifactId>slf4j-log4j12</artifactId>
|
|
<scope>runtime</scope>
|
|
<version>1.7.2</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>javax.servlet</groupId>
|
|
<artifactId>javax.servlet-api</artifactId>
|
|
<version>3.0.1</version>
|
|
<scope>provided</scope>
|
|
</dependency>
|
|
|
|
<!-- test dependencies -->
|
|
<dependency>
|
|
<groupId>junit</groupId>
|
|
<artifactId>junit</artifactId>
|
|
<scope>test</scope>
|
|
<version>4.11</version>
|
|
</dependency>
|
|
|
|
</dependencies>
|
|
|
|
<build>
|
|
<finalName>${warFinalName}</finalName>
|
|
<resources>
|
|
<resource>
|
|
<directory>src/main/resources</directory>
|
|
<filtering>true</filtering>
|
|
<includes>
|
|
<include>**/componentVersion.properties</include>
|
|
</includes>
|
|
</resource>
|
|
<resource>
|
|
<directory>src/main/resources</directory>
|
|
<filtering>false</filtering>
|
|
<excludes>
|
|
<exclude>**/componentVersion.properties</exclude>
|
|
</excludes>
|
|
</resource>
|
|
</resources>
|
|
|
|
<plugins>
|
|
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<version>3.0</version>
|
|
<configuration>
|
|
<source>1.7</source>
|
|
<target>1.7</target>
|
|
<showDeprecation>true</showDeprecation>
|
|
<showWarnings>true</showWarnings>
|
|
<compilerArgument>-Xlint:all</compilerArgument>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
<plugin>
|
|
<groupId>org.codehaus.mojo</groupId>
|
|
<artifactId>buildnumber-maven-plugin</artifactId>
|
|
<version>1.2</version>
|
|
<executions>
|
|
<execution>
|
|
<phase>validate</phase>
|
|
<goals>
|
|
<goal>create</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
<configuration>
|
|
<doCheck>false</doCheck>
|
|
<doUpdate>false</doUpdate>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-war-plugin</artifactId>
|
|
<configuration>
|
|
<failOnMissingWebXml>false</failOnMissingWebXml>
|
|
<warName>${warFinalName}</warName>
|
|
<webResources>
|
|
<resource>
|
|
<directory>src/main/non-packaged-resources</directory>
|
|
<targetPath>WEB-INF</targetPath>
|
|
<filtering>true</filtering>
|
|
<includes>
|
|
<include>**/ENV.properties</include>
|
|
</includes>
|
|
</resource>
|
|
</webResources>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
</plugins>
|
|
</build>
|
|
|
|
<profiles>
|
|
<profile>
|
|
<id>m2e</id>
|
|
<!-- This profile is only activated when building in Eclipse with m2e -->
|
|
<activation>
|
|
<property>
|
|
<name>m2e.version</name>
|
|
</property>
|
|
</activation>
|
|
<properties>
|
|
<strolch.env>dev</strolch.env>
|
|
</properties>
|
|
</profile>
|
|
</profiles>
|
|
</project></pre>
|
|
|
|
<p>Happy coding =))</p>
|
|
|
|
<!-- content here -->
|
|
|
|
<h3>Tools used</h3>
|
|
The following tools are used to develop Strolch and Strolch-based projects:
|
|
<ul class="list-unstyled">
|
|
<li><a href="https://www.eclipse.org/downloads/"><img style="height: 50px" class="img-thumbnail"
|
|
src="https://www.eclipse.org/downloads/packages/sites/all/themes/solstice/_themes/solstice_packages/logo.png"
|
|
alt="Eclipse Luna JEE version"/></a></li>
|
|
<li><a href="https://maven.apache.org/"><img width="250" style="height: 50px; margin-top: 10px"
|
|
class="img-thumbnail"
|
|
src="http://maven.apache.org/images/maventxt_logo_200.gif"
|
|
alt="Apache Maven 3.0"/></a></li>
|
|
<li><a href="http://git-scm.com/"><img style="height: 50px; margin-top: 10px" class="img-thumbnail"
|
|
src="http://git-scm.com/images/logo@2x.png" alt="git scm"/></a></li>
|
|
</ul>
|
|
|
|
</div><!-- /.content -->
|
|
|
|
<div id="footer">
|
|
<div class="container">
|
|
<p class="text-muted">© Strolch / <a href="mailto:eitch@eitchnet.ch">Robert von Burg</a> / Hosting by
|
|
<a href="http://www.eitchnet.ch">eitchnet.ch</a></p>
|
|
</div>
|
|
</div>
|
|
|
|
</div><!-- /.container -->
|
|
|
|
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
|
<!-- Include all compiled plugins (below), or include individual xsd as needed -->
|
|
<script src="js/bootstrap.min.js"></script>
|
|
|
|
<!-- Piwik -->
|
|
<script type="text/javascript">
|
|
var _paq = _paq || [];
|
|
_paq.push(['trackPageView']);
|
|
_paq.push(['enableLinkTracking']);
|
|
(function () {
|
|
var u = (("https:" == document.location.protocol) ? "https" : "http") + "://piwik.eitchnet.ch/";
|
|
_paq.push(['setTrackerUrl', u + 'piwik.php']);
|
|
_paq.push(['setSiteId', 2]);
|
|
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
|
|
g.type = 'text/javascript';
|
|
g.defer = true;
|
|
g.async = true;
|
|
g.src = u + 'piwik.js';
|
|
s.parentNode.insertBefore(g, s);
|
|
})();
|
|
</script>
|
|
<noscript><p><img src="http://piwik.eitchnet.ch/piwik.php?idsite=2" style="border:0;" alt=""/></p></noscript>
|
|
<!-- End Piwik Code -->
|
|
|
|
</body>
|
|
</html>
|