rightwhat.blogg.se

Git submodule get
Git submodule get





git submodule get

We can see the parent maven module & the child modules. Just to show another example, committing changes in Intellij will look like this: We will have a project like that imported on intellij with the mmsX, api and api-client maven modules:

#GIT SUBMODULE GET CODE#

folder to keep source code decoupled from main the mssX. In some cases like integration or feature tests, where you need to mock RestClient, should be also implemented in the api-client submodule test/src/. This completely decouples the implementations on this package in the base projects and it could be changed easily, for example, with a new WebFlux implementation of ApiClient. Jar Decoupled packageĬheckout that the dependency of package is only used (and should be only used) in the submodule. So, it heritages all from both parents: Spring Boot maven parent module -> git-sumodules-mss1, and there is no need to put versions: In the api maven module we have the parent reference and the api-client dependency Īnd the submodule api-client/pom-mss1.xml says that mss1 pom.xml is it’s parent pom. In addition, defines common dependencies and versions. Parent mss1 git project using api-client git submoduleĬom. I’m going to explain the “child pom per parent module” strategy to solve the problem when parent projects have different library versions (Spring-Boot versions f.ex.).Īs you can see in the parent mss1 pom.xml, it’s using spring-boot-starter-parent 2.6.7 and in the modules section it’s pointing to api-client api-client/pom-mss1.xml and the api implementation module (that is a maven module but not a git submodule): Once we have the git repositories created and linked with the submodule, we can just clone the parent repository this way: mkdir git-submodules & cd git-submodules/

  • Clone mss1 and mss2 repositories and add submodule in each:.
  • Create Git repositories for all projects and submodules.
  • Steps to set up NEW projects with a common git submodule: In addition, a git merge-request pipeline in the submodule should run all parent git repository pipelines to cover possible compilation and integration errors. There are some workarounds that can be applied like branching incompatible versions and/or using several pom-parentproject.xml in the submodule as explained later.

    git submodule get

    As a submodule/library for several main projects, compatibility it’s a must.No need to create and publish a Nexus artifact jar file.Enforces the Single Responsibility Principle decoupling specialized code into submodules from parent projects.Versability to modify main and submodules code in the same (IDE) project and commit/push to each remote repository separately.Git Submodules allows you to modularize your application components into modules with some pros and cons. So, in this article, we’ll see a simplified example of a Spring RestTemplate modularization in the Api Client submodule. This article is based on Git Submodules (Git tools) and real implementation in a production-grade application with several µ-monoliths calling each other via REST APIS.







    Git submodule get