There are a few packages that you should have installed before attempting to work on the project:
Node.js
- The NodeJS runtimenpm
- NodeJS package manager; used to install project dependenciesmaven
- Java build tool and package managerbower
- JavaScript package managerkarma
- JavaScript test runner. (We'll be using the Jasmine Test Framework with this.)- Java 8
If you're using a Mac, the best way to install the prerequisites is via brew. On Linux, apt-get should be able to install them as well.
Steps for building the project:
- Clone the repository (via git)
- Navigate to the directory Badge_Web
- Install bower and npm related dependencies.
npm install -g bower
- Navigate to the src/main/webapp directory and type the following:
bower install
npm install -g jasmine-core
npm install -g karma-jasmine
npm install -g phantomjs
npm install -g karma-phantomjs-launcher
- Navigate back to the root directory and type
mvn clean package
- To run the code, type:
java -jar target/badge-web-VERSION.war
Note: To run the code in test, type:java -jar -Dspring.profiles.active=test target/badge-web-VERSION.war
- Launch the following url: http://localhost:8080
- If this is the first time the application has been started, navigate to: http://localhost:8080/#!/admin to set an admin password. You will then be redirected to the login page to login with the admin credentials that were created.
- Run the web unit tests by navigating to the test directory and typing:
karma start
- Increment the project version in the pom.xml file.
- Create a github personal access token. Do not share this nor commit it.
- Modify your ~/.m2/settings.xml to include a server block similar to:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>github</id>
<username>YOUR_USERNAME</username>
<password>GH_TOKEN</password>
</server>
</servers>
</settings>
- mvn clean package github-release-plugin:gh-upload
- Verify the release looks correct at: https://github.com/srqsoftware-hacknight/Badge_Web/releases