To start developing Strolch you need an installed:
Note: You don’t have to build Strolch if you want to use the version on Maven central, but if you need a snapshot version, or the release you want isn’t on central, then go ahead and build Strolch.
Building Strolch is just a few lines:
git clone https://github.com/strolch-li/strolch.git
cd strolch
mvn clean install -DskipTests
Note: To run the tests you will need to configure the PostgreSQL Databases. See the README in the module.
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.
You can convert an existing application to a Strolch agent, but this might be a bit daunting in the beginning. If you are planning on doing this, first create a test application using the maven archetypes, so that you can get a feel for the configuration.
Once that works, use the archetypes configuration to reconfigure your project to start as a Strolch agent.
Note: Beware to select the archetype pertaining to your use case:
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.
Note: you need to have installed Strolch to your local maven repo, otherwise the archetype won’t be available.
The following shows the maven command to create the new maven project. Note that you should replace the placeholders in the brackets:
The code is also available on GitHub.
mvn archetype:generate \
-DarchetypeGroupId=li.strolch \
-DarchetypeArtifactId=li.strolch.mvn.archetype.webapp \
-DarchetypeVersion=1.6.0-SNAPSHOT \
-DgroupId=<my.groupid> \
-DartifactId=<my-artifactId> \
-Dversion=<my.version> \
-DappName="<my app name>"
The Strolch Web App uses NodeJS v11.x to build the web dependencies. Please
download the relevant platform’s package, unpack it, and add the bin
directory
to your path variable.
Once NodeJS is installed, then you can prepare the web dependencies:
cd src/main/webapp/
npm install gulp -g
npm install
gulp
Note: Whenever the bower.json is changed then you should again call npm install inside the webapp folder.
Building the WAR uses the package
maven goal, but to have the optimized WAR
use the release
profile:
mvn clean package -Prelease
Happy coding =))
The following shows the maven command to create the new maven project. Note that you should replace the placeholders in the brackets:
The code is also available on GitHub.
mvn archetype:generate \
-DarchetypeGroupId=li.strolch \
-DarchetypeArtifactId=li.strolch.mvn.archetype.main \
-DarchetypeVersion=1.6.0-SNAPSHOT \
-DgroupId=<my.groupid> \
-DartifactId=<my-artifactId> \
-Dversion=<my.version> \
-DappName="<my app name>"
You change into the directory of the new project and then build the project by calling:
cd <my-artifactId>
mvn clean package
Start the program using:
mvn exec:java
Happy coding =))
The following tools are used to develop Strolch and Strolch-based projects: