Skip to content

dilermando-lima/gradle-arch-management

Repository files navigation

Dependency Management with Gradle

Introduction

This documentation provides an overview of the project hierarchy and dependencies among various components. The project consists of several plugins and libraries designed to work together to facilitate development and version management.

About all projects

This archtecture contains projects below:

  • arch-platform
  • arch-platform-plugin
  • arch-platform-springboot-plugin
  • arch-lib-springboot
  • arch-lib-java
  • api-rest

A real project we have to set remote repository configurations and separete all project in their own repositories and ignore that file ./settings.gradle ( used only to help maven instalation locally )

Archtecture's stacks

Stack Description Links
gradle Dependency management and build automation tool Gradle Overview
gradle plugin Extensions to Gradle that add new tasks, configurations, or conventions Writing Custom Gradle Plugins
gradle platform Ensures consistent dependency versions across multiple projects Gragle Platforms Introduction
java 21 Program language Java 21 new features
springboot A framework for building rest apis Rest Api with springboot
mapstruct A Java annotation processor for generating mapping class implementations Mapstruct introducttion

Hierarchy and Dependencies

Here's a diagram representing the hierarchy and dependencies among the projects:

. arch-platform # main platform contains all version dependencies
  │ 
  └── arch-platform-plugin # main plugin provides arch-platform versions
        │ 
        ├── arch-platform-springboot-plugin # plugin springboot provides third-party org.springframework.boot plugin
        │     │ 
        │     │ 
        │     └── arch-lib-springboot # lib springboot that provides all main configs and based beans to nested spring boot projects
        │                 │  
        │                 ├─────────── api-rest # final project that use 'arch-lib-java' and 'arch-lib-springboot'
        │                 │ 
        └──────── arch-lib-java # lib java that provides any logic for nested projects

Projects

Project Type Description
arch-platform gradle plaform The main platform that contains all version declarations. It serves as the foundation for other plugins and libraries in the project.
arch-platform-plugin gradle plugin A plugin that applies arch-platform versions to nested projects. It ensures consistent version management across different modules.
org.springframework.boot gradle plugin A third-party plugin for Spring applications. It provides essential tools and configurations for developing Spring Boot applications.
arch-platform-springboot-plugin gradle plugin A plugin that extends arch-platform-plugin and applies the org.springframework.boot plugin to nested Spring projects. It combines functionalities of both plugins to streamline Spring Boot development.
arch-lib-java internal library java A library that extends arch-platform-plugin and contains logic to be used in nested projects. It provides reusable Java components and utilities.
arch-lib-springboot internal library java A library that extends arch-platform-springboot-plugin and contains logic to be used in nested Spring Boot projects. It offers reusable Spring Boot components and utilities.
api-rest application A Spring Boot project that extends arch-platform-springboot-plugin and implements both arch-lib-java and arch-lib-springboot. It serves as a template for developing Spring Boot applications with the project's plugins and libraries.

Explanation

  • arch-platform is the main platform containing all version declarations.
  • arch-platform-plugin applies arch-platform versions to nested projects.
  • arch-platform-springboot-plugin extends arch-platform-plugin and applies the org.springframework.boot plugin to nested Spring projects.
  • arch-lib-java extends arch-platform-plugin and contains logic for nested projects.
  • arch-lib-springboot extends arch-platform-springboot-plugin and contains logic for nested Spring Boot projects.
  • api-rest is a Spring Boot project that extends arch-platform-springboot-plugin and implements both arch-lib-java and arch-lib-springboot.

How to install and build all project locally

1 - Install platform locally (the main project to be installed first)

export PROJ=platform; gradle publishToMavenLocal

2 - Install plugins locally (requires built and installed platform project)

export PROJ=plugin; gradle publishToMavenLocal

3 - Install all libraries locally (requires built and installed plugins)

export PROJ=lib; gradle publishToMavenLocal

4 - build final application (requires all built and installed libraries)

export PROJ=none; gradle clean build

EXTRA - build and install All project locally

    export PROJ=platform; \
    gradle publishToMavenLocal; \
    export PROJ=plugin; \
    gradle publishToMavenLocal; \
    export PROJ=lib; gradle publishToMavenLocal; \
    export PROJ=app; gradle clean build --refresh-dependencies

Conclusion

This documentation provides a comprehensive overview of the project structure, including the hierarchy and dependencies among various components. By understanding these relationships, developers can effectively utilize the project's plugins and libraries to streamline their development process.

About

Project that show how to manage many project with gradle platform and plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages