This example relies on the DataNucleus Maven plugin. Check the database configuration in the datanucleus.properties file and the JDBC driver dependency specified in the pom.xml file. In addition, the project contains the server and client example codes.
Run the following command to build everything and enhance the DB classes:
mvn clean compile
Make sure that the database was correctly configured. Use the contents of the file create-message.sql to create the database and grant privileges. For example,
mysql –uroot -p < sql/create-messages.sql
Run the following command to update the database metadata.
mvn datanucleus:enhance
Run the following command to create database schema for this sample.
mvn datanucleus:schema-create
To launch the server run the command
mvn jetty:run
Now, the client sample code can be executed in a new command window with
mvn exec:java -Pclient
To generate doxygen reports (MUST install doxygen & configure system variables first)
mvn doxygen:report
To copy generated html directory into docs folder
mvn validate
To remove generated target files including dir docs with html code
mvn clean