This is an example Bootique Cayenne app.
Different Git branches contain example code for different versions of Bootique:
To build and run the project, ensure you have the following installed on your machine:
- Docker
- Java 11 or newer
- Maven
and then follow these steps:
git clone [email protected]:bootique-examples/bootique-cayenne-examples.git
cd bootique-cayenne-examples
This starts a Postgres instance listening on port 15433, with login credentials of postgres
/ test
, and
creates a simple test schema:
docker-compose -f docker-compose.yml up -d
Run the following command to build the code, run the tests and package the app:
mvn clean package
The following command prints a help message with supported options:
java -jar target/bootique-cayenne-examples-3.0.jar
NAME
bootique-cayenne-examples-3.0.jar
OPTIONS
--config=yaml_location
Specifies YAML config location, which can be a file path or a URL.
--count
Checks row count in articles table for default domain
-h, --help
Prints this message.
-H [prefix], --help-config[=prefix]
Prints information about application modules and their configuration options.
Optionally, you can provide a 'prefix' argument to print only the specified
config.
-i, --insert
Insert test data the DB
Notice how there's no short version of either --count
or --config
flags, as both start with the same letter c
,
and the full name should be used to avoid ambiguity.
Run the -i
(or --insert
) command to create some sample data in the DB. DB location and login credential are
specified in the provided config.yml
.
java -jar target/bootique-cayenne-examples-3.0.jar --config config.yml -i
Run the --count
command to display the data inserted in the previous step (
java -jar target/bootique-cayenne-examples-3.0.jar --config config.yml --count