Git Product home page Git Product logo

nxrocks's Introduction

NxRocks! ๐Ÿค˜๐Ÿพ

semantic-release

Security Rating Bugs Code Smells Maintainability Rating Lines of Code

Set of Nx plugins to enhance your Nx workspace (even more!)

Our Plugins

Status Name Description
โœ… nx-spring-boot Nx plugin to generate, run, package, build (and more) Spring Boot projects inside your Nx workspace
โœ… nx-flutter Nx plugin adding first class support for Flutter in your Nx workspace
โœ… nx-quarkus Nx plugin to generate, run, package, build (and more) Quarkus projects inside your Nx workspace
โœ… nx-micronaut Nx plugin to generate, run, package, build (and more) Micronaut projects inside your Nx workspace
โœ… nx-melos Nx plugin adding first class support for Melos in your Nx workspace
โœ… nx-ktor Nx plugin to generate, run, package, build (and more) Ktor projects inside your Nx workspace

Our custom CLIs

Status Name Description
โœ… create-nx-spring-boot CLI to create Nx workspaces with built-in support for Spring Boot
โœ… create-nx-flutter CLI to create Nx workspaces with built-in support for Flutter
โœ… create-nx-quarkus CLI to create Nx workspaces with built-in support for Quarkus
โœ… create-nx-micronaut CLI to create Nx workspaces with built-in support for Micronaut
โœ… create-nx-ktor CLI to create Nx workspaces with built-in support for Ktor

License

Copyright (c) 2020-present Tine Kondo. Licensed under the MIT License (MIT)

nxrocks's People

Contributors

aabegg avatar agentender avatar aneeshrelan avatar darkterror45 avatar exocom avatar frango9000 avatar johntimothybailey avatar jonathangeoffroy avatar mgansler avatar quinnj avatar samantatarun avatar semantic-release-bot avatar sniperwolf avatar tinesoft avatar trumbitta avatar zackderose 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

nxrocks's Issues

[Bug] Springboot maven app is incorrectly recognized as a gradle app

Plugin Name and Version:

  • 1.2.1

Nx Version (nx --version):

  • 11.1.5

Angular CLI version (ng --version):

  • 11.0.4

Operating System:

  • Windows 10 20H2

Project setup:

  • Springboot app generated with nxrocks 1.2.1, type: Maven

Expected Behaviour

When nx serve app / nx run app:run / nx buildJar app / nx buildWar app / nx buildImage app / nx buildInfo app commands are run, a mvaen equivalent should be executed and the command should complete successfully.

Actual Behaviour

When nx serve app / nx run app:run / nx buildJar app / nx buildWar app / nx buildImage app / nx buildInfo app commands are run, a gradle equivalent is run (for nx serve app the command is ./gradlew.cmd bootRun), which fails due to the project not having gradle configured (I presume).

If I navigate to Java project root directory and run mvnw spring-boot:run, the application starts successfully.

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 two repositories where I have this bug (and no repositories where it works).
Both contain a description of how they were set up in docs/setup-guide.md

Behaviour steps will be explained using the second repo:

  1. Clone repository with git clone https://github.com/treecreate/webstore.git
  2. cd webstore
  3. Run npm install
  4. Run nx serve api

Extra notes:

I was able to reproduce the bug on my laptop running Windows 10 2004.

[Bug] generate new app not working with Nx 11.2

Plugin Name and Version:
[email protected]

Nx Version (nx --version):

Nx 11.2.0

Angular CLI version (ng --version):

Expected Behaviour

Project is generated

Actual Behaviour

In the actual Nx version 11.2 the import @nrwl/workspace/src/utils/fileutils changed to @nrwl/workspace/src/utilities/fileutils

Steps to reproduce the behaviour

Just try to generate a new application in a Nx 11.2 workspace

[Feature] Some more working code in the generated app

Both the express and NestJS app generator schematics produce an app with a simple working REST endpoint: some GET /api/v1/example with a simple JSON response body.

I think this is something the spring boot plugin should also do, because it empowers newbies giving them some sort of track to follow.

It would also greatly simplify some Nx demo I'm working on :D

Use kebab-case for all targets offered by this plugin

Is your feature request related to a problem? Please describe

No

Describe the idea you'd like

The name of all the targets listed in the project.json generated by this Nx plugin should consistently use the same casing. Here are two example of targets that use different casing:

  • format-check (kebab case)
  • buildImage (lower camel case)

Describe alternatives you've considered

From what I could see by glancing over the Nx website, they prefer kebab case target name. Alternatively, I couldn't find a target that used camel case.

Additional context

Thanks!

[Feature] Convert current issue templates into issue forms

Github introduced Issue Forms a moment ago (still in beta though).
It is a better alternative to static Issue Templates (in Markdown), as they
allow to better describe and above all, validate the information that must/should be provided when creating an new bug report or feature request.

Please convert the current templates under .github/ISSUE_TEMPLATE/* into this new format (YAML).

This might help: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#creating-issue-forms

[Bug] CLI generator stuck when asking for user input

Plugin Version:
latest from NPM

Nx Version (nx --version):
10.3.1

Expected Behaviour

When generating a new app, all the input prompts work.

Actual Behaviour

When generating a new app, some input prompts don't work and script is stuck. E.g. when asked which type of project I want, the "enter" keys does nothing with either the default value or after typing gradle-project or maven-project.
Some other prompts have the same behavior, some don't.

Steps to reproduce the behaviour

Try to generate a new app from the CLI, in interactive mode.

[Bug] nx print-affected logs debug message which results to a non parseable json

Plugin Name and Version:
[email protected]

Nx Version (nx --version):

12.5.6

Angular CLI version (ng --version):

Expected Behaviour

When I run nx print-affected --base HEAD~1 --target deploy I expect a json parseable output.

Like:

{
  "tasks": [
    {
      "id": "sample:deploy",
      "overrides": {},
      "target": {
        "project": "sample",
        "target": "deploy"
      },
      "command": "yarn nx deploy sample",
      "outputs": []
    },

Actual Behaviour

When I run nx print-affected --base HEAD~1 --target deploy I get:

[nx-spring-boot]: Looking Spring Boot related projects inside the workspace...
[nx-spring-boot]: Adding dependencies for project 'sample'...
{
  "tasks": [],
  "projects": [
    "github-pipelines",

Steps to reproduce the behaviour

  1. Run nx print-affected --base HEAD~1 --target build
  2. See non parseable json output

Strangely enough this is only on first execution.

Is there the possibility to delete these debug log lines? Or only log if a log level debug is enabled. Or verbose logging is enabled?

[Bug] NX Springboot app generation in an empty workspace requires Angular dependencies

Plugin Name and Version:
@nxrocks/[email protected]

Nx Version (nx --version):
11.4.0

Node Version (node -v):
Current LTS: 14.16.0

NPM Version (npm -v):
6.14.11

Angular CLI version (ng --version):
None, it's an empty NX project

Expected Behaviour

When I run nx g @nxrocks/nx-spring-boot:app java-api and fill out the options, a new java springboot app gets generated

Actual Behaviour

When I run nx g @nxrocks/nx-spring-boot:app java-api and fill out the options, the generation fails with an error:

Cannot find module '@angular-devkit/core'
Require stack:
- O:\Programming\testing\troubleshoot-nvm\node_modules\@nrwl\tao\src\commands\ngcli-adapter.js
- O:\Programming\testing\troubleshoot-nvm\node_modules\@nrwl\tao\src\commands\generate.js
- O:\Programming\testing\troubleshoot-nvm\node_modules\@nrwl\tao\index.js
- O:\Programming\testing\troubleshoot-nvm\node_modules\@nrwl\cli\lib\init-local.js
- O:\Programming\testing\troubleshoot-nvm\node_modules\@nrwl\cli\bin\nx.js
- C:\Users\kwandes\AppData\Roaming\nvm\v14.16.0\node_modules\nx\node_modules\@nrwl\cli\bin\nx.js
- C:\Users\kwandes\AppData\Roaming\nvm\v14.16.0\node_modules\nx\bin\nx.js

After that, I install the missing dependency with npm install @angular-devkit/core.
The generation fails again with

Cannot find module '@angular-devkit/schematics/tools'
Require stack:
- O:\Programming\testing\troubleshoot-nvm\node_modules\@nrwl\tao\src\commands\ngcli-adapter.js
- O:\Programming\testing\troubleshoot-nvm\node_modules\@nrwl\tao\src\commands\generate.js
- O:\Programming\testing\troubleshoot-nvm\node_modules\@nrwl\tao\index.js
- O:\Programming\testing\troubleshoot-nvm\node_modules\@nrwl\cli\lib\init-local.js
- O:\Programming\testing\troubleshoot-nvm\node_modules\@nrwl\cli\bin\nx.js
- C:\Users\kwandes\AppData\Roaming\nvm\v14.16.0\node_modules\nx\node_modules\@nrwl\cli\bin\nx.js
- C:\Users\kwandes\AppData\Roaming\nvm\v14.16.0\node_modules\nx\bin\nx.js

Module '@angular-devkit/schematics/tools' can not be installed via npm

Steps to reproduce the behaviour

Run nvm install 14.16.0
Run nvm use 14.16.0

Run npx create-nx-workspace@latest

  • name: troubleshoot
  • type: empty
  • nx cloud: yes

Run npm install -g [email protected]
Run npm install --save-dev @nxrocks/nx-spring-boot

Run nx g @nxrocks/nx-spring-boot:app java-api
Fill out the info, the generation will fail

Run ยดnpm install @angular-devkit/coreยด
Run nx g @nxrocks/nx-spring-boot:app java-api
Fill out the info, the generation will fail

Notes

  • I suspect this is caused by the workspace being an empty project instead of an angular one
  • The issue does not occur in an NX workspace with preset Angular
  • The Username in windows path C:\Users\ has been replaced with kwandes

[Bug] getProjectGraph renamed in nx devkit 12.6.x breaks builds

nx-spring-boot: ^2.1.0
nx: 12.6.2

Hi,

I created a new workspace with NX 12.6.2 (latest) and then used nx-spring-boot to try and build the project, but get the following error:

$> nx buildJar gb-server
[nx-spring-boot]: Looking Spring Boot related projects inside the workspace...
[nx-spring-boot]: Adding dependencies for project 'gb-server'...
/home/liam/dev/guidebook/node_modules/@nxrocks/nx-spring-boot/src/project-graph.js:48
    return builder.getProjectGraph();
                   ^

TypeError: builder.getProjectGraph is not a function
    at Object.processProjectGraph (/home/liam/dev/guidebook/node_modules/@nxrocks/nx-spring-boot/src/project-graph.js:48:20)
    at /home/liam/dev/guidebook/node_modules/@nrwl/workspace/src/core/project-graph/project-graph.js:134:23
    at Array.reduce (<anonymous>)
    at updateProjectGraphWithPlugins (/home/liam/dev/guidebook/node_modules/@nrwl/workspace/src/core/project-graph/project-graph.js:130:20)
    at buildProjectGraph (/home/liam/dev/guidebook/node_modules/@nrwl/workspace/src/core/project-graph/project-graph.js:107:15)
    at createProjectGraph (/home/liam/dev/guidebook/node_modules/@nrwl/workspace/src/core/project-graph/project-graph.js:71:26)
    at Object.<anonymous> (/home/liam/dev/guidebook/node_modules/@nrwl/workspace/src/core/project-graph/project-graph.js:40:16)
    at Generator.next (<anonymous>)
    at /home/liam/dev/guidebook/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/home/liam/dev/guidebook/node_modules/tslib/tslib.js:113:16)
    at Object.createProjectGraphAsync (/home/liam/dev/guidebook/node_modules/@nrwl/workspace/src/core/project-graph/project-graph.js:39:20)
    at Object.<anonymous> (/home/liam/dev/guidebook/node_modules/@nrwl/workspace/src/command-line/run-one.js:19:52)
    at Generator.next (<anonymous>)
    at fulfilled (/home/liam/dev/guidebook/node_modules/tslib/tslib.js:114:62)

It appears nx changed the API for ProjectGraphBuilder in the latest version. You can see the 12.5.x version here with getProjectGraph, which was then changed to getUpdatedProjectGraph in v12.6.x here.

I will downgrade to nx 12.5.x to resolve this for now. Apologies for not trying to fix this in a PR, I'm just not sure if this should be fixed with a version label in the package.json or a change to the code.

Thanks for your work on this. It's seriously cool to have Spring integrated with nx!

[Bug] [nx-flutter] TypeError: options.platforms.join is not a function

Plugin Name and Version:
[email protected]

Nx Version (nx --version):
11.1.1

Angular CLI version (ng --version):
11.1.1

Expected Behaviour

The application should be created

Actual Behaviour

errors out with TypeError: options.platforms.join is not a function

Steps to reproduce the behaviour

nx g @nxrocks/nx-flutter:app test

? What package name would you like to use? com.test
? What is the project about? test
? Which Android language would you like to use? Kotlin
? Which iOS language would you like to use? Swift
? Which type of Flutter project would you like to create? Flutter application
? Which platforms would you like to use (--template must have been set to 'app' or 'plugin') ? Android platform
Flutter 1.22.5 โ€ข channel stable โ€ข https://github.com/flutter/flutter.git
Framework โ€ข revision 7891006299 (4 weeks ago) โ€ข 2020-12-10 11:54:40 -0800
Engine โ€ข revision ae90085a84
Tools โ€ข Dart 2.10.4
TypeError: options.platforms.join is not a function
at Object.buildFlutterCreateOptions (/home/scott/dev/apps/test/foo/node_modules/@nxrocks/nx-flutter/src/utils/flutter-utils.js:25:74)

Thanks!

cannot create project

I'm generating the project with VSCode nx console and getting following error:

yarn run v1.22.17
$ /Users/admin/dev/web/apps/eon/node_modules/.bin/nx generate @nxrocks/nx-spring-boot:project --name=api --artifactId=my-awesome-project --bootVersion=2.6.4 --dependencies=spring-boot-starter-web,spring-boot-starter-data-jpa,h2,mysql-connector-java '--description=My Awesome Project' --groupId=com.my-project --javaVersion=17 --language=kotlin --packageName=com.my-project.my-awesome-project --tags=scope:apps,type:app --version=0.0.1 --no-interactive --dry-run
Property 'javaVersion' does not match the schema. '17' should be a 'string'.
error Command failed with exit code 1.

If I set the javaVersion to default value 11 I'm getting following error:

yarn run v1.22.17
$ /Users/admin/dev/web/apps/eon/node_modules/.bin/nx generate @nxrocks/nx-spring-boot:project --name=api --artifactId=my-awesome-project --bootVersion=2.6.4 --dependencies=spring-boot-starter-web,spring-boot-starter-data-jpa,h2,mysql-connector-java '--description=My Awesome Project' --groupId=com.my-project --language=kotlin --packageName=com.my-project.my-awesome-project --tags=scope:apps,type:app --version=0.0.1 --no-interactive --dry-run
Downloading Spring Boot project zip from : https://start.spring.io/starter.zip?type=maven-project&language=kotlin&name=api&groupId=com.my-project&artifactId=my-awesome-project&version=0.0.1&packageName=com.my-project.my-awesome-project&javaVersion=11&packaging=jar&dependencies=spring-boot-starter-web,spring-boot-starter-data-jpa,h2,mysql-connector-java&description=My%20Awesome%20Project&bootVersion=2.6.4...
Extracting Spring Boot project zip to '/Users/vladimir.drayling/dev/web/apps/eon/apps/api'...
invalid signature: 0x6974227b
error Command failed with exit code 1.

nx report

 >  NX   Report complete - copy this into the issue template

   Node : 16.13.1
   OS   : darwin x64
   yarn : 1.22.17
   
   nx : 13.8.4
   @nrwl/angular : 13.8.4
   @nrwl/cli : 13.8.4
   @nrwl/cypress : 13.8.4
   @nrwl/detox : undefined
   @nrwl/devkit : 13.8.4
   @nrwl/eslint-plugin-nx : 13.8.4
   @nrwl/express : undefined
   @nrwl/jest : 13.8.4
   @nrwl/js : undefined
   @nrwl/linter : 13.8.4
   @nrwl/nest : undefined
   @nrwl/next : undefined
   @nrwl/node : undefined
   @nrwl/nx-cloud : undefined
   @nrwl/react : undefined
   @nrwl/react-native : undefined
   @nrwl/schematics : undefined
   @nrwl/storybook : 13.8.4
   @nrwl/tao : 13.8.4
   @nrwl/web : undefined
   @nrwl/workspace : 13.8.4
   typescript : 4.5.5
   rxjs : 7.4.0
   ---------------------------------------
   Community plugins:
         @angular/animations: 13.2.5
         @angular/common: 13.2.5
         @angular/compiler: 13.2.5
         @angular/core: 13.2.5
         @angular/forms: 13.2.5
         @angular/platform-browser: 13.2.5
         @angular/platform-browser-dynamic: 13.2.5
         @angular/router: 13.2.5
         @angular-devkit/build-angular: 13.2.5
         @angular/cli: 13.2.5
         @angular/compiler-cli: 13.2.5
         @angular/language-service: 13.2.5
         @nxrocks/nx-spring-boot: 4.0.2

What am I doing wrong?

Thank you for the help!

[Feature] [nx-flutter] add a proper alias to `app` schematics

Is your feature request related to a problem? Please describe.
Using app in nx g @nxrocks:nx-flutter:app to create a Flutter package or module is not really intuitive.
Describe the idea you'd like
Add a create alias to the application schematics and highlight it in the README (instead of current app).

Describe alternatives you've considered

Additional context

[Bug] [nx-flutter] Schematic "application" cannot resolve the factory.

Plugin Name and Version:
[email protected]

Nx Version (nx --version):
11.0.20

Angular CLI version (ng --version):
11.0.6

Expected Behaviour

the application should be created

Actual Behaviour

tool ends with Schematic "application" cannot resolve the factory.

Steps to reproduce the behaviour

nx g @nxrocks/nx-flutter:app dora

? What package name would you like to use? dora
? What is the project about? Maas Web for Dora
? Which Android language would you like to use? Kotlin
? Which iOS language would you like to use? Swift
? Which type of Flutter project would you like to create? Flutter application
? Which platforms would you like to use (--template must have been set to 'app' or 'plugin') ? Web platform

thanks for this tool

[Bug] [nx-quarkus] `Premature close` when generating project

Plugin Name

@nxrocks/nx-quarkus

Plugin Version

2.1.2

Nx Version

13.8.3

Expected Behaviour

nx g @nxrocks/nx-quarkus:new abc ends without error, app gets generated

Actual Behaviour

nx g @nxrocks/nx-quarkus:new abc ends with error

Steps to reproduce the behaviour

Follow https://github.com/tinesoft/nxrocks/tree/develop/packages/nx-quarkus#getting-started

I can generate Quarkus project when I manually edit ./node_modules/@nxrocks/nx-quarkus/src/generators/project/lib/generate-quarkus-project.js and comment out throw e_1.error; line.
Generated project works fine, I'm able to run commands like nx package abc.

I tried to get the zip using curl and extract it using jar and all worked fine. Downloaded zip doesn't seem to be corrupted.
curl -sS https://code.quarkus.io/d\?b\=MAVEN\&g\=com.example\&a\=demo\&e\=io.quarkus:quarkus-resteasy-jackson | jar xv

[Feature] Add Nx target to lint code with Checkstyle

Is your feature request related to a problem? Please describe

This feature is not related to a problem.

Describe the idea you'd like

Checkstyle is a widely adopted solution to lint Java code. It is part of the Maven CLI and can be executed with mvn checkstyle:check or ./mvnw checkstyle:check. I'm currently integrating Checkstyle to my Nx workspace with the method described below. It would be great if this Nx plugin implemented a target, e.g. named @nxrocks/nx-spring-boot:lint, to lint a project. The goal would be to enable the user to lint project with this Nx plugin without having to manually setup Checkstyle as described below.

Describe alternatives you've considered

Here is how I currently integrate Checkstyle with my Nx workspace.

  1. Add a Checksum configuration file in the root directly of the Nx workspace. I picked the default configuration file google_checks.xml used by Google. When not specifying any configuration file to Checksum, it uses its internal Sun configuration. Both Google and Sun configuration files can be found here.
  2. Add the following target to a project:
    "lint": {
      "executor": "@nrwl/workspace:run-commands",
      "options": {
        "command": "./mvnw checkstyle:check",
        "cwd": "apps/challenge-core-service"
      }
    },
  1. Add the following section to pom.xml to enable the update of Checkstyle at runtime. The current version is 10.3. Without this section, an older version of Checkstyle will run with the mvnw script provided by this GitHub repo.
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>3.1.2</version>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>10.3</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  1. Specify the location of the configuration file in pom.xml.
	<properties>
          <checkstyle.config.location>${basedir}/../../checkstyle.xml</checkstyle.config.location>
	</properties>

Additional context

  • The plugin should enable the user to place the Checkstyle configuration file outside of the project that uses it, e.g. in the root directory of the Nx workspace for the sake of keeping the code DRY. Hence, the plugin should allow the user to specify the location of the Checkstyle configuration file.
  • Do not make the assumption that all projects are included directly in the folders apps/ and libs/, e.g. when reading the Checkstyle configuration file. For example, in my workspace I have a project in libs/shared/data-access-x that is shared between multiple projects. I have seen this project structure in workspaces created by others too.

Thanks!

[Feature] Using consistent naming

I'd like to see a consistent (hence mnemonic) naming for the targets, just like for the official plugins by Nrwl.

Example

Instead of: nx run myApp:run
Have this: nx run myApp:serve

I'm still on the fence about the others, but this one bugs me in a special way :D

[Bug] [nx-flutter] missing quotes around -description value

Plugin Name and Version:
nx-flutter 1.2.0

Nx Version (nx --version):
11.1.2

Angular CLI version (ng --version):
11.0.6

Expected Behaviour

I should be able to write multiple words for the Description step

Actual Behaviour

command line fails because of the space in description
Failed to execute command: flutter create --project-name=design --org=skipr.design --description=Design Demo --android-language=kotlin --template=app --platforms=web apps/design

Steps to reproduce the behaviour

npx @angular-devkit/schematics-cli @nxrocks/nx-flutter:app design

? What is the project about? Design Demo

Release including the buildJar/buildWar to build change

Is your feature request related to a problem? Please describe

At the moment I cannot use the buildJar target as I need the package mvn command to be run first (cf. #43).

Describe the idea you'd like

Could you release the current development branch please?

Describe alternatives you've considered

Implementing my own targets which would be not necessary.

Additional context

No response

[Feature] Add a Test target to springboot app schematic

Is your feature request related to a problem? Please describe.
Applications in NX projects usually include a test target, for running tests for the given application. That is missing from the schematic for a springboot app.
It could utilize mvnw test to perform testing. This would be faster than the current alternative which is to build a jar/war, and isolates issues.

Describe the idea you'd like
A test target included in the generated code, which runs mvn test or some form of it. Triggered when nx test app and nx run-many --all --target=test is run.

Describe alternatives you've considered
I can trigger the tests via the buildJar command, but that takes longer, and produces extra artefacts, making it less suitable for Continous Integration.
I can also navigate to the app directory and run mvn test manually, but that defeats the purpose of nx

Additional context
This would come very useful during Continous Integration. Currently, I need to write a special workflow step for testing the java app, instead of having it be run along with all other apps with nx run-many --all --target=test.
It also bypasses NX Cloud cache, although that is less of a concern

[Feature] [nx-spring-boot] Support for non-standard parents and for a parent pom.xml

I'd like to first thank you for this plugin! I am really excited to be using it to create a monorepo that can do both js/ts AND java-spring. ๐Ÿฅณ

Is your feature request related to a problem? Please describe

My individual spring applications/libraries must separately state their dependencies even if they have common deps.

Describe the idea you'd like

I would like to be able to have a pom.xml at the root level of the monorepo that can state common things like:

  • groupId
  • common dependencies
  • distributionManagement

Additional context

So I kind of found a hack for this solution already.
You can add <!-- <artifactId>spring-boot-starter-parent</artifactId>--> to each application/library to get the plugin to recognise it as a Nx project, then implement your own <parent> block that points to a pom.xml at the root.
This hack has the drawback of having to repeat the groupId for each application/lib to get the affected plugin to work.

What I would like to do is implement the following:

  • change the plugin's logic for finding the groupId to first check the application/lib pom, then if empty, use the parents groupId
  • change the plugin's logic to check for <artifactId>spring-boot-starter-parent</artifactId> and if it doesn't exist check for it in the root pom

I am happy to submit a PR

[Feature] [nx-flutter] add dependency graph support

Is your feature request related to a problem? Please describe.
It would be great if the plugin could generate the dependency graph for the flutter packages used
by analysing imports or reading the pubspec.yaml for example...

Describe the idea you'd like

Describe alternatives you've considered

Additional context
Investigate how Nx does it for TS/JS code

Support provided Maven/Gradle runtimes

Support host provided Maven and Gradle runtimes.

It would be great if this plugin could support host provided Maven and Gradle runtimes in addition to wrappers to provide:

  • Firewalled support (i.e. cant download wrappers)
  • Consistent runtime versions (always the same version of maven or gradle)
  • Faster
  • Better support for CI steps

[Refactor] [nx-spring-boot] Use Schematics's `Tree` API to save files extracted from spring boot zip

Is your feature request related to a problem? Please describe.

Currently, when the spring boot zip is downloaded, files are extracted directly from the HTTP response's stream to the target directory, using unzipper.Extract() API, bypassing the Schematics's Tree API, which is better as it does not affect the file system in case an error occurs.

Describe the idea you'd like

Parse each file content individually, then use Tree.create() to save the to the file system.

Additional context

A sample of that code has already present, but it is not working right now (zip content cannot be parsed from the response's stream...). Investigate why?๐Ÿ”Ž

return response.body.pipe(Parse({forceStream: true}))

[Bug] User options are not used to generate the project

Plugin Version:

Nx Version (nx --version):

  • 11.0.20

Angular CLI version (ng --version):

  • 11.0.4

Node version:

  • 14.15.1

Operating System:

  • Windows 10 Pro, version 20H2

Expected Behaviour

When creating a Java Spring app in an empty NX monorepo, the user is prompted to select various project settings.
Upon selection, those settings should apply and generate the project properly.

Actual Behaviour

The generated project does not have some of the values applied, and the defaults seem to be applied instead:

  • GroupId input: dev.hotdeals. Pom.xml: ยดcom.exampleยด
  • ArtifactId input: api, name when creating the project: java-api. Pom.xml name: demo
  • Project Description input: `` (nothing, just pressed enter). Expected empty description, instead got the default description of Demo Project for Spring Boot
  • Main class name was DemoApplication instead of ApiApplication, due to the name being incorrectly applied. Same applies to the default application test
  • Project type input: maven. The project becomes a maven project but the nx commands seem to sue gradle (possibly a different issue). Specifically, when running nx run java-api:run, the output is
> nx run java-api:run
Executing command: ./gradlew.cmd bootRun
'.' is not recognized as an internal or external command,
operable program or batch file.
Failed to execute command: ./gradlew.cmd bootRun

This result of the command can be seen in my repository and this commit
Next commit shows me fixing some of the invalid information (does not fix the gradle-instead-of-maven issue)

Steps to reproduce the behaviour

Workspace setup

Create a new workspace in the root folder of the repository
npx create-nx-workspace@latest app-sandbox

Java Project setup

guide
Navigate into the NX workspace directory cd app-sandbox
Install a dependancy for Java and Spring
npm install @nxrocks/nx-spring-boot --save-dev

Generate a Java app
nx g @nxrocks/nx-spring-boot:app java-api
Project type: maven
Packaging: jar
Java version: 11
GroupId: dev.hotdeals
ArtifactId: api
Package name: dev.hotdeals.api
About:
Dependencies:

Full output of a completed generation command

? Which type of project would you like to generate? Maven Project
? Which packaging would you like to use? Jar
? Which version of Java would you like to use? 11
? Which language would you like to use? Java
? What groupId would you like to use? dev.hotdeals
? What artifactId would you like to use? api
? What package name would you like to use? dev.hotdeals.api
? What is the project about?
? What dependencies would you like to use (comma separated)?
        > Go to https://start.spring.io/dependencies to get the ids needed here
    Downloading Spring Boot project zip from : https://start.spring.io/starter.zip?type=maven-project&language=java&groupdId=dev.hotdeals&artifactId=api&packageName=dev.hotdeals.api&javaVersion=11&packaging=jar...
    Extracting Spring Boot project zip to : apps/java-api...
UPDATE workspace.json (1211 bytes)
UPDATE nx.json (780 bytes)

[Question] Spring Boot app and lib usage

Are there any examples of how apps and libs work together in nx-spring-boot?

I don't see the point of libs right now, it's like a separated app. In my case, I have an app with the following packages: "admin, auth, user, shared". I want to divide them into separated libs and use them in the app, but I can't find a way in doing that. I can't even import the class from lib to app.

Also, is there a way to have just one pom.xml in the main app, and that libs will read from it, like in angular for example? You have one main package.json, and all libs and apps can read from that one package.json.

[Bug] Nx fails to cache all the logs generated by @nxrocks/nx-spring-boot

Plugin Name

@nxrocks/nx-spring-boot

Plugin Version

4.1.0

Nx Version

13.8.1

Expected Behaviour

Running an nx-cacheable task twice should render the same logs in the terminal when using the executor @nxrocks/nx-spring-boot:*.

Actual Behaviour

Logs generated by @nxrocks/nx-spring-boot:build are not cached.

Steps to reproduce the behaviour

Using the executor @nxrocks/nx-spring-boot:build

Consider this Nx task:

    "build": {
      "executor": "@nxrocks/nx-spring-boot:build",
      "options": {
        "root": "libs/shared/data-access-java"
      }
    },
  1. Clear the nx cache: nx clear-cache
  2. Run the task
$ nx run shared-data-access-java:build

> nx run shared-data-access-java:build

Executing command: ./mvnw package 
Warning: JAVA_HOME environment variable is not set.
plop
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------< org.sagebionetworks.challenge:data-access-java >-----------
[INFO] Building data-access-java 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ data-access-java ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ data-access-java ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ data-access-java ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /workspaces/challenge-registry/libs/shared/data-access-java/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ data-access-java ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ data-access-java ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:3.2.2:jar (default-jar) @ data-access-java ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.823 s
[INFO] Finished at: 2022-06-26T16:52:49Z
[INFO] ------------------------------------------------------------------------

 โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”

 >  NX   Successfully ran target build for project shared-data-access-java (2s)
  1. Run the task again:
$ nx run shared-data-access-java:build

> nx run shared-data-access-java:build  [existing outputs match the cache, left as is]

Executing command: ./mvnw package 

 โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”

 >  NX   Successfully ran target build for project shared-data-access-java (15ms)
 
   Nx read the output from the cache instead of running the command for 1 out of 1 tasks.

The logs generated by the Maven wrapper have not been captured by Nx.

Building using Maven directly (without using @nxrocks/nx-spring-boot)

Consider this Nx task that builds the same project as above:

    "build": {
      "executor": "@nrwl/workspace:run-commands",
      "options": {
        "command": "./mvnw package",
        "cwd": "libs/shared/data-access-java"
      }
    },
  1. Clear the nx cache: nx clear-cache
  2. Run the task
$ nx run shared-data-access-java:build

> nx run shared-data-access-java:build

Warning: JAVA_HOME environment variable is not set.
plop
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------< org.sagebionetworks.challenge:data-access-java >-----------
[INFO] Building data-access-java 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ data-access-java ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ data-access-java ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ data-access-java ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /workspaces/challenge-registry/libs/shared/data-access-java/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ data-access-java ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ data-access-java ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:3.2.2:jar (default-jar) @ data-access-java ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.761 s
[INFO] Finished at: 2022-06-26T16:56:43Z
[INFO] ------------------------------------------------------------------------

 โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”

 >  NX   Successfully ran target build for project shared-data-access-java (2s)
  1. Run the task again.
$ nx run shared-data-access-java:build

> nx run shared-data-access-java:build  [existing outputs match the cache, left as is]

Warning: JAVA_HOME environment variable is not set.
plop
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------< org.sagebionetworks.challenge:data-access-java >-----------
[INFO] Building data-access-java 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ data-access-java ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ data-access-java ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ data-access-java ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /workspaces/challenge-registry/libs/shared/data-access-java/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ data-access-java ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ data-access-java ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:3.2.2:jar (default-jar) @ data-access-java ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.761 s
[INFO] Finished at: 2022-06-26T16:56:43Z
[INFO] ------------------------------------------------------------------------

 โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”

 >  NX   Successfully ran target build for project shared-data-access-java (16ms)
 
   Nx read the output from the cache instead of running the command for 1 out of 1 tasks.

This time the logs of the cached task have been properly captured by Nx.

Thanks!

[Bug] CI: Build results are retrieved from Nx Cloud cache even when running on different OS than local machine

I'm using Nx cloud to speed up the build/test/etc time of this workspace.

Before pushing my code, I alway run nx affected:test --parallel in a pre-commit hook,
to ensure I'm not commiting anything that could break the code.

Unfortunately, the results of that previous successful local build are picked and retrieved from Nx cloud (see https://github.com/tinesoft/nxrocks/runs/2536385807?check_suite_focus=true#step:7:54) when running the similar command on my CI (via Github Actions), even for a different OS that my local machine.

Here is my github workflow: https://github.com/tinesoft/nxrocks/blob/develop/.github/workflows/run-unit-tests.yml

Any help @FrozenPandaz, @vsavkin, @AgentEnder on how I can setup my github workflow properly to avoid that issue?

Thanks in advance

[Feature] Lint target for springboot apps

Is your feature request related to a problem? Please describe.
NX contains commands for various actions, with some being solely for running the application, while others being used to ensure quality. While this springboot plugin covers everything needed to run and deploy the app, it's missing linting.

Describe the idea you'd like
A lint target, allowing developers to check code for potential issues without having to run the tests or build the project. It could utilize plugins like sonarlint.

Describe alternatives you've considered
An alternative is for developers to manually open their IDEs and check if there are any issues, but that is way slower.

Additional context
This feature would be especially useful in projects with continuous integrations and pull request-based development. A lint workflow can be created, which then would clearly state in the PR whether or not the code has any potential issues.

[Feature] Could the create command be separated into two commands, one for app and one for lib?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

No.

Describe the idea you'd like
A clear and concise description of what you want to happen.

I would like to see nx g @nxrocks/nx-flutter:create separated into:

nx g @nxrocks/nx-flutter:app [--directory=]
nx g @nxrocks/nx-flutter:lib [--directory=]

; and allowing them to be integrated into the nx dependecy graph mechanism. Flutter has applications, modules, packages, and plugins, so there is a natural separation between apps and libs as far as the flutter cli is concerned.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

The scaffolding schema could be easily split into two schemas, one for app and one for lib. Since you are defering to the flutter cli in both cases it should as easy as changing the schematic's schema and allowing only for certain cli arguments in each case. This line:

const projectType = ProjectType.Application;

should become:

const projectType = ProjectType.Library;

in the library case.

Additional context
Add any other context or screenshots about the feature request here.

There is of course the issue of imports. I think to fully appreciate the nx tool for code sharing, you ought to be able to import a flutter lib in a flutter app. But because nx is a node.js tool I am also thinking there would have to be some integration with the dart language to be able to excute npm build or npm test at the root directory and have your flutter app pull it's dependencies and compile. This is just an idea, since I think nx + flutter would be a really cool setup for a web, mobile, desktop, AND node.js backend and run the whole show from 1 repo.

[Bug] The string contains invalid characters. when extracting Spring Boot project

Plugin Name

@nxrocks/nx-spring-boot

Plugin Version

v4.0.2

Nx Version

12.10.1

Expected Behaviour

creating SpringBoot Project

Actual Behaviour

Extracting Spring Boot project zip to 'C:\nennungenRest/apps/rest'...
The string contains invalid characters.

Steps to reproduce the behaviour

When generating a new project I get the error above while downloading and extracting from start.spring.io

[Feature] [nx-spring-boot] Auto-install libraries when running build or serve commands on the dependent application

Is your feature request related to a problem? Please describe.

When creating a Spring boot application and a library within the workspace, the library is not locally installed prior to running commands on the dependent app.
This causes an error because of the dependency (library) not being found locally.

Describe the idea you'd like

We could leverage the dependency graph and Nx's task graph to auto-install dependencies(libraries) (via mvn install or gradle build)

Describe alternatives you've considered

Additional context

when monorepo library dependency added to application's pom file, it throws error

Plugin Name

@nxrocks/nx-quarkus

Plugin Version

v.2.0.0

Nx Version

13.3.0

Expected Behaviour

show dependency graph between library and apps without any error.

Actual Behaviour

I have a java-api-lib in mono-repo under libs/api, I am adding maven dependency for it in my application's pom file which is under apps/services/kogito-validator.

When I run nx dep-graph, it throws following error:

[nx-quarkus]: Adding dependencies for project 'services-kogito-validator'...
Error: Source project services-kogito-validator does not have a file: apps\services\kogito-validator\pom.xml
at ProjectGraphBuilder.addExplicitDependency (\node_modules@nxrocks\nx-quarkus\node_modules@nrwl\devkit\src\project-graph\project-graph-builder.js:78:19)
at \node_modules@nxrocks\nx-quarkus\src\project-graph.js:53:21
at Array.forEach ()
at addDependenciesForProject (\node_modules@nxrocks\nx-quarkus\src\project-graph.js:50:30)
at \node_modules@nxrocks\nx-quarkus\src\project-graph.js:64:9
at Array.forEach ()
at Object.processProjectGraph (\node_modules@nxrocks\nx-quarkus\src\project-graph.js:63:40)
at \node_modules@nrwl\workspace\src\core\project-graph\build-project-graph.js:201:33
at Array.reduce ()
at updateProjectGraphWithPlugins (\node_modules@nrwl\workspace\src\core\project-graph\build-project-graph.js:192:46)
at \node_modules@nrwl\workspace\src\core\project-graph\build-project-graph.js:84:19
at Generator.next ()
at fulfilled (\node_modules\tslib\tslib.js:114:62)

Steps to reproduce the behaviour

  1. create library using following command:
    nx g @nxrocks/nx-quarkus:project java-api --projectType library --buildSystem MAVEN --groupId com.test.quarkus --artifactId java-api --directory api-sec

nx g @nxrocks/nx-quarkus:project api-server --projectType application --buildSystem MAVEN --groupId com.test.quarkus --artifactId api-server --directory services

  1. open services/api-server/pom.xml and add dependency for java-api library.
  2. run nx dep-graph
    $ nx dep-graph
    [nx-quarkus]: Looking Quarkus related projects inside the workspace...
    [nx-quarkus]: Adding dependencies for project 'api-sec-java-api'...
    [nx-quarkus]: Adding dependencies for project 'services-api-server'...
    Error: Source project services-api-server does not have a file: apps\services\api-server\pom.xml
    at ProjectGraphBuilder.addExplicitDependency (C:\Users\test\quarkus-workspace\quarkus-test\node_modules@nrwl\devkit\src\project-graph\project-graph-builder.js:78:19)
    at C:\Users\test\quarkus-workspace\quarkus-test\node_modules@nxrocks\nx-quarkus\src\project-graph.js:53:21
    at Array.forEach ()
    at addDependenciesForProject (C:\Users\test\quarkus-workspace\quarkus-test\node_modules@nxrocks\nx-quarkus\src\project-graph.js:50:30)
    at C:\Users\test\quarkus-workspace\quarkus-test\node_modules@nxrocks\nx-quarkus\src\project-graph.js:64:9
    at Array.forEach ()
    at Object.processProjectGraph (C:\Users\test\quarkus-workspace\quarkus-test\node_modules@nxrocks\nx-quarkus\src\project-graph.js:63:40)
    at C:\Users\test\quarkus-workspace\quarkus-test\node_modules@nrwl\workspace\src\core\project-graph\build-project-graph.js:201:33
    at Array.reduce ()
    at updateProjectGraphWithPlugins (C:\Users\test\quarkus-workspace\quarkus-test\node_modules@nrwl\workspace\src\core\project-graph\build-project-graph.js:192:46)
    at C:\Users\test\quarkus-workspace\quarkus-test\node_modules@nrwl\workspace\src\core\project-graph\build-project-graph.js:84:19
    at Generator.next ()
    at fulfilled (C:\Users\test\quarkus-workspace\quarkus-test\node_modules\tslib\tslib.js:114:62)
    Failed to process the project graph with "@nxrocks/nx-quarkus". This will error in the future!
    [nx-quarkus]: Looking Quarkus related projects inside the workspace...
    [nx-quarkus]: Adding dependencies for project 'api-sec-java-api'...
    [nx-quarkus]: Adding dependencies for project 'services-api-server'...
    Error: Source project services-api-server does not have a file: apps\services\api-server\pom.xml
    at ProjectGraphBuilder.addExplicitDependency (C:\Users\test\quarkus-workspace\quarkus-test\node_modules@nrwl\devkit\src\project-graph\project-graph-builder.js:78:19)
    at C:\Users\test\quarkus-workspace\quarkus-test\node_modules@nxrocks\nx-quarkus\src\project-graph.js:53:21
    at Array.forEach ()

[Bug] unable to install plugin with npm i @nxrocks/nx-quarkus --save-dev

Plugin Name

@nxrocks/nx-quarkus

Plugin Version

v2.1.1

Nx Version

13.8.1

Expected Behaviour

the plugin package to be installed

Actual Behaviour

npm i @nxrocks/nx-spring-boot --save-dev
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @nxrocks/[email protected].
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ctientcheu/.npm/_logs/2022-02-16T19_00_47_104Z-debug.log

Steps to reproduce the behaviour

1- create a nx monorepo using npx
2- run 'npm i @nxrocks/nx-quarkus --save-dev'

[Feature] [nx-flutter] make the prompt and available builders dynamic and based on previous answers

Is your feature request related to a problem? Please describe.
As reported by @benoitskipr here, some options are not compatible together (like --platforms and --template!=app), and should not be asked to user based on its previous selection. Also, some builders (like buildApk for example), make no sense for some type of projects (package or module for example)

Describe the idea you'd like
The application schematics prompt should be dynamic and auto-adapt its next questions, based on previous user selections.

The same goes for builders (executors) that will be added to the generated project.

Describe alternatives you've considered

Additional context

Some useful resources that might help:

[Bug] Using Latest Nx (14.1.4) make our CI break

Plugin Name

@nxrocks/nx-flutter

Plugin Version

3.0.2

Nx Version

14.1.4

Expected Behaviour

Run yarn / npm install smoothly

Actual Behaviour

Reference nrwl/nx#10222

Our CI looks like this when installing

error ./node_modules/@nxrocks/common/node_modules/nx, /builds/zo-group/software/simpan/node_modules/@nxrocks/nx-flutter/node_modules/nx: Command failed.
Exit code: 1
Command: node ./bin/init
Arguments: 
Directory: ./node_modules/@nxrocks/nx-flutter/node_modules/nx
Output:
>  NX   Cannot read properties of undefined (reading 'endsWith')
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Temporary Solution and it works

  "overrides": {
    "@nxrocks/nx-flutter": {
      "@nrwl/cli": "14.1.4"
    }
  }

cc: @tinesoft I can help you to update Nx deps if needed

Steps to reproduce the behaviour

  1. Install Nx Latest with Nx flutter
  2. Yarn

error creating project

Plugin Version:

  • 1.1.0

Nx Version (nx --version):

  • 11.0.16

Angular CLI version (ng --version):

  • not using angular

Expected Behaviour

expected the command:
nx g @nxrocks/nx-spring-boot:app
to create a spring application.

Actual Behaviour

TypeError: Cannot read property 'toString' of null
`

#### Steps to reproduce the behaviour
```sh
nx g @nxrocks/nx-spring-boot:app       
? What name would you like to use? spring
? Which type of project would you like to generate? Gradle Project
? Which packaging would you like to use? Jar
? Which version of Java would you like to use? 11
? Which language would you like to use? Kotlin
? What groupId would you like to use? com.au11s
? What artifactId would you like to use? spring
? What package name would you like to use? com.au11s.spring
? What is the project about? experiments
? What dependencies would you like to use (comma separated)?
        > Go to https://start.spring.io/dependencies to get the ids needed here 
    Downloading Spring Boot project zip from : https://start.spring.io/starter.zip?type=gradle-project&language=kotlin&groupdId=com.au11s&artifactId=spring&packageName=com.au11s.spring&javaVersion=11&packaging=jar&description=experiments...
    Extracting Spring Boot project zip to : apps/spring...
TypeError: Cannot read property 'toString' of null
    at /home/davem/au/codebase/2020/au-2020-devops-api/node_modules/@nxrocks/nx-spring-boot/src/schematics/application/lib/add-build-info-task.js:13:51
    at MergeMapSubscriber.project (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/@angular-devkit/schematics/src/rules/call.js:75:24)
    at MergeMapSubscriber._tryNext (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/rxjs/internal/operators/mergeMap.js:67:27)
    at MergeMapSubscriber._next (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/rxjs/internal/operators/mergeMap.js:57:18)
    at MergeMapSubscriber.Subscriber.next (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/rxjs/internal/Subscriber.js:66:18)
    at MergeMapSubscriber.notifyNext (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/rxjs/internal/operators/mergeMap.js:93:26)
    at SimpleInnerSubscriber._next (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/rxjs/internal/innerSubscribe.js:27:21)
    at SimpleInnerSubscriber.Subscriber.next (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Observable._subscribe (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/rxjs/internal/util/subscribeToArray.js:5:20)
    at Observable._trySubscribe (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/rxjs/internal/Observable.js:44:25)
    at Observable.subscribe (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/rxjs/internal/Observable.js:30:22)
    at Object.innerSubscribe (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/rxjs/internal/innerSubscribe.js:102:23)
    at MergeMapSubscriber._innerSub (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/rxjs/internal/operators/mergeMap.js:80:50)
    at MergeMapSubscriber._tryNext (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/rxjs/internal/operators/mergeMap.js:74:14)
    at MergeMapSubscriber._next (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/rxjs/internal/operators/mergeMap.js:57:18)
    at MergeMapSubscriber.Subscriber.next (/home/davem/au/codebase/2020/au-2020-devops-api/node_modules/rxjs/internal/Subscriber.js:66:18)
Cannot read property 'toString' of null

[Bug] buildJar does not run successfully

Plugin Name and Version:
@nxrocks/[email protected]

Nx Version (nx --version):
11.3.0

Angular CLI version (ng --version):
11.3.0

Expected Behaviour

when

$ nx buildJar <mySpringBootApp>

is executed the SpringBoot Application is repackaged successfully.

Actual Behaviour

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.3:repackage (default-cli) on project mySpringBootApp: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.4.3:repackage failed: Source file must not be null -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Steps to reproduce the behaviour

  • Add SpringBootApp to a nxMonoRepo
  • run nx buildJar <SpringBootApp>

More Information

  • When I execute ./mvnw spring-boot:repackage directly in the folder of the springBootApp the same happens
  • When running ./mvnw clean install spring-boot:repackage the repackage is done successfully
  • According to the issues here and here this could be a general problem with SpringBoot at the moment

[Bug] [nx-flutter] Correct and reactivate e2e tests

Currently, e2e tests have been disabled on nx-flutter, because they don't seem to work...

Each test exceeds the max duration required and ends up with a Jest timeout error...
Raising that timeout value doesn't work...it seems an error is occurring when project generator runs..

I cannot debug the full execution of the test in VSCode, because the breaking points in the generator code (either in packages/nx-flutter/src/generators/project/generator.ts or in tmp/nx-e2e/proj/node_modules/@nxrocks/nx-flutter/src/generators/project/generator.js ) are not reached by the debugger...

image

I cannot find info online on how to debug Nx plugins during e2e testing.

Any help is more than welcome!

[Bug] [nx-spring-boot] Jar of library projects should not be executable

Is your feature request related to a problem? Please describe.

Currently, when building the Jar of a Spring boot project of type Library, the resulting jar is executable (default behavior). This is useless, as that jar is not meant to be executed, but simply added as dependency to other (application) projects.

Describe the idea you'd like

After generation:

  • for a Maven-based project, the spring-boot-maven-plugin should be removed from the pom.xml
  • for a Gradle-based project, the bootJar should be disabled (only enable the regular jar)

Describe alternatives you've considered

Additional context

More information can be found here: https://spring.io/guides/gs/multi-module/#initial

[Feature] [nx-spring-boot] nx affected:build should build changed spring boot project.

Plugin Name and Version:
"@nxrocks/nx-spring-boot": "2.1.0"

Nx Version (nx --version):
12.0.8

Angular CLI version (ng --version):
React 17.0.2.

Expected Behaviour

`nx affected:build --all should rebuild spring boot project

Actual Behaviour

Output is: (note abcd is the React application)

nx affected:build --all                                                                             โœ”  13:34:17 ๏€—  

>  NX   WARNING  Running affected:* commands with --all can result in very slow builds.

  --all is not meant to be used for any sizable project or to be used in CI.
  
  Learn more about checking only what is affected: https://nx.dev/latest/angular/cli/affected#affected.


>  NX  Running target build for projects:

  - abcd

Steps to reproduce the behaviour

Create workspace with a react application
Add nx-spring-boot and create an app project with nx-spring boot

npm install @nxrocks/nx-spring-boot --save-dev
nx g @nxrocks/nx-spring-boot:new my-app

Commit everything to master branch

Checkout new branch and add a line "System.out.println();" to the Spring Application main method
Commit to the branch

run nx affected:build --all

It should rebuild the Spring App but it doesnt

[Bug] ERROR: Something went wrong in @nrwl/run-commands - Command failed: flutter install

Plugin Name

@nxrocks/nx-flutter

Plugin Version

v3.0.2

Nx Version

13.9.6

Expected Behaviour

Commands such as nx run myapp:build run (as when run manually) and produce output.

Actual Behaviour

All flutter commands run using run-commands throw the following error, with no further output:

ERROR: Something went wrong in @nrwl/run-commands - Command failed: flutter install

When the verbose flag is provided, we get:

Error: ERROR: Something went wrong in @nrwl/run-commands - Command failed: flutter doctor
    at /home/edhill/Code/brightsign/brightsign/node_modules/@nrwl/workspace/src/executors/run-commands/run-commands.impl.js:54:19
    at Generator.throw (<anonymous>)
    at rejected (/home/edhill/Code/brightsign/brightsign/node_modules/tslib/tslib.js:115:69)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

All of these commands run perfectly fine when run by hand in the app directory. All of these commands also run fine when wrapped like echo $(flutter install).

Steps to reproduce the behaviour

  1. With flutter installed and working correctly system-wide
  2. Create a new NX workspace.
  3. Install the nx-flutter package.
  4. Create a new flutter app (I have been testing with Android and iOS primarily)
  5. Attempt to run nx run myapp:xxxx

Dependencies Question

Currently the spring integration only supports a single module and not dependencies (at least in maven).

Do you have any plans to support dependencies (e.g. foo-common)

  • How would this work?
  • Would it use maven reactor or nx dependency graph`?
  • How would this work with nx build cache and affected:apps/libs

If these are not planned I could have a look at it

[Bug] Do not configure Maven to build an executable jar when generating a library

Plugin Name

@nxrocks/nx-spring-boot

Plugin Version

4.1.0

Nx Version

14.3.6

Expected Behaviour

The app should successfully find and use a Spring Boot library generated with this plugin.

Actual Behaviour

The pom.xml file generated by this plugin includes the following snippet:

<build>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
    </plugin>
</build>

This snippet prevents the library from being consumed by an application that imports it. The error message would say that the package that the app is trying to import does not exist. For more detailed information about this error, see this comment.

The solution is given by this Spring doc page:

To tell Maven to not build an executable jar for the Library project, you must remove the following block from the pom.xml created by the Spring Initializr:

<build>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
    </plugin>
  </plugins>
</build>

Steps to reproduce the behaviour

tschaffter/nx-spring-boot-example#2 (comment)

Flutter supported the affected commands of NX ?

Hi,

Great package!

Does this plugin take into consideration what app / packages have changed and it can build ONLY them ?

i..e If I have 2 libraries and 1 app and only the first library changed then it would only build that library and the main app as it depends on it.. but would not build library 2

Thanks

[Bug] NX fails to execute maven commands

Plugin Name and Version:

  • @nxrocks/nx-spring-boot:1.3.0

Nx Version (nx --version):

  • 11.0.20

Angular CLI version (ng --version):

  • Not present, as the workspace was created as an empty workspace (it's not a angular workspace)

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.

  • java-app is an older variant that was generated with nx:1.2.1 , and had issues described here
  • test-java-app is a variant generated with the newest 1.3.0 version and has the bug described in this issue.

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:

  • A friend running on Windows in their own repository has also encountered this issue in a freshly generated app
  • this issue is related to #29

[Feature] Formatting support for springboot apps

Is your feature request related to a problem? Please describe.
NX contains commands for various actions, with some being solely for running the application, while others being used to ensure quality. While this springboot plugin covers everything needed to run and deploy the app, it's missing formatting support.

Describe the idea you'd like
When nx format:check and nx format are run, the springboot apps would be included in the formatting.

Describe alternatives you've considered
An alternative is for developers to manually open their IDEs and use run their formatting tools there, but that is slower and does not work at all in the continuous integration aspect of development

Additional context
This feature would be especially useful in projects with continuous integrations and pull request-based development. A formatting check workflow can be created, which then would clearly state in the PR whether or not the code is properly structured, and ensures consistent coding style.

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.