EAR Setup Verifier
This project is a sample for verifying correct system development setup.
If it can be built and run, the system has the correct setup and is ready for the B6B33EAR course.
Software Requirements
- Java 8 (download here)
- NetBeans 8 (download here) or any other Java IDE
- Apache Maven 3 (download here)
- NodeJS 4 or later (download here)
- npm (should be installed together with NodeJS)
- PostgreSQL 9 and later (download here)
- Apache Tomcat 8 (download here) or any other Java EE 7 Web compatible application server
Feel free to install the software using your system's package manager.
Application Setup
This is the shortest path setup without any customizations. Feel free to modify your setup in any way you like.
We are assuming that PostgreSQL is running at localhost:5432
(see src/main/resources/jdbc.properties
).
We are also assuming that Apache Tomcat is used with its default port - 8080.
PostgreSQL database setup
1. start `psql`
2. `CREATE USER ear WITH password 'ear';`
3. `CREATE DATABASE ear WITH OWNER ear;`
Setup without IDE
- Create a database named ear, owned by user ear identified by password ear (again, see
src/main/resources/jdbc.properties
). - Go to
src/main/webapp
and runnpm install
- this downloads JavaScript dependencies used by the UI implementation. This operation takes some time. - In the same folder, run
npm run build
- this packs the whole JavaScript-based UI into one bundle -js/bundle.js
. - Go back to the project's root (i.e. the directory where this README file is located) and run
mvn clean package
- this uses maven to download Java dependencies of the project and builds a deployable war archive with the application. - Copy the resulting archive -
ear-setup.war
fromtarget
into your Tomcat'swebapps
directory.- E.g. if you unpacked Tomcat into
/opt/apache-tomcat-8.0.37
, copy the war file into/opt/apache-tomcat-8.0.37/webapps
- E.g. if you unpacked Tomcat into
- Start Tomcat by running
startup.sh
(orstartup.bat
) in thebin
directory of your Tomcat. - Go to http://localhost:8080/ear-setup - you should see a table of people who will be teaching you, including their contact emails and rooms where to find them.
- Congratulations, you are done!
Setup with NetBeans IDE
- Same as above.
- Same as above.
- Same as above.
- Open NetBeans, go to Services, right click on Servers and add your Tomcat installation if it is not already present (NetBeans installer enables you to automatically download and install Tomcat).
- Enter some user credentials in Step 2 (e.g. admin/admin) and check the
Create user if it does not exist
checkbox, otherwise NetBeans won't be able to start Tomcat.
- Enter some user credentials in Step 2 (e.g. admin/admin) and check the
- Click Open Project and select this project.
-
Clean and Build the project (
Shift + F11
). - Click Run Project.
- If a server selection dialog opens, select the server you added in Step 4 (and also select the
Remember Permanently
option). - A browser will automatically open at http://localhost:8080/ear-setup.
- If not, open it manually.
- Congratulations, you are done!