tinesoft / nxrocks

Set of Nx plugins to enhance your Nx workspace (even more!)
MIT License
308 stars 36 forks source link

[Bug] NX fails to execute maven commands #38

Closed Kwandes closed 3 years ago

Kwandes commented 3 years ago

Plugin Name and Version:

Nx Version (nx --version):

Angular CLI version (ng --version):

Expected Behaviour

When I execute nx serve test-java-app against a freshly generated (with this plugin) java springboot app, I expect it to properly start the app

Actual Behaviour

When nx serve app / nx run app:run / nx buildJar app / nx buildWar app / nx buildImage app / nx buildInfo app / nx serve app commands are run against a freshly generated java app (this this plugin), the command fails with following output:

❯ nx serve test-java-app

> nx run test-java-app:serve
Executing command: ./mvnw.cmd spring-boot:run
'.' is not recognized as an internal or external command,
operable program or batch file.
Failed to execute command: ./mvnw.cmd spring-boot:run

The command fails the same when it is run from the workspace root directory, and from the directory with maven files.

When ./mvnw.cmd test-java-app is run from the directory with the maven files, the app starts properly.

Steps to reproduce the behaviour

  1. Create an empty NX workspace (haven't tested on other workspace setups) with npx create-nx-workspace@latest app
  2. Add the nxrocks springboot dependency npm install --save-dev @nxrocks/nx-spring-boot
  3. Generate a Java Maven Springboot project nx g @nxrocks/nx-spring-boot:app app. Select these options: Maven, Jar, Java 11 and Java.
  4. Execute nx serve app from the workspace directory

Alternate way to reproduce the behaviour using existing repositories

I have a repository where the generated code exists and where the issue is present. It contains multiple apps.

Behaviour steps will be explained using the second repo:

  1. Clone repository with git clone https://github.com/Kwandes/app-sandbox.git
  2. cd app-sandbox/app-sandbox // nested workspace
  3. Run npm install
  4. Run nx serve test-java-app

Extra notes:

tinesoft commented 3 years ago

Hi @Kwandes

Thanks for reporting the issue in a such detailed way.

I believe that I have found the source of the problem: On Windows, the plugin currently run ./mvnw.cmd xxx (resp. ./gradlew.cmd xxx) whereas it should simply run mvnw.cmd xxx (resp. gradlew.cmd xxx) instead.

I'm developing on macos, so I didn't see the problem sooner (neither did my e2e tests ...)

Anyway, I will provide a fix asap.

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 1.3.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Kwandes commented 3 years ago

Works perfectly for both my friend and me. Thank you very much for a quick fix

tinesoft commented 3 years ago

You're welcome @Kwandes

Thank you for reporting the issue :-)

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 1.3.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 1.4.0-beta.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version @nxrocks/nx-melos-v1.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 1.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: