A service for running preferential voting elections.
If you are getting weird Eclipse errors, try mvn install
then Eclipse project clean.
- Install the Java 7 SDK (the version that appengine uses)
- Install Eclipse EE. Make sure it is EE!
- Install the Google Plugin for Eclipse and Google App Engine SDK. Click here for instructions.
- Git checkout the project.
- Import the project into Eclipse as an existing maven project.
- Resolve errors
- Create directory preferential-voting/target/generated-sources/annotations. Try compiling to get this to go away.
- For "Plugin execution not covered by lifecycle configuration: ...endpoints_get_discovery_doc...", mark it as ignored in Eclipse preferences.
- "Target Runtime Google App Engine (...) is not defined." - Quick Fix create new runtime Google App Engine
- Project > Maven > Update Project
- Add
maven clean install
run configuration in Eclipse and run. (This does Dagger stuff). - Add
maven install
run configuration in Eclipse and run.
Some of these steps were taken from Using Apache Maven. Take a look there if you get lost.
To test locally, you'll need to have a local MySQL server running.
-
Install a mysql server.
-
Download mysql-server by following the instructions here. Make sure you get mysql version 5.7. For linux, follow all of the instructions on [A Quick Guide to Using the MySQL APT Repository](A Quick Guide to Using the MySQL APT Repository).
-
Run
set_up_local_db.sql
by running the following command (changing<password>
to the root's password):mysql -hlocalhost -uroot -p<password> < set_up_local_db.sql
set_up_local_db.sql
does not work well if things are already set up. If you are trying to update, it might be best to delete the user and database beforehand or run all of the commands manually.
- Run the
appengine:devserver
maven target to start devserver. - Navigate to
http://localhost:8080/_ah/api/explorer
in a browser. - Allow unsafe scripts (sometimes not necessary). In Chrome, click on the shield at the right side of the navigation bar.
- Find the endpoint you wish to use.
For more information, see Google Cloud Platform's Testing and Deploying an API Backend.
You will need to do this every time you change a Dagger class.
- Run the maven
clean
andcompile
goals. - Refresh the project if errors persist. (F5 on project in explorer)