You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/DEVELOPMENT_ENVIRONMENT.md
+12-16
Original file line number
Diff line number
Diff line change
@@ -19,11 +19,9 @@ Note: To work with the Android app JDK 17 is needed for the gradle build. The ne
19
19
20
20
The SORMAS CI is using JDK 17 to build all modules. The only known difference though are slight differences in the Java time API that affect unit tests, so again there is no need to setup two JDKs on your local system.
21
21
22
-
## Step 3: Install Maven & Ant
23
-
Download and install Maven for your operating system, see [binaries](https://dlcdn.apache.org/maven/maven-3/3.6.3/binaries/)
24
-
*IMPORTANT*: M2_HOME environment variable needs to be set. By default, for newer version, it is set to MAVEN_HOME. But Ant script is looking for M2_HOME, please refer to the [official documentation](https://maven.apache.org/install.html)
25
-
26
-
Download and install Ant, it can be done from [Ant site](https://ant.apache.org/bindownload.cgi) or with packages from your Linux distribution.
22
+
## Step 3: Install Maven
23
+
The scripts in `sormas-base/dev` expect `mvn` as command-line tool.
24
+
Download and install Maven for your operating system, see [binaries](https://dlcdn.apache.org/maven/maven-3/3.6.3/binaries/).
27
25
28
26
## Step 4: Install a Local SORMAS Server
29
27
Please follow the [Server Installation Instructions](../docs/SERVER_SETUP.md#sormas-installation) to set up a local SORMAS instance that you will use to test your code. Alternatively, you can also use [Maven Cargo](../sormas-cargoserver/README.md), or a [Docker installation](SERVER_DOCKER_SETUP.md) (not recommended at this time).
@@ -36,8 +34,8 @@ Please follow the [Server Installation Instructions](../docs/SERVER_SETUP.md#sor
36
34
-*Optional:* Clone the SORMAS-Project repository if you haven't done so already
37
35
- Open the project in IntelliJ. Make sure the project is recognized by IntelliJ as a `maven project`; if not, right-click the `pom.xml` file in `sormas-base` and select `Add as maven project`.
38
36
- Make sure that under `File -> Project Structure -> Modules` all modules EXCEPT sormas-app are recognized; if not, add the missing modules with the `+` button
39
-
- Navigate to `File -> Settings -> Plugins` and make sure that Glassfish & Ant integrations are enabled
40
-
- Make a copy of `sormas-base/build.properties.example`, rename it to `build.properties` and set `glassfish.domain.root` to the location of the SORMAS domain inside your Payara installation
37
+
- Navigate to `File -> Settings -> Plugins` and make sure that Glassfish integration is enabled
38
+
- Make a copy of `sormas-base/dev.env.example`, rename it to `dev.env` and set `GLASSFISH_DOMAIN_ROOT` to the location of the SORMAS domain inside your Payara installation
41
39
- Run `mvn install` on the `sormas-base` project (e.g. by opening the Maven view and executing `sormas-base -> Lifecycle -> install`)
42
40
- Add a Payara server to IntelliJ:
43
41
- Open `Run -> Edit Configurations`, add a new configuration and choose the Glassfish server template
@@ -50,8 +48,7 @@ Please follow the [Server Installation Instructions](../docs/SERVER_SETUP.md#sor
50
48
- Open the `Logs` tab and add a new log file pointing to the `logs/server.log` file in your SORMAS domain
51
49
- Open the `Startup/Connection` tab and make sure that `Pass environment variables` is NOT checked; ignore warnings about the debug configuration not being correct
52
50
- Open the `config/domain.xml` file in your domain directory and make sure that the `java-config` node contains the following code: `<java-config classpath-suffix="" debug-enabled="true" debug-options="-agentlib:jdwp=transport=dt_socket,address=6009,server=n,suspend=y" ...`
53
-
- Open the Ant window, click on the `+` icon and select the `sormas-base/build.xml` file
54
-
- Execute the `install` and `deploy-serverlibs` Ant scripts
51
+
- Execute the `dev/build.sh` and `dev/deploy-serverlibs.sh` scripts
55
52
- Set the default working directory for run configurations by navigating to `Run -> Edit Configurations -> Templates -> Application` and setting `Working directory` to `$MODULE_WORKING_DIR$`
56
53
-*Optional:* Setup database access from Intellij: Open View -> Tool View -> Database, click on + icon and select DataSource -> PostgreSQL and configure the database (set user and password and download the missing driver files if needed)
57
54
@@ -66,10 +63,9 @@ Please follow the [Server Installation Instructions](../docs/SERVER_SETUP.md#sor
66
63
- Install the [Payara Tools plugin](https://marketplace.eclipse.org/content/payara-tools)
67
64
- Install the [Vaadin Plugin for Eclipse](https://marketplace.eclipse.org/content/vaadin-plugin-eclipse); the commercial UI designer is not needed
68
65
- Add a Payara server to Eclipse and enter the credentials you specified when setting up the local SORMAS server
69
-
- Make a copy of `sormas-base/build.properties.example`, rename it to `build.properties` and set `glassfish.domain.root` to the location of the SORMAS domain inside your Payara installation
70
-
- Drag the `sormas-base/build.xml` file into the Ant view in Eclipse
71
-
- Either run `mvn install` on the `sormas-base` project or execute the `install [default]` Ant script (this needs a Maven installation on your system with the M2_HOME variable set)
72
-
- Execute the `deploy-serverlibs` Ant script
66
+
- Make a copy of `sormas-base/dev.env.example`, rename it to `dev.env` and set `GLASSFISH_DOMAIN_ROOT` to the location of the SORMAS domain inside your Payara installation
67
+
- Either run `mvn install` on the `sormas-base` project or execute the `dev/build.sh` script (for example with Git Bash)
68
+
- Execute `dev/deploy-serverlibs.sh` script
73
69
- Highlight all Eclipse projects and choose `Maven -> Update Project` from the right-click menu; perform the update for all projects
74
70
- Start the Glassfish server and deploy `sormas-ear`, `sormas-rest` and `sormas-ui` by dragging the respective projects onto it, or use the `Add and Remove...` function by right-clicking on the server (make sure to respect this order as there are depdendencies between artifacts at startup)
75
71
- Open your browser and type in `http://localhost:6080/sormas-ui` to test whether the server and IDE have been set up correctly
@@ -87,7 +83,7 @@ Please follow the [Server Installation Instructions](../docs/SERVER_SETUP.md#sor
87
83
- Add an emulator and set the SDK version to the `minSdkVersion` or `targetSdkVersion` from `build.gradle`; we suggest to test your code on both, but `minSdkVersion` should be preferred to ensure compatibility to the minimum supported SDK
88
84
- Click on `Run 'app'` to install and run the app on your emulator; enter `http://10.0.2.2:6080/sormas-rest` as the server URL when you start the newly installed app for the first time
89
85
90
-
**Important:** Whenever you do or pull changes in the `sormas-api` project that you want to use in the mobile app or that are referenced there already, you need to execute the `install` Ant script to notify the `sormas-app` project of the changes.
86
+
**Important:** Whenever you do or pull changes in the `sormas-api` project that you want to use in the mobile app or that are referenced there already, you need to execute the `dev/build.sh` script to notify the `sormas-app` project of the changes.
91
87
92
88
## Step 6: Configure Code Formatting and Import Settings
93
89
In order to ensure a consistent code style and prevent so-called edit wars, we have set up custom configuration files for automatic code formatting and import ordering. Please make sure to adhere to the following steps for your IDE(s) before you start developing.
@@ -132,12 +128,12 @@ Optional, but strongly recommended:
132
128
-> For every installation, kill all Java/javaw processes and check the availability of 6048 port number.
133
129
-> Delete files with generated domain folders and payara. In order to have a clean installation of each next ./server-setup.sh run.
134
130
135
-
6.M2_HOME need to be set. By default, for newer version, it is set to MAVEN_HOME. But Ant script is looking for M2_HOME
131
+
6.For the `sormas-base/dev` scripts Maven needs to be installed as command-line tool or defined in `sormas-base/dev.env` as `MVN_BIN` which Maven to be used.
136
132
137
133
7. For eclipse formatted plugin, there is an issue for Idea: <https://plugins.jetbrains.com/plugin/6546-eclipse-code-formatter> - `cannot save settings Path to custom eclipse folder is not valid` - it works only when settings were saved from down to up. And not vice versa.
138
134
139
135
If something is still not working:
140
-
-> Stop the payara domain, run Ant deploy-serverlibs to update libs
136
+
-> Stop the payara domain, run `dev/deploy-serverlibs.sh` to update libs
141
137
-> clean up (delete all from domains/sormas/autodeploy, domains/sormas/applications, domains/sormas/generated, and domains/sormas/osgi-cache) try to build again by executing `mvn clean install -DskipTests` on the `sormas-base` module
0 commit comments