Maven
Apache Maven is a build automation tool used primarily for Java projects.
It is used for the SimStadt project in order to:
- manage dependencies
- compile
- run tests
- create a package containing executables, libraries and workflows.
Run Maven from terminal
mvn clean package
can be run in any folder containing a pom.xml
file.
In order to compile every package, mvn clean package
should be run inside simstadt/simstadt-reactor
[INFO] Building zip: simstadt/simstadt-reactor/simstadt-bundle/target/SimStadt_0.10.0-SNAPSHOT_refactor_20210210_8cdc823.zip
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for SimStadt Reactor 0.10.0-SNAPSHOT:
[INFO]
[INFO] SimStadt Reactor ................................... SUCCESS [ 2.178 s]
[INFO] Interface Tools .................................... SUCCESS [ 3.692 s]
[INFO] Building Data Libraries ............................ SUCCESS [ 4.811 s]
[INFO] Geo Libs ........................................... SUCCESS [ 1.730 s]
[INFO] template-processing ................................ SUCCESS [ 0.242 s]
[INFO] Simulation Plugins ................................. SUCCESS [ 0.378 s]
[INFO] District Heating Network ........................... SUCCESS [ 0.364 s]
[INFO] Hierarchic Workflows ............................... SUCCESS [ 0.665 s]
[INFO] Ecore Import ....................................... SUCCESS [ 0.468 s]
[INFO] Geometric Preprocessing ............................ SUCCESS [ 0.372 s]
[INFO] Financial Analysis ................................. SUCCESS [ 0.266 s]
[INFO] Weather Processing ................................. SUCCESS [ 0.364 s]
[INFO] Irradiance Processing .............................. SUCCESS [ 0.166 s]
[INFO] SimStadt Data Model ................................ SUCCESS [ 0.373 s]
[INFO] Monthly Energy Balance ............................. SUCCESS [ 0.615 s]
[INFO] Simplified Radiosity Algorithm ..................... SUCCESS [ 0.377 s]
[INFO] SimStadt ........................................... SUCCESS [ 1.880 s]
[INFO] SimStadt Workflows Energy .......................... SUCCESS [ 1.399 s]
[INFO] SimStadt Workflows Load-Profile .................... SUCCESS [ 0.652 s]
[INFO] Documentation Templates ............................ SUCCESS [ 0.260 s]
[INFO] SimStadt Desktop ................................... SUCCESS [ 0.409 s]
[INFO] SimStadt Bundle .................................... SUCCESS [ 12.506 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.544 s
[INFO] Finished at: 2021-02-10T11:23:02+01:00
[INFO] ------------------------------------------------------------------------
mvn clean package 80,79s user 2,62s system 227% cpu 36,615 total
Tests might run for a very long time. A flag can be used in order to skip them : mvn clean package -DskipTests=true
The resulting zip package will be saved inside simstadt/simstadt-reactor/simstadt-bundle/target/
.
Run Maven Eclipse
Maven can also be run from Eclipse.
clean package
can be used as Maven Goals, and Skip Tests
can be checked if desired.
Missing dependencies
If mvn clean package
fails with:
[INFO] SimStadt Bundle .................................... FAILURE [ 0.081 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.231 s
[INFO] Finished at: 2021-02-10T11:39:37+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project simstadt-bundle: Could not resolve dependencies for project eu.simstadt:simstadt-bundle:pom:0.10.0-SNAPSHOT: Could not find artifact eu.simstadt:region-chooser:jar:0.2.2-SNAPSHOT in non-maven-libs (file://simstadt/simstadt-reactor/simstadt-bundle//../non-maven-libs) -> [Help 1]
It means that RegionChooser should be downloaded, compiled and installed first. See RegionChooser#install.