Skip to content

Seedstack Developer Guide

Hervé Stern edited this page Sep 19, 2020 · 6 revisions

Local Developpement and Testing

Developments on Seedstack are made on forked copies of main repository.

Please see Github recommendations here

First Steps

  1. update project version in pom.xml files, if required

    Example: mvn versions:set versions:commit -DnewVersion=19.11-SNAPSHOT

  2. update CHANGELOG.md file

  3. For an addon, update seed.version and parent-internal to the latest versions

Testing

Integration tests

Integration tests can be run using:

mvn integration-test

Test Project

You can also create a test project. For an add-on, the project could become a sample. Create a test project In you test project, override the dependency version to the module you are updating.

For example:

<dependency>
    <groupId>org.seedstack.seed</groupId>
    <artifactId>seed-rest-jersey2</artifactId>
    <version>3.8.1-SNAPSHOT</version>
</dependency>

Quality

Run you Maven install using quality profile to execute SpotBugs checks.

Usage tips

Live reload

Undertow applications can be launched using command: mvn seedstack:watch, in parallel with Chrome plugin LiveReload. (new plugin for source change detection). See here for more information.

How to populate database

Example with MongoDB for application called hseed, having

domain package:

  • class Client (extends BaseAggregateRoot),
  • class ClientId (extends BaseValueObject),
  • interface ClientRepository (extends Repository<Client, ClientId>)

interface package:

  • class ClientRepositoryImpl (extends BaseMorphiaRepository<Client, ClientId> and implements ClientRepository)

infrastructure package:

  • class ClientDto (POJO) with DataSet annotation, where
    • group = "hseed":
    • name = "client" : associated object
  • class ClientDtoImporter : extends BaseDataImporter

Method importData is overridden, for example with:

dtos.forEach(dto -> repository.add(new Client(new ClientId(dto.getId()), dto.getCode())));

test/resources/META-INF/data/hseed/client.json : file containing data to load.

Configuration properties

In application.yaml or preferably application.override.yaml, properties can be set for DataConfig object. Available properties are

  • importOnStart (default = true)
  • clearBeforeImport (default = true)
  • forceImport (default = true)

For example:

business:
  data:
    forceImport: true

Appendices

Intellij Plugin

Enables developer to link configuration properties (in application.yaml) with associated classes.

See: