Skip to content

Custom Target Not Working #242

@brandon-mitchell-midwest

Description

Plugin Name

@nxrocks/nx-spring-boot

Nx Report

Node : 18.20.6
OS : darwin-arm64
Native Target : aarch64-macos
npm : 10.8.2

nx : 20.4.0
@nx/js : 20.4.0
@nx/jest : 20.4.0
@nx/eslint : 20.4.0
@nx/workspace : 20.4.0
@nx/devkit : 20.4.0
@nx/node : 20.4.0
typescript : 5.7.3

Registered Plugins:
@nxrocks/nx-spring-boot

Community plugins:
@nxrocks/nx-spring-boot : 10.2.6

Expected Behaviour

For my application to be able to run custom targets so I can pass arguments easily.

Actual Behaviour

Running "npx nx serve auth" works but running "npx nx serve-dev auth" fails.

This is my project.json:

{
  "root": "apps/auth",
  "sourceRoot": "apps/auth/src",
  "projectType": "application",
  "name": "auth",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "tags": [],
  "targets": {
    "serve": {
      "executor": "@nxrocks/nx-spring-boot:serve",
      "options": {
        "args": [
          "-Dspring-boot.run.jvmArguments=\"-Dspring.profiles.active=local\""
        ]
      }
    },
    "serve-dev": {
      "executor": "@nxrocks/nx-spring-boot:serve",
      "options": {
        "args": [
          "-Dspring-boot.run.jvmArguments=\"-Dspring.profiles.active=development\""
        ]
      }
    }
  }
}

error thrown:
NX The "paths[1]" argument must be of type string. Received undefined

Steps to reproduce the behaviour

  1. Create custom target in project.json
  2. Run command to call that target
  3. See error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions