Skip to content

Executors not working in a multi-module project with more than one level of folders #200

@datenciadedalus

Description

@datenciadedalus

First of all, thank you for this amazing work.

This plugin is very useful for managing monorepos with Nx and Spring Boot 👏 🥇

Plugin Name

@nxrocks/nx-spring-boot

Nx Report

Node   : 16.20.1
OS     : linux-x64
npm    : 8.19.4
   
nx             : 17.0.2
@nx/js         : 17.0.2
@nx/workspace  : 17.0.2
@nx/devkit     : 17.0.2
@nrwl/tao      : 17.0.2
typescript     : 5.2.2
---------------------------------------
Community plugins:
@nxrocks/nx-spring-boot : 9.0.1

Expected Behaviour

Executor option "runFromParentModule": true should locate the parent module (if using a multi-module project) when the submodules are located in a subfolder (with more than one level of nesting).

Actual Behaviour

Executors for submodules (in a multi-module project) are not working when using the option runFromParentModule option and the maven wrapper if the submodules are located in a folder with more than 1 level of nesting, e.g.

.
├── nx.json
├── package.json
├── package-lock.json
├── packages
│   └── demo-parent
│       ├── apps
│       │   └── demo
│       │       ├── pom.xml
│       │       ├── project.json
│       │       └── src
│       ├── mvnw
│       ├── mvnw.cmd
│       ├── pom.xml
│       ├── project.json
│       └── target
├── README.md
└── target

Note the demo module folder which is not a direct folder of demo-parent. The demo-parent contains the maven wrapper.

When running a task (e.g. nx run demo:clean it seems like the executor cannot find the parent module and never ends.

Steps to reproduce the behaviour

  1. Create an empty Nx workspace and install the @nxrocks/nx-spring-boot plugin
  2. Add a new Spring Boot application as a multi-module project (e.g. demo and demo-parent)
  3. Move the generated child module demo into an intermediary subfolder (modifying its project.json file according)
  4. Try to run a task, e.g. nx run demo:clean

I will try to create a sample repo later today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions