Giter Site home page Giter Site logo

bancolombia / scaffold-clean-architecture Goto Github PK

View Code? Open in Web Editor NEW
388.0 29.0 144.0 1.89 MB

Gradle plugin to create a clean application in Java that already works, It follows our best practices!

License: Apache License 2.0

Java 49.64% Mustache 49.78% Shell 0.38% Dockerfile 0.20%
architecture scaffolding java gradle open-source

scaffold-clean-architecture's Introduction

Quality Gate Status Maintainability Rating codecov GitHub license Scorecards supply-chain security

Scaffolding of Clean Architecture

Gradle plugin to create a java and kotlin application based on Clean Architecture following our best practices!

Plugin Implementation

To use the plugin you need Gradle version 8.2 or later, to start add the following section into your build.gradle file.

plugins {
    id "co.com.bancolombia.cleanArchitecture" version "3.16.1"
}

Or if is a new project execute this script in the root directory of your project.

echo "plugins {
    id \"co.com.bancolombia.cleanArchitecture\" version \"3.16.1\"
}" > build.gradle

To use the plugin you need Gradle version 6.9 or later, to start add the following section into your build.gradle.kts file.

plugins {
    id("co.com.bancolombia.cleanArchitecture") version "3.16.1"
}

Or if is a new project execute this script in the root directory of your project.

echo "plugins {
    id(\"co.com.bancolombia.cleanArchitecture\") version \"3.16.1\"
}" > build.gradle.kts

Tasks

The Scaffolding Clean Architecture plugin will allow you run 8 tasks:

Generate Project

The cleanArchitecture | ca task will generate a clean architecture structure in your project, this task has four optional parameters; package , type, name and coverage. If you run this task on an existing project it will override the main.gradle, build.gradle and gradle.properties files.

  • package = <package.we.need>: You can specify the main or default package of your project. Default Value = co.com.bancolombia

  • type = <imperative | reactive>: With this parameter the task will generate a POO project. Default Value = reactive

  • name = NameProject: This parameter is going to specify the name of the project. Default Value = cleanArchitecture

  • lombok = <true | false>: Specify if you want to use this plugin . Default Value = true

  • metrics = <true | false>: Specify if you want to enable this feature with micrometer . Default Value = true

  • language = <JAVA | KOTLIN>: Specify if you want to use this plugin . Default Value = JAVA

  • javaVersion = <VERSION_17 | VERSION_21>: Java version . Default Value = VERSION_17

gradle cleanArchitecture --package=co.com.bancolombia --type=reactive --name=NameProject --lombok=true
gradle ca --package=co.com.bancolombia --type=reactive --name=NameProject --lombok=true

The structure will look like this for java:

πŸ“¦NameProject
┣ πŸ“‚applications
┃ β”— πŸ“‚app-service
┃ ┃ ┣ πŸ“‚src
┃ ┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ ┃ ┣ πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ ┃ ┣ πŸ“‚config
┃ ┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œ[configs and beans]
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œMainApplication.java
┃ ┃ ┃ ┃ β”— πŸ“‚resources
┃ ┃ ┃ ┃ ┃ ┣ πŸ“œ[properties]
┃ ┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ β”— πŸ“œbuild.gradle
┣ πŸ“‚deployment
┃ ┣ πŸ“œ[Dockerfile, Pipelines as a code]
┣ πŸ“‚domain
┃ ┣ πŸ“‚model
┃ ┃ ┣ πŸ“‚src
┃ ┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ β”— πŸ“œbuild.gradle
┃ β”— πŸ“‚usecase
┃ ┃ ┣ πŸ“‚src
┃ ┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“‚usecase
┃ ┃ β”— πŸ“œbuild.gradle
┣ πŸ“‚infrastructure
┃ ┣ πŸ“‚driven-adapters
┃ ┣ πŸ“‚entry-points
┃ β”— πŸ“‚helpers
┣ πŸ“œ.gitignore
┣ πŸ“œbuild.gradle
┣ πŸ“œgradle.properties
┣ πŸ“œlombok.config
┣ πŸ“œmain.gradle
┣ πŸ“œREADME.md
β”— πŸ“œsettings.gradle

The structure will look like this for kotlin:

πŸ“¦NameProject
┣ πŸ“‚applications
┃ β”— πŸ“‚app-service
┃ ┃ ┣ πŸ“‚src
┃ ┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ ┃ ┣ πŸ“‚kotlin
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ ┃ ┣ πŸ“‚config
┃ ┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œ[configs and beans]
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œMainApplication.kt
┃ ┃ ┃ ┃ β”— πŸ“‚resources
┃ ┃ ┃ ┃ ┃ ┣ πŸ“œ[properties]
┃ ┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ ┃ β”— πŸ“‚kotlin
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ β”— πŸ“œbuild.gradle.kts
┣ πŸ“‚deployment
┃ ┣ πŸ“œ[Dockerfile, Pipelines as a code]
┣ πŸ“‚domain
┃ ┣ πŸ“‚model
┃ ┃ ┣ πŸ“‚src
┃ ┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ ┃ β”— πŸ“‚kotlin
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ ┃ β”— πŸ“‚kotlin
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ β”— πŸ“œbuild.gradle.kts
┃ β”— πŸ“‚usecase
┃ ┃ ┣ πŸ“‚src
┃ ┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ ┃ β”— πŸ“‚kotlin
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ ┃ β”— πŸ“‚kotlin
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“‚usecase
┃ ┃ β”— πŸ“œbuild.gradle.kts
┣ πŸ“‚infrastructure
┃ ┣ πŸ“‚driven-adapters
┃ ┣ πŸ“‚entry-points
┃ β”— πŸ“‚helpers
┣ πŸ“œ.gitignore
┣ πŸ“œbuild.gradle.kts
┣ πŸ“œgradle.properties
┣ πŸ“œlombok.config
┣ πŸ“œREADME.md
β”— πŸ“œsettings.gradle.kts

Generate Model for Java and Kotlin

The generateModel | gm task will generate a class and interface in model layer, this task has one required parameter name.

   gradle generateModel --name=[modelName]
   gradle gm --name [modelName]

This task will generate something like that:

πŸ“¦domain
┣ πŸ“‚model
┃ ┣ πŸ“‚src
┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚model
┃ ┃ ┃ ┃ ┃ ┃ ┣ πŸ“‚gateways
┃ ┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œModelRepository.java
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œModel.java
┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚model
┃ β”— πŸ“œbuild.gradle

This task will generate something like that for kotlin:

πŸ“¦domain
┣ πŸ“‚model
┃ ┣ πŸ“‚src
┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ β”— πŸ“‚kotlin
┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚model
┃ ┃ ┃ ┃ ┃ ┃ ┣ πŸ“‚gateways
┃ ┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œModelRepository.kt
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œModel.kt
┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ β”— πŸ“‚kotlin
┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚model
┃ β”— πŸ“œbuild.gradle.kts

Generate Use Case for Java and Kotlin

The generateUseCase | guc task will generate a class in model layer, this task has one required parameter name.

   gradle generateUseCase --name=[useCaseName]
   gradle guc --name [useCaseName]

This task will generate something like that:

πŸ“¦domain
β”— πŸ“‚usecase
┃ ┣ πŸ“‚src
┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚usecase
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“‚business
┃ ┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œBusinessUseCase.java
┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚usecase
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“‚business
┃ β”— πŸ“œbuild.gradle

This task will generate something like that for kotlin:

πŸ“¦domain
β”— πŸ“‚usecase
┃ ┣ πŸ“‚src
┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ β”— πŸ“‚kotlin
┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚usecase
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“‚business
┃ ┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œBusinessUseCase.kt
┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ β”— πŸ“‚kotlin
┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚usecase
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“‚business
┃ β”— πŸ“œbuild.gradle.kts

Generate Driven Adapter

The generateDrivenAdapter | gda task will generate a module in Infrastructure layer, this task has one required parameter type.
Whether you'll use generic one also parameter name is required.

   gradle generateDrivenAdapter --type=[drivenAdapterType]
   gradle gda --type [drivenAdapterType]
Reference for drivenAdapterType Name Additional Options Java Kotlin
generic Empty Driven Adapter --name [name] β˜‘ β˜‘
asynceventbus Async Event Bus β˜‘ β˜‘
binstash Bin Stash β˜‘ β˜‘
cognitotokenprovider Generador de token de cognito β˜‘
dynamodb Dynamo DB adapter β˜‘ β˜‘
jpa JPA Repository --secret [true-false] β˜‘ β˜‘
kms AWS Key Management Service β˜‘ β˜‘
ktor HTTP client for kotlin ☐ β˜‘
mongodb Mongo Repository --secret [true-false] β˜‘ β˜‘
mq JMS MQ Client to send messages β˜‘ β˜‘
r2dbc R2dbc Postgresql Client β˜‘ β˜‘
redis Redis --mode [template-repository] --secret [true-false] β˜‘ β˜‘
restconsumer Rest Client Consumer --url [url] --from-swagger swagger.yaml β˜‘ β˜‘
rsocket RSocket Requester β˜‘ β˜‘
s3 AWS Simple Storage Service β˜‘ β˜‘
secrets Secrets Manager Bancolombia --secrets-backend [backend]
Valid options for backend are "aws_secrets_manager" (default) or "vault".
β˜‘ β˜‘
sqs SQS message sender β˜‘ β˜‘

This task will generate something like that:

πŸ“¦infrastructure
┣ πŸ“‚driven-adapters
┃ β”— πŸ“‚jpa-repository
┃ ┃ ┣ πŸ“‚src
┃ ┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“‚jpa
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣ πŸ“‚config
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œDBSecret.java
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣ πŸ“‚helper
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œAdapterOperations.java
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣ πŸ“œJPARepository.java
┃ ┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œJPARepositoryAdapter.java
┃ ┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“‚jpa
┃ ┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“‚helper
┃ ┃ β”— πŸ“œbuild.gradle

Generate Entry Point

The generateEntryPoint | gep task will generate a module in Infrastructure layer, this task has one required parameter type.
Whether you'll use generic one also parameter name is required.

gradle generateEntryPoint --type=[entryPointType]
gradle gep --type [entryPointType]
Reference for entryPointType Name Additional Options Java Kotlin
generic Empty Entry Point --name [name] β˜‘ β˜‘
asynceventhandler Async Event Handler β˜‘ β˜‘
graphql API GraphQL --pathgql [name path] default /graphql β˜‘ β˜‘
kafka Kafka Consumer β˜‘
mq JMS MQ Client to listen messages β˜‘ β˜‘
restmvc API REST (Spring Boot Starter Web) --server [serverOption] default undertow --authorization [true-false] --from-swagger swagger.yaml β˜‘ β˜‘
rsocket Rsocket Controller Entry Point β˜‘ β˜‘
sqs SQS Listener β˜‘ β˜‘
webflux API REST (Spring Boot Starter WebFlux) --router [true, false] default true --authorization [true-false] --from-swagger swagger.yaml β˜‘ β˜‘

Additionally, if you'll use a restmvc, you can specify the web server on which the application will run. By default, undertow.

   gradle generateEntryPoint --type=restmvc --server=[serverOption]
   gradle gep --type=restmvc --server=[serverOption]
Reference for serverOption Name
undertow Undertow server (default)
tomcat Tomcat server
jetty Jetty server

This task will generate something like that:

πŸ“¦infrastructure
┣ πŸ“‚entry-points
┃ β”— πŸ“‚generic
┃ ┃ ┣ πŸ“‚src
┃ ┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“‚generic
┃ ┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“‚generic
┃ ┃ β”— πŸ“œbuild.gradle

Generate Helper

The generateHelper | gh task will generate a module in Infrastructure layer, this task has one required parameter name.

   gradle generateHelper --name=[helperName]
   gradle gh --name=[helperName]

Generate Pipeline

The generatePipeline | gpl task will generate CI pipeline inside the folder "./deployment/", this task has one required parameter type and one optional parameter monoRepo by default is false.

   gradle generatePipeline --type=[pipelineType] --monoRepo=[true | false]
   gradle gpl --type=[pipelineType]  --monoRepo=[true | false]
Reference for pipelineType Name
azure Azure Pipeline
circleci CircleCI Pipeline
github GitHub Action
jenkins Jenkins Pipeline

Generate Acceptance Test

The generateAcceptanceTest | gat task will generate subproject by karate framework inside the folder "./deployment/", this task has one optional parameter, name.

  • name = NameAcceptanceTestProject: This parameter is going to specify the name of the acceptance test project. Default Value = acceptanceTest
      gradle generateAcceptanceTest --name=[acceptanceTestProjectName]
      gradle gat --name=[acceptanceTestProjectName] 

Karate is an open-source tool to combine API test-automation, mocks, performance-testing and even UI automation into a single, unified framework. The BDD syntax popularized by Cucumber is language-neutral, and easy for even non-programmers. Assertions and HTML reports are built-in, and you can run tests in parallel for speed.

Generate Performance Test

The generatePerformanceTest | gpt task will generate Performance test inside the folder "./performance-test/", this task has one required parameter type.

   gradle generatePerformanceTest --type=[performanceType]
   gradle gpt --type=[performanceType]
| Reference for **performanceType** | Name                    |
| --------------------------------- | ----------------------- |
| jmeter                            | Jmeter Performance Test |

Validate Structure

The validateStructure | vs Validate that project references aren't violated.

   gradle validateStructure
   gradle vs

This validation has another best practices verifications, which you can see on the generated ArchitectureTest file within the unit tests of the app-service module.

Dependency Rules

One important point made by Robert C. Martin on Clean Architecture is the Dependency Rule, that can be summarized like this: source code dependencies can only point inwards. Nothing in an inner circle can know anything at all about something in an outer circle. In particular, the name of something declared in an outer circle must not be mentioned by the code in an inner circle.

Having that in mind, the validateStructure | vs task performs the following validations:

  1. Model module: to have no dependencies at all.
  2. UseCase module: to declare dependency to the Model module ONLY, and no other additional dependencies.
  3. Infrastructure Layer modules:
    • Allow declaration of any external dependency.
    • Allow declaration of dependency on Model and/or UseCase modules.
    • Avoid declaration of dependency AppService module.

Whitelisting dependencies:

Some dependencies, specially when working with BOMs (Bills of Materials), are injected transversally to the project, making the validation task to flag failures to rules 1 and 2. To avoid this scenario, or other you may encounter, you can configure a set of whitelisted dependencies.

Example:

  1. Let's say you have declared a BOM in your project:

    dependencies {
      implementation(platform("com.myorg:my-bom:0.0.1"))
    }
  2. This will make validateStructure | vs to flag a failure indicating an error like this:

    Validating Model Module
     --- Dependency com.myorg:some-bom is not allowed in Model Layer
  3. To avoid this, you can white list your BOM like this:

    // build.gradle
    cleanPlugin {
      modelProps {
         whitelistedDependencies = "my-bom, <dep2>, <depN..>"
      }
    }

    Indicating only the name of the dependencies comma-separated.

Delete Module

The deleteModule | dm task will delete a sub project, this task has one required parameter module.

   gradle deleteModule --module=[name]
   gradle dm --module=[name]




Update Project

The updateCleanArchitecture | u task will update plugin and dependencies in all sub projects, this task has one optional parameter dependencies if you only want to update some dependencies the dependency need to contain the group, and the artifact for example for the dependency cleanArchitecture you will need to append co.com.bancolombia:cleanArchitecture. It also updates the spring, lombok, gradle and some other dependencies according to the plugin version that you are using, ocassionally it could make changes in other project structural files. We recommend that you commit your changes to git before running this command, but you can skip the verification passing --git false.

   gradle updateCleanArchitecture --dependencies=[dependency1, dependency2, ...]
   gradle u --dependencies=[dependency1, dependency2, ...]

How can I help?

Review the issues, we hear new ideas. Read more Contributing

Analytics

You can help the Contributors Team to prioritize features and improvements by permitting the Contributors team to send gradle tasks usage statistics to Analytics Server. The Contributors Team collect usage statistics unless you explicitly opt in off.

Due to the user input limitations to gradle task, when running any plugin task you will be notified about the analytics recollection, and you have the possibility to disable this recollection. If you enable or disable analytics explicitly, future task executions will not notify you.

To explicitly enable analytics and avoid the notification message

gradle analytics --enabled true
# o gradle a --enabled true

To disable analytics

gradle analytics --enabled false
# # o gradle a --enabled false

What is collected?

Usage analytics include the commands and selected flags for each execution. Usage analytics may include the following information:

  • Your operating system (macOS, Linux distribution, Windows) and its version.
  • Java vendor name and version.
  • Java specification and runtime versions.
  • Plugin version.
  • Project language (kotlin or java)
  • Task name that was run.
  • Workspace information like language, user that is running the task.
  • For generate use case, generate model, generate helper and delete module tasks, the name will be sent.
  • For all tasks, the type and name, the time it took to run the task, and project type (reactive, imperative).



Whats Next?

Read more About Clean Architecure

scaffold-clean-architecture's People

Contributors

alejobtc avatar alexixsgit avatar andmagom avatar braduran avatar d-jurado avatar davidpolaniaac avatar dbuos avatar dericop avatar dhfherna avatar elvertmora avatar gabheadz avatar gaviria9601 avatar gonchalo620 avatar gpescoba avatar jakspok avatar jksalazar avatar jorgea1206 avatar jsierra93 avatar juancardona90 avatar juancgalvis avatar juandgiraldom avatar juanes1a avatar kathechicae avatar lg-lopezbc avatar luisgomez29 avatar maocq avatar sandro30 avatar santicalleg avatar santitigaga avatar xyf001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scaffold-clean-architecture's Issues

New task to generate pipeline for Azure DevOps

We need to crate a pipeline for Azure DevOps, the CI pipeline will have all tasks required to:

  1. Build the artifact
  2. Prepare Sonar analysis
  3. Coverage validation on SonarQube
  4. Quality gate validation on SonarQube

To do so, we should have a task to generate the pipeline dynamically and be hable to generate difetent pipelines, for now only the Azure DevOps pipeline

Tarea gradle para generar reporte cobertura con jacoco

Hola!, seria interesante que el scaffold de clean architecture venga ya configurado con la tarea jacoco de gradle para generar el reporte de cobertura de pruebas con todo el consolidado de los mΓ³dulos del proyecto.

`task jacocoRootReport(type: JacocoReport){

dependsOn = subprojects.test
additionalSourceDirs.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.setFrom files(subprojects.sourceSets.main.output)
executionData.setFrom project.fileTree(dir: '.', include: '**/build/jacoco/test.exec')

reports {
    html.enabled = true
    html.destination = file("${buildDir}/jacoco")
    xml.enabled = true
    xml.destination = file("${buildDir}/jacoco/report.xml")
    csv.enabled = false
}

}`

Error when execute any tasks in Gradle 6.3

When I execute gradle generateModel --name=[name] in gradle version > 6 (6.3), the plgin fails with following error:

  • Where:
    Build file '/Users/daniel/Projects/banco/dojo-reactive/build.gradle' line: 23

  • What went wrong:
    An exception occurred applying plugin request [id: 'net.saliman.cobertura', version: '3.0.0']

Failed to apply plugin [id 'net.saliman.cobertura']
Could not create task ':generateCoberturaReport'.
> Could not create task of type 'GenerateReportTask'.
> No signature of method: static org.gradle.util.DeprecationLogger.whileDisabled() is applicable for argument types: (net.saliman.gradle.plugin.cobertura.GenerateReportTask$1) values: [net.saliman.gradle.plugin.cobertura.GenerateReportTask$1@1a5e6363]

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2s

FAILURE: Build failed with an exception.

Reactive commons domain model interface mismatch

At the current version (1.5.4). When you try to do a:

gradle gda --value 3

The structure created has the following error.
image
It has a mismatch with the interface created at that path and it does not contain the "emit" method as well.
image

Improve gradle tasks cli usability

Change task numbers options for a short name description.

$ gradle generateDrivenAdapter --value=5
$ gradle generateDrivenAdapter --value=mongodb

Create usage samples on error with existent options.

adapter description
mongodb Generates MongoDB Driven Adapter
jpa Generates JPA Driven Adapter

Generate Driver Adapter JPA Repository

Wrong dependency in build.gradle of helper jpa-repository-commons when generates driver adapters jpa-repository.

Wrong: implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
Correct: implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

Error validating structure when generate a reactive project.

Error validating structure when generate a reactive project.

➜ $ gradle ca --type reactive

Task :ca
Clean Architecture plugin version: 1.6.9
Package: co.com.bancolombia
Project Type: REACTIVE
Project Name: cleanArchitecture
Project Package: co.com.bancolombia
Applying changes
Changes successfully applied

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed
➜ $ gradle vs

Task :vs FAILED
Clean Architecture plugin version: 1.6.9
Submodules: app-service
Submodules: model
Submodules: usecase
Project Package: co.com.bancolombia
Validating Model Module
--- Dependency: reactor-core
--- Dependency: reactor-extra

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':vs'.

co.com.bancolombia.exceptions.CleanException: Model module is invalid

BUILD FAILED in 1s
1 actionable task: 1 executed

Please remove this dependencies from validation for module model when reactive:
--- Dependency: reactor-core
--- Dependency: reactor-extra

Add net.saliman plugin

El plugin de jacoco es un poco inconsistente y la implementaciΓ³n varΓ­a segΓΊn la version de gradle, por que es preferible implementar el plugin de net.saliman:gradle-cobertura

Driven Adapter for Redis

Describe the solution you'd like
We need to crate a driven adapter for Redis, the driven adapter should be compatibility with imperative and reactive projects.

Application build.gradle is getting wrong

As soon as you get all folders with clean architecture task (value in --type field = reactive). Run generateDrivenAdapter task with any option value.

Later you'll see in the application project in build.gradle the dependencies statement is missing what result as an error.

Disable Lombok

Some developers don't like Lombok, will be useful to add parameter option to disable this.

Enable JMS

Is your feature request related to a problem? Please describe.
would be great that not only generates event subscriber or message sender for rabbitmq, but also for jms protocol implemented by message brokers like ibm mq

Describe the solution you'd like
Implement a jms driven adapter and an jms entry point according to the clean architecture structure

Handler and Router

What possibility is there that in webflux you use handler and router or at least allow you to select the option

R2DBC Driven Adapter for reactive projects

Is your feature request related to a problem? Please describe.
reactive projects canΒ΄t connection with relational databases with traditional drivers (jdbc, hibernate) because this implementations are blocking . will great to append this issue at the plugin.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Structure error on Application.yaml

At the moment when you generate the clean architecture structure, the plugin creates the file application.yaml in the app-service project, however this file does not have a valid yaml structure.

Upgrade secrets manager dependency

Currently when I generate a driven adapter which uses secrets, this dependency can not be downloaded from maven, I suggest to change this dependency compile 'co.com.bancolombia:secretsmanager:2.1.0' for the dependency described in the open source project secrets-manager.

New S3 driven adapter

It's necesary interact with AmazonS3 AWS, for the storage of objects. It's important, because can be used fro store, extract any amount data. or other range of use cases!

New Driven adapter to consume API Rest Service

It would be great to generate a new Driven adapter to consume API Rest Service.

This driven adapter can be even more useful if I can parameterize the consume of a generic service or the consume of an Api Connect service.

Change secrets manager implementation

To use AWS secrets using the SecretManager library donΒ΄t need a driven adapter and a use case, we just have to use SecretsManager from the bean

Update reactive-commons version

On current version (1.5.4), the plugin is using an old version of reactive commons.

image

It would be better if you update it to a recent version.

New event subscriptions entry point

When I need an event subscriber as an entry point I need to create a generic entry point and modified it adding reactive commons and creating the handlers and listeners. The plugin should do it for me!

LocalContainerEntityManagerFactoryBean cannot resolve setPackagesToScan

When i'm using the plugin i generated the structure without problem, but when you import the generic jpa driven adapter there is some missing dependendcies like:
compile 'com.zaxxer:HikariCP:3.4.5'
compile group: 'org.springframework', name: 'spring-orm', version: '2.5.1'

This dependencies should go in the app-service layer on the build.gradle file. Also when you import the missing dependencies the method setPackagesToScan it seems to have no implementation for LocalContainerEntityManagerFactoryBean object in Jpaconfig file

Error on Jar generation app-service

When The build is generating from gradle of app-service it doesn't create the folder libs into this

app-service/build/libs

The possible solution is replace the task jar for the next:

task explodedJar(type: Copy) {
with jar
into "${buildDir}/exploded"
}

For more details contact me:

My corporate email --> [email protected]

Generate generic driven adapter

Could be useful if the plugin allow us to create a generic driven adapter and not only the options predefined in the read.me

Include the "UseCase" Word

ItΒ΄s a bit confusing when you create an use case because it is not clear if in the name has to include or not the word "UseCase" so it'll be helpful if when you create an use case and the plugin automatically add the word UseCase to it, example if i generate the use case Person, the final result would be a class with name PersonUseCase. This would help us to keep classes naming standard

Error on package name at MainApplication class

Using the first command to generate the clean architecture structure, in the MainApplication class at the app-service project has the wrong package name referenced inside the class.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.