-
Notifications
You must be signed in to change notification settings - Fork 4
Seedstack Developer Guide
Developments on Seedstack are made on forked copies of main repository.
For example, to work on Seed project, fork https://github.com/seedstack/seed, then clone your forked project.
If required, set upstream in forked project; for example, with distribution project:
git remote add upstream https://github.com/seedstack/distribution.git
First steps are:
-
update project version in pom.xml files, if required
Example:
mvn versions:set versions:commit -DnewVersion=19.11-SNAPSHOT -
update CHANGELOG.md file
-
update version of component in distribution/pom.xml
One can develop and test directly in seed project (prefer IT tests), and in a test project. To implement current framework developments in a test project, one has two possibilities, as seen below.
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>
Or
<dependency>
<groupId>org.seedstack.seed</groupId>
<artifactId>seed-web-core</artifactId>
<version>3.8.1-SNAPSHOT</version>
</dependency>
Fork, then checkout project https://github.com/seedstack/distribution.
If required:
- update current version (e.g. 3.8.0-SNAPSHOT)
- under dependencyManagement, update version for org.seedstack:seedstack-bom (e.g. 18.11-SNAPSHOT)
If required:
- update version (e.g. 18.11-SNAPSHOT)
- update seed.version (e.g. 3.8.0-SNAPSHOT)
If required:
- update version (ex. 18.11-SNAPSHOT)
Integration tests can be run using:
mvn integration-test
Classes can be mapped to configuration objects from application.yaml using @Config annotation.
Warning: Attributes cannot be static to be mappable.
Attributes can be mapped to configuration objects using @Configuration annotation.
Config Tool can find configuration classes (@Config] and their non-static attributes.
It cannot find usages of @Configuration annotation.
EffectiveConfig tool displays user-defined configuration based on application<.override>.(yaml|yml|json|properties) files available in the classpath.
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.
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
ConfigTool enables access to various information regarding configuration.
Dumps the configuration as scanned, parsed and aggregated by SeedStack
See: http://seedstack.org/docs/maven-plugin/effective-config/
Maven
mvn -q seedstack:effective-config
Java
java -Dseedstack.tool=effective-config -jar target/hsweb-capsule.jar
Dumps all the configuration options available in the project
See: http://seedstack.org/docs/maven-plugin/config/
Maven
mvn -q seedstack:config
Java
java -Dseedstack.tool=config -jar target/hsweb-capsule.jar
Enables developer to link configuration properties (in application.yaml) with associated classes.
See:
Note: not totally functional with Intellij Community Edition 2017.