feat: added comments and readme

This commit is contained in:
Rick Rongen
2025-09-16 09:10:09 +02:00
parent e0527ff6bb
commit d6b5c7fc81
5 changed files with 67 additions and 27 deletions

47
README.MD Normal file
View File

@@ -0,0 +1,47 @@
# SFG SB Common
This project contains common code shared by all spring boot projects build for Sligro Food Group.
## Projects
- spring-boot-parent
- spring-boot-common-utils
### spring-boot-parent
This project is intended to be consumed by other projects as their parent.
It inherits from the spring-boot-starter-parent from the Spring project it self.
It also specifies the versions of all other sfg-sb-common projects, so that any consumer can easily obtain a compatible version for their project.
### spring-boot-common-utils
This project defines some common utilities which will be used by most projects. Like:
- logging
See the README in that folder for more details.
## Adding a project
To add a new project, a few steps need to be taken.
- A new maven module needs to be created
- It should define the root project as it's parent (NOTE: this is not the spring-boot-parent module)
- It should NOT define a group id or a version
- It should define an SCM section
- It should NOT a distribution section
- It should be added to the `<modules>` section in the root pom
- It should be added to the `<dependencyManagement>` section of the spring-boot-parent pom
// TODO: improve this section
## Releasing
// TODO: create a Jenkins pipeline for this
A release should be done using the maven release plugin.
In GIT, it will create a commit with the exact version, tag it and create a commit with the next version.
In Maven it will set the exact version (without snapshot). Both as the project version, as well as the dependency management versions.
To create a release, execute:
- `mvn release:prepare`
- `mvn release:perform`
Optionally add `--batch-mode` to `mvn` to make Maven non-interactive.
Otherwise, accept the default versions provided by release plugin.

View File

@@ -15,12 +15,6 @@
<artifactId>lib-1</artifactId> <artifactId>lib-1</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>

View File

@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<scm> <scm>
<connection>scm:git:ssh://gitea@gitea.rickrongen.nl:8789/RickRongen/tmp-sbcommon.git</connection> <connection>scm:git:ssh://gitea@gitea.rickrongen.nl:8789/RickRongen/tmp-sbcommon.git</connection>
<url>ssh://gitea@gitea.rickrongen.nl:8789/RickRongen/tmp-sbcommon.git</url> <url>https://gitea.rickrongen.nl/RickRongen/tmp-sbcommon</url>
<tag>HEAD</tag> <tag>HEAD</tag>
</scm> </scm>
@@ -23,6 +23,10 @@
</modules> </modules>
<properties> <properties>
<!--
These properties are shared within this repository, but they are NOT used by the spring-boot-parent module
Any consumers of the parent module thus don't get these properties.
-->
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -36,10 +40,10 @@
<configuration> <configuration>
<autoVersionSubmodules>true</autoVersionSubmodules> <autoVersionSubmodules>true</autoVersionSubmodules>
<projectVersionPolicyId>SemVerVersionPolicy</projectVersionPolicyId> <projectVersionPolicyId>SemVerVersionPolicy</projectVersionPolicyId>
<!--NOTE: below uses an `@`, which is parsed by the release plugin instead-->
<tagNameFormat>v@{project.version}</tagNameFormat> <tagNameFormat>v@{project.version}</tagNameFormat>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View File

@@ -14,14 +14,11 @@
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<!--
These projects only need an artifact id. The version and group id are taken from the parent.
-->
<artifactId>spring-boot-common-utils</artifactId> <artifactId>spring-boot-common-utils</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>

View File

@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<scm> <scm>
<connection>scm:git:ssh://gitea@gitea.rickrongen.nl:8789/RickRongen/tmp-sbcommon.git</connection> <connection>scm:git:ssh://gitea@gitea.rickrongen.nl:8789/RickRongen/tmp-sbcommon.git</connection>
<url>ssh://gitea@gitea.rickrongen.nl:8789/RickRongen/tmp-sbcommon.git</url> <url>https://gitea.rickrongen.nl/RickRongen/tmp-sbcommon</url>
<tag>HEAD</tag> <tag>HEAD</tag>
</scm> </scm>
<parent> <parent>
@@ -12,14 +12,6 @@
<version>3.5.5</version> <version>3.5.5</version>
<relativePath /> <relativePath />
</parent> </parent>
<distributionManagement>
<repository>
<id>tmp</id>
<name>Test</name>
<url>file://local/Users/rickrongen/IdeaProjects/sfg-sb-common/tmp-repo</url>
<layout>default</layout>
</repository>
</distributionManagement>
<groupId>com.sligrofoodgroup.spring-boot-common</groupId> <groupId>com.sligrofoodgroup.spring-boot-common</groupId>
<artifactId>spring-boot-parent</artifactId> <artifactId>spring-boot-parent</artifactId>
@@ -27,9 +19,7 @@
<packaging>pom</packaging> <packaging>pom</packaging>
<properties> <properties>
<maven.compiler.source>17</maven.compiler.source> <org.jetbrains.annotations>24.1.0</org.jetbrains.annotations>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
@@ -50,8 +40,16 @@
<dependency> <dependency>
<groupId>org.jetbrains</groupId> <groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId> <artifactId>annotations</artifactId>
<version>24.1.0</version> <version>${org.jetbrains.annotations}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<distributionManagement>
<repository>
<id>tmp</id>
<name>Test</name>
<url>file://local/Users/rickrongen/IdeaProjects/sfg-sb-common/tmp-repo</url>
<layout>default</layout>
</repository>
</distributionManagement>
</project> </project>