Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Spring Boot app and lib usage #71

Closed
while1618 opened this issue Jul 20, 2021 · 8 comments
Closed

[Question] Spring Boot app and lib usage #71

while1618 opened this issue Jul 20, 2021 · 8 comments

Comments

@while1618
Copy link

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.

@tinesoft
Copy link
Owner

Hi @while1618,

Sorry for the late answer.

The idea of library projects was to allow reusing them in your boot applications (by adding the dependency in applications build.gradle or pom.xml).
They are not meant to be executable like boot jars (I recently enhanced that with #75, based on this guide on spring.io). Just like they don't need to be embedded inside a parent project (multi-module) per se.

Regarding the second point, Spring Initializr doesn't support multi-module projects out-of-the-box (spring-io/initializr#663), so doesn't this plugin.

But with the support for Nx's dependency graph api, this is not a big deal, as one could have library projects built first, when running a command on the application that uses it (#66, work in progress)

@tschaffter
Copy link

tschaffter commented Jun 25, 2022

Hi @tinesoft ,

Thanks to your comment, I was able to create a "@nxrocks/nx-spring-boot" library and import it in an app. I updated the build target of the lib with the additional argument install.

    "build": {
      "executor": "@nxrocks/nx-spring-boot:build",
      "options": {
        "root": "libs/my-lib",
        "args": [
          "install"
        ]
      }
    },

Currently the library is installed in the directory ~/.m2/repository. One improvement I'm seeking to make is to install the library to a folder inside the Nx workspace so that Nx can cache the build artifact. Any idea on what the best way to achieve this would be? Thanks!

@tschaffter
Copy link

tschaffter commented Jun 26, 2022

After giving it more thought, it's preferable to keep installing Maven packages to the default location (e.g. ~/.m2/repository) to keep the environment as standard as possible. This means that the "install" operation should not be part of a nx-cacheable task like "build" because Nx is not caching ~/.m2/repository.

Here is the solution I came up with:

  1. Add an "install" task to the library project.
    "install": {
      "executor": "@nrwl/workspace:run-commands",
      "options": {
        "command": "./mvnw install",
        "cwd": "libs/shared/data-access-java"
      },
      "dependsOn": [
        {
          "target": "build",
          "projects": "self"
        }
      ]
    },
  1. In the app that imports the library, specify that the task "build" depends on the task "install" of dependencies.
    "build": {
      "executor": "@nxrocks/nx-spring-boot:build",
      "options": {
        "root": "apps/challenge-core-service",
        "args": []
      },
      "dependsOn": [
        {
          "target": "install",
          "projects": "dependencies"
        }
      ]
    },

@tinesoft What do you think of this approach? If it were to be kept, then adding to this plugin a task like @nxrocks/nx-spring-boot:install that run ./mvnw install under the hood would enable to make the library project.json more compact than when using @nrwl/workspace:run-commands as I do.

@tinesoft
Copy link
Owner

Hi @tschaffter

Sorry, I didn't get to you sooner...

Indeed, the packages will always be installed in the default location (e.g. ~/.m2/repository).
this is what Maven does by default, and there is no need to change it for the Nx caching to work.
(the cache not working right now, is another issue that you spotted in #111, I will fix that)

As for your approach (task dependency) it is totally valid, in fact, I plan to integrate that out-of-the-box in the plugin, see #66

So stay tuned!

@tschaffter
Copy link

tschaffter commented Jun 28, 2022

Hi @tinesoft

I want to propose a different strategy for installing a library so that it can be imported in an app. The motivation is to enable the app to be dockerized. Dockerizing the app when the library is installed to the local repository (~/.m2/repository) is not possible in a simple way.

Instead, the strategy I'm exploring is to copy the jar library to the app folder when running the install target of the library. Then, the idea is that the following Dockerfile could be used to dockerize the Spring Boot app. See the line COPY lib /workspace/lib where I copy the lib folder that includes the jar file of the library.

FROM maven:3.8.4-openjdk-17 AS build
RUN mkdir -p /workspace
WORKDIR /workspace
COPY pom.xml /workspace
COPY src /workspace/src
COPY lib /workspace/lib
RUN mvn -f pom.xml clean package -DskipTests --no-transfer-progress

FROM openjdk:17-alpine
COPY --from=build /workspace/target/*.jar app.jar
ENTRYPOINT ["java","-jar","app.jar"]

I have created a GithHub repository (tschaffter/nx-spring-boot-example) that we could share to illustrate one recommended way to organize apps and libs generated with @nxrocks/nx-spring-boot.

I currently have an issue where I cannot build the app because it can not successfully import the library. If you have the time, do you mind having a look at this broken feature branch to see what I'm doing wrong? My Java is a bit rusty so we can assume that I'm doing something dumb. 😉

@tschaffter
Copy link

I found the solution to the above issue, see #113.

@tinesoft
Copy link
Owner

tinesoft commented Jul 11, 2022

I want to propose a different strategy for installing a library so that it can be imported in an app. The motivation is to enable the app to be dockerized. Dockerizing the app when the library is installed to the local repository (~/.m2/repository) is not possible in a simple way.

Instead, the strategy I'm exploring is to copy the jar library to the app folder when running the install target of the library. Then, the idea is that the following Dockerfile could be used to dockerize the Spring Boot app. See the line COPY lib /workspace/lib where I copy the lib folder that includes the jar file of the library.

FROM maven:3.8.4-openjdk-17 AS build
RUN mkdir -p /workspace
WORKDIR /workspace
COPY pom.xml /workspace
COPY src /workspace/src
COPY lib /workspace/lib
RUN mvn -f pom.xml clean package -DskipTests --no-transfer-progress

FROM openjdk:17-alpine
COPY --from=build /workspace/target/*.jar app.jar
ENTRYPOINT ["java","-jar","app.jar"]
I have created a GithHub repository (tschaffter/nx-spring-boot-example) that we could share to illustrate one recommended way to organize apps and libs generated with @nxrocks/nx-spring-boot.

@tschaffter Note that Spring-boot has built-in support for generating an optimised Dockerfile to package and run the application.
This is supported by the plugin as well, via the command nx buildImage bootapp, so I would recommend to use that instead.

Your can customise some options of that command (like setting the docker Image name for e.g) by adding it in the args of related target in project.json

{
  "version": 1,
  "projects": {
    "you-boot-app": {
      "projectType": "application",
      "root": "apps/your-boot-app",
      "sourceRoot": "apps/your-boot-app/src",
      "targets": {
        "buildImage": {
          "executor": "@nxrocks/nx-spring-boot:buildImage",
          "options": {
            "root": "apps/your-boot-app",
            "args": ["-Dspring-boot.build-image.imageName=yourcompany/your-boot-app-docker"]
          }
        }
      }
    }},
  "cli": {
    "defaultCollection": "@nrwl/workspace"
  }
}

@tschaffter
Copy link

Thanks for pointing out the executor @nxrocks/nx-spring-boot:buildImage. I can confirm that using it to build an image of a Spring app that depends on a local library installed in ~/.m2/repositories works (as described in this comment).

tinesoft added a commit that referenced this issue Jul 18, 2022
This executor publishes project's artifacts (i.e jar file) to local Maven repository (`~/.m2/repository`).
This allows dependant projects to properly resolve the dependency during their on build.

Besides, a task dependency was added to `build` executor, so that Nx will automatically call this `install` executor
on dependencies, when running the `build` task from the dependant project, meaning you don't have to worry about it.

Closes #65, #66 and #71
tinesoft added a commit that referenced this issue Jul 18, 2022
This executor publishes project's artifacts (i.e jar file) to local Maven repository (`~/.m2/repository`).
This allows dependant projects to properly resolve the dependency during their on build.

Besides, a task dependency was added to `build` executor, so that Nx will automatically call this `install` executor
on dependencies, when running the `build` task from the dependant project, meaning you don't have to worry about it.

Closes #65, #66 and #71
tinesoft added a commit that referenced this issue Jul 18, 2022
This executor publishes project's artifacts (i.e jar file) to local Maven repository (`~/.m2/repository`).
This allows dependant projects to properly resolve the dependency during their own builds.

Besides, a task dependency was added to `build` executor, so that Nx will automatically call this `install` executor
on dependencies, when running the `build` task from the dependant project, meaning you don't have to worry about it.

Closes #65, #66 and #71
github-actions bot pushed a commit that referenced this issue Aug 21, 2022
# [@nxrocks/nx-spring-boot-v5.0.0](nx-spring-boot/v4.1.0...nx-spring-boot/v5.0.0) (2022-08-21)

### Bug Fixes

* **nx-spring-boot:** fix `serve` and `apply-format` alias executors ([29f5183](29f5183))
* **nx-spring-boot:** fix creating spring boot libraries with `gradle` ([500a7d0](500a7d0))
* **nx-spring-boot:** fix library projects should not be executable ([b118a4e](b118a4e)), closes [#113](#113)
* set `@nrwl/*` packages as `peerDependencies` ([d03b709](d03b709)), closes [#106](#106)

### Features

* **nx-spring-boot:**  add proxy support for project generation ([bd3ac7e](bd3ac7e)), closes [#125](#125)
* **nx-spring-boot:** add `install` executor + make `build` depend on it ([68e1a5e](68e1a5e)), closes [#65](#65) [#66](#66) [#71](#71)
* **nx-spring-boot:** add `skipFormat` to control code formatting ([8bff29b](8bff29b))
* **nx-spring-boot:** check if source is a valid boot project on linking ([f74e524](f74e524))
* **nx-spring-boot:** improve logging when project zip can't be fetched ([f1a5229](f1a5229))
* **nx-spring-boot:** make `build` executor results cacheable ([4528715](4528715))
* **nx-spring-boot:** rename executors to use `kebab-case` ([1e5d9f4](1e5d9f4)), closes [#117](#117)
* **nx-spring-boot:** unselect by default adding code formatting support ([005ad95](005ad95))

### BREAKING CHANGES

* **nx-spring-boot:** `format-check` executor was renamed into `check-format`
* **nx-spring-boot:** All executors of this plugin now use `kebab-case` over `camelCase` for consistency

This only affect `buildImage` and `buildInfo` executors, which have been renamed into `build-image` and `build-info` respectively.

***
[skip ci]
github-actions bot pushed a commit that referenced this issue Jan 10, 2023
# @nxrocks/nx-melos-v1.0.0 (2023-01-10)

### Bug Fixes

*  wrong `@nxrocks/common` version referenced in dependent packages ([1b4b0e6](1b4b0e6))
* add `{workspaceRoot}` prefix (from Nx `v15+`) to targets' `outputs` ([411b402](411b402))
* **common:** fix `Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close` ([fb5f797](fb5f797)), closes [#142](#142)
* **common:** fix bug when fetching dependencies of maven based projects ([2ada704](2ada704))
* **common:** fix regex used to fetch gradle dependencies ([f1779a4](f1779a4))
* **common:** fix wrong groupId used for Spotless maven plugin ([3e4c613](3e4c613))
* **common:** ignore output when fetching package latest version from npm ([f426575](f426575))
* **common:** improve the checking/adding of a maven plugin  in `pom.xml` ([b8f59cf](b8f59cf))
* correct `TypeError: builder.getProjectGraph is not a function` ([3458f66](3458f66)), closes [#72](#72)
* enforce plugin `peerDependencies` on Nx `v15.0.0` and later ([4c220bb](4c220bb))
* fix executor output not restored when found in Nx cache ([fbb385a](fbb385a)), closes [#111](#111)
* fix installation issue due to `hpagent` not being found ([3620d23](3620d23)), closes [#128](#128)
* fix transitive `dependencies` from `@nxrocks/common` ([3594b1e](3594b1e)), closes [#131](#131)
* fix transitive dependencies from @nxrocks/common ([56631b2](56631b2)), closes [#131](#131) [#150](#150) [#152](#152) [#153](#153)
* include updated `package.json` in git when semantic releasing ([cb87139](cb87139))
* **nx-flutter:** add missing `buildAar` builder ([44432eb](44432eb))
* **nx-flutter:** add missing config for semantic-releasing ([06fd1bd](06fd1bd))
* **nx-flutter:** add plugin to nx.json only if not included already ([b98c1e9](b98c1e9))
* **nx-flutter:** correct generation error due to `platforms` option ([fc56c5e](fc56c5e)), closes [#22](#22)
* **nx-flutter:** correct generation error on multi word `description` ([1ed2d97](1ed2d97)), closes [#23](#23)
* **nx-flutter:** fix error when generating module or package ([86eb3f8](86eb3f8)), closes [#44](#44)
* **nx-flutter:** fix non-interactive generation of flutter projects ([6c4a5aa](6c4a5aa))
* **nx-melos:** add missing `release` target in `project.json` ([a1d8c1f](a1d8c1f))
* **nx-micronaut:** fix `serve` and `apply-format` alias executors ([30d75d7](30d75d7))
* **nx-micronaut:** fix generation without feature ([#136](#136)) ([76db010](76db010))
* **nx-micronaut:** fix project's base package/artifact name computation ([f2f2983](f2f2983))
* **nx-quarkus:** add plugin to `nx.json` only if not included already ([a964652](a964652))
* **nx-quarkus:** fix `Premature close` error when generating project ([6ebcd85](6ebcd85)), closes [#97](#97)
* **nx-quarkus:** fix `serve` and `apply-format` alias executors ([46b9695](46b9695))
* **nx-quarkus:** remove `ratchetFrom` from the default Spotless config ([59cb372](59cb372))
* **nx-spring-boot:** add plugin to nx.json only if not included already ([15511ae](15511ae))
* **nx-spring-boot:** always restore executable permissions on wrappers ([b9875d8](b9875d8))
* **nx-spring-boot:** correct error when executing builders on Windows ([1a744ab](1a744ab)), closes [#38](#38)
* **nx-spring-boot:** correct generation issue on Nx workspaces >=v11.2.0 ([d3c3816](d3c3816)), closes [#37](#37)
* **nx-spring-boot:** correct wrong extension for `gradlew` on windows ([77899ce](77899ce))
* **nx-spring-boot:** fix `Premature close` error when generating project ([f6b433d](f6b433d)), closes [#97](#97)
* **nx-spring-boot:** fix `serve` and `apply-format` alias executors ([29f5183](29f5183))
* **nx-spring-boot:** fix creating spring boot libraries with `gradle` ([500a7d0](500a7d0))
* **nx-spring-boot:** fix error when generating a gradle/kotlin project ([abfbd04](abfbd04)), closes [#15](#15)
* **nx-spring-boot:** fix generation error when setting `javaVersion` ([364b228](364b228)), closes [#98](#98)
* **nx-spring-boot:** fix library projects should not be executable ([b118a4e](b118a4e)), closes [#113](#113)
* **nx-spring-boot:** fix prompts not working generating the application ([b96e1ce](b96e1ce)), closes [#6](#6)
* **nx-spring-boot:** fix wrong 'cwd' used to execute builders commands ([b39e7e7](b39e7e7))
* **nx-spring-boot:** make builders executable platform independant ([b27bc4c](b27bc4c))
* **nx-spring-boot:** remove `ratchetFrom` from the default Spotless conf ([1462022](1462022))
* **nx-spring-boot:** remove extra char in `dependencies` prompt ([5bc0290](5bc0290))
* **nx-spring-boot:** set correct path for executors ([89e16d3](89e16d3))
* **nx-spring-boot:** some user options were not used during generation ([6813e7d](6813e7d)), closes [#17](#17)
* plugins include spec files in distributed pkg ([21bac53](21bac53))
* set `@nrwl/*` packages as `peerDependencies` ([d03b709](d03b709)), closes [#106](#106)

### Features

* **common:** add a utility to disable a gradle plugin ([171ad81](171ad81))
* **common:** add a utility to remove a maven plugin from the `pom.xml` ([8c13087](8c13087))
* **common:** add helper to get project root directory ([adbc8a9](adbc8a9))
* **common:** add support for `nx-micronaut` plugin ([b72cdaf](b72cdaf))
* **common:** add utility method to get http[s] proxy agent ([da61925](da61925))
* **common:** add utility to check the presence of a plugin in `pom.xml` ([bfec05f](bfec05f))
* **common:** add utility to unzip a zip stream ([a472c00](a472c00))
* **common:** add xml utilities to remove or check if a node is empty ([d07b827](d07b827))
* **common:** allow using legacy wrappers (i.e `.bat`, for maven mostly) ([7a13720](7a13720))
* **common:** increase the `maxBuffer` when running executors commands ([4bc388d](4bc388d))
* **common:** make the `version` optional when adding a gradle plugin ([bd3a182](bd3a182))
* **common:** move `octal` function into e2e testing utils ([b15a616](b15a616))
* **common:** update Spotless gradle plugin from `6.2.2` --> `6.8.0` ([8c76d3b](8c76d3b))
* **common:** update Spotless maven plugin from `2.20.2` --> `2.23.0` ([ab182ef](ab182ef))
* **nx-flutter:** add `create` alias to  project generation schematics ([0386629](0386629)), closes [#27](#27)
* **nx-flutter:** add `doctor` executor to run `flutter doctor` checks ([9d35de1](9d35de1))
* **nx-flutter:** add nx-flutter plugin ([e7426e9](e7426e9))
* **nx-flutter:** add special instructions to generate the app ([d5f768a](d5f768a))
* **nx-flutter:** add support for Nx 's dependency graph generation ([6fb58de](6fb58de)), closes [#28](#28)
* **nx-flutter:** auto-adapt prompt & builders based on previous answers ([668dd28](668dd28)), closes [#26](#26)
* **nx-flutter:** create project in `apps` or `libs` based on `template` ([dc20e0b](dc20e0b)), closes [#41](#41)
* **nx-flutter:** improve typings for `template` and `platforms` options ([b614dc4](b614dc4))
* **nx-flutter:** make all `build` executors results cacheable ([a08dbb8](a08dbb8))
* **nx-flutter:** migrate to Nrwl's DevKit executors/generators API ([8c72ed5](8c72ed5))
* **nx-flutter:** rename executors to use `kebab-case` ([319558f](319558f))
* **nx-flutter:** rename the `application` generator into `project` ([6361557](6361557))
* **nx-flutter:** use `NX_VERBOSE_LOGGING` to control logs in dep graph ([e678ed5](e678ed5))
* **nx-melos:** add `nx-melos` plugin ([4fb5da8](4fb5da8))
* **nx-micronaut:**  add proxy support for project generation ([615c412](615c412))
* **nx-micronaut:** add `nx-micronaut` plugin ([08d6099](08d6099))
* **nx-micronaut:** add `skipFormat` to control code formatting ([bbc0df2](bbc0df2))
* **nx-micronaut:** add install executor + make build depend on it ([10ab5b7](10ab5b7))
* **nx-micronaut:** make `build` executor results cacheable ([d116760](d116760))
* **nx-micronaut:** rename executors to use `kebab-case` ([7bfc305](7bfc305))
* **nx-micronaut:** unselect by default adding code formatting support ([cb52710](cb52710))
* **nx-micronaut:** update JDK version from `16` -> `17` ([a0e81e1](a0e81e1)), closes [#135](#135)
* **nx-quarkus:**  add `format` executor ([89e6c4d](89e6c4d))
* **nx-quarkus:**  add proxy support for project generation ([eaefe9a](eaefe9a))
* **nx-quarkus:** add `format-check` executor to check code format ([d19f5ca](d19f5ca))
* **nx-quarkus:** add `link` generator to link projects implicitly ([2655b4f](2655b4f))
* **nx-quarkus:** add `skipFormat` to control code formatting ([197fe5e](197fe5e))
* **nx-quarkus:** add aliases for the format executor ([bcedf98](bcedf98))
* **nx-quarkus:** add install executor + make build depend on it ([a18a9aa](a18a9aa)), closes [#65](#65)
* **nx-quarkus:** add plugin to integrate `Quarkus` inside Nx workspace ([2f7c6c0](2f7c6c0))
* **nx-quarkus:** check if source is a valid quarkus project on linking ([dc97a41](dc97a41))
* **nx-quarkus:** improve  logging when project zip can't be fetched ([cb983f9](cb983f9))
* **nx-quarkus:** improve detection of quarkus projects in the workspace ([ee4731d](ee4731d))
* **nx-quarkus:** make `build` executor results cacheable ([6fb6a36](6fb6a36))
* **nx-quarkus:** rename executors to use `kebab-case` ([a8dd56c](a8dd56c))
* **nx-quarkus:** unselect by default adding code formatting support ([4892ad8](4892ad8))
* **nx-quarkus:** use `NX_VERBOSE_LOGGING` to control logs in dep graph ([5eaa639](5eaa639))
* **nx-spring-boot:**  add proxy support for project generation ([bd3ac7e](bd3ac7e)), closes [#125](#125)
* **nx-spring-boot:** add  java 16 support to align w/ Spring Initializr ([89c1d1e](89c1d1e))
* **nx-spring-boot:** add  java 17 support to align w/ Spring Initializr ([131df91](131df91))
* **nx-spring-boot:** add `application` schematics ([f22e63f](f22e63f))
* **nx-spring-boot:** add `clean` builder ([33a1435](33a1435))
* **nx-spring-boot:** add `format-check` executor to check code format ([337fca8](337fca8))
* **nx-spring-boot:** add `format` executor ([b5362ae](b5362ae))
* **nx-spring-boot:** add `ignoreWrapper` option to all builders ([e045bca](e045bca)), closes [#31](#31)
* **nx-spring-boot:** add `install` executor + make `build` depend on it ([68e1a5e](68e1a5e)), closes [#65](#65) [#66](#66) [#71](#71)
* **nx-spring-boot:** add `link` generator to link projects implicitly ([1142d04](1142d04))
* **nx-spring-boot:** add `serve` builder (alias to `run` builder) ([16dfdb4](16dfdb4)), closes [#8](#8)
* **nx-spring-boot:** add `skipFormat` to control code formatting ([8bff29b](8bff29b))
* **nx-spring-boot:** add `test` builder ([e257d27](e257d27)), closes [#30](#30)
* **nx-spring-boot:** add `User-Agent` header to requests to Initializr ([4c7f345](4c7f345)), closes [#11](#11)
* **nx-spring-boot:** add aliases for the format executor ([cbcee00](cbcee00))
* **nx-spring-boot:** add builders for run, buildJar/War, buildImage and buildInfo commands ([5c75781](5c75781))
* **nx-spring-boot:** add support for  `Kotlin DSL` when using `gradle` ([31063fe](31063fe))
* **nx-spring-boot:** add support for additional params for `buildJar` and `buildWar` builders ([b85ad9c](b85ad9c))
* **nx-spring-boot:** add support for additional params for `run` and `buildImage` builders ([1d9fbb3](1d9fbb3))
* **nx-spring-boot:** add support for Java 18 ([6dd94e1](6dd94e1))
* **nx-spring-boot:** add support for Nx's dependency graph generation ([95abe9d](95abe9d))
* **nx-spring-boot:** align Java versions with `Spring Initializr` ([1f6545d](1f6545d))
* **nx-spring-boot:** allow generating `application` or `library` ([530186c](530186c))
* **nx-spring-boot:** better determine the underlying  build system ([0edfe51](0edfe51))
* **nx-spring-boot:** check if source is a valid boot project on linking ([f74e524](f74e524))
* **nx-spring-boot:** improve detection of boot projects in  workspace ([bfb99ed](bfb99ed))
* **nx-spring-boot:** improve logging when project zip can't be fetched ([f1a5229](f1a5229))
* **nx-spring-boot:** make `build` executor results cacheable ([4528715](4528715))
* **nx-spring-boot:** make jar of `library` projects not executable ([1e2984f](1e2984f)), closes [#67](#67)
* **nx-spring-boot:** merge `buildJar` and `buildWar` executors ([9fdfec2](9fdfec2)), closes [#43](#43)
* **nx-spring-boot:** migrate to Nrwl's DevKit executors/generators API ([47231fd](47231fd))
* **nx-spring-boot:** rename executors to use `kebab-case` ([1e5d9f4](1e5d9f4)), closes [#117](#117)
* **nx-spring-boot:** rename the `application` generator into `project` ([05b5272](05b5272))
* **nx-spring-boot:** set `Java 17` as default version ([f41c555](f41c555))
* **nx-spring-boot:** unselect by default adding code formatting support ([005ad95](005ad95))
* **nx-spring-boot:** use `NX_VERBOSE_LOGGING` to control dep graph logs ([ed9e444](ed9e444)), closes [#68](#68)
* update to Nx workspace `v15.0.0` ([a0af206](a0af206)), closes [#138](#138)

### BREAKING CHANGES

* Nx `v15.x.x` is now the minimum required version to use the plugin
* **nx-flutter:** `interactive` option has been renamed into `skipAdditionalPrompts`

`interactive` is a reserved option for `nx generate` command, that gets deleted once Nx has interpreted it, so we need our own. Must still be combined with `--no-interactive` (from Nx), for fully non-interactivity
* **nx-micronaut:** `format-check` executor was renamed into `check-format` and `do-fomat` was removed
* **nx-quarkus:** `format-check` executor was renamed into `check-format` and `do-fomat` was removed
* **nx-spring-boot:** `format-check` executor was renamed into `check-format`
* **nx-flutter:** All executors of this plugin now use `kebab-case` over `camelCase` for consistency

This only affects `buildAar`, `buildApk`, `buildAppbundle`, `buildBundle`, `buildIos`, `buildIosFramework`, `buildIpa`, and `genL10n` executors, which have been renamed into `build-aar`, `build-apk`, `build-appbundle`, `build-bundle`, `build-ios`, `build-ios-framework`, `build-ipa`, and `gen-l10n` respectively.
* **nx-micronaut:** All executors of this plugin now use `kebab-case` over `camelCase` for consistency

This only affects `aotSampleConfig` executor, which has been renamed into `aot-sample-config`.
* **nx-quarkus:** All executors of this plugin now use `kebab-case` over `camelCase` for consistency

This only affects `remoteDev`, `addExtension` and `listExtensions` executors, which have been renamed into `remote-dev`, `add-extension`,  and `list-extensions` respectively.
* **nx-spring-boot:** All executors of this plugin now use `kebab-case` over `camelCase` for consistency

This only affect `buildImage` and `buildInfo` executors, which have been renamed into `build-image` and `build-info` respectively.
* **nx-spring-boot:** `build` is now the only executor to use to build the final jar or war
* Nx v12.6.x is now the minimum version required to use the plugins

This is due to breaking changes in DevKit's project graph API starting from v12.6.x
* **nx-flutter:** the `app` alias has been replaced with one of [`proj`, `new`, `gen`, `init`, `generate`].
* **nx-flutter:** Nx workspace v11 is now the minimum version required to use this plugin.

In fact, all builders/schematics have been rewritten into executors/generators using its new `@nrwl/devkit` API.
* **nx-spring-boot:** the `app` alias has been replaced with one of [`proj`, `new`, `gen`, `init`, `create`, `generate`].
* **nx-spring-boot:** Nx workspace v11 is now the minimum version required to use this plugin.

In fact, all builders/schematics have been rewritten into executors/generators using its new `@nrwl/devkit` API.

***
[skip ci]
github-actions bot pushed a commit that referenced this issue Oct 8, 2023
# 1.0.0 (2023-10-08)

### Bug Fixes

* add `{workspaceRoot}` prefix (from Nx `v15+`) to targets' `outputs` ([411b402](411b402))
* **common:** bump version of `@nxrocks/common` for Nx 16 support ([980a86f](980a86f)), closes [#169](#169)
* **common:** connections over Proxy not using correct `HTTP` protocol ([5cd3551](5cd3551)), closes [#158](#158)
* **common:** fix `Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close` ([fb5f797](fb5f797)), closes [#142](#142)
* **common:** fix bug when fetching dependencies of maven based projects ([2ada704](2ada704))
* **common:** fix dependency graph generation failure on `windows` OS ([26ef7c4](26ef7c4)), closes [#170](#170)
* **common:** fix deprecated usage of dependency graph API ([badf089](badf089))
* **common:** fix ProjectGraph for `Gradle` multi-module projects ([0ef0d17](0ef0d17))
* **common:** fix regex used to fetch gradle dependencies ([f1779a4](f1779a4))
* **common:** fix wrong groupId used for Spotless maven plugin ([3e4c613](3e4c613))
* **common:** ignore output when fetching package latest version from npm ([f426575](f426575))
* **common:** improve the checking/adding of a maven plugin  in `pom.xml` ([b8f59cf](b8f59cf))
* correct `TypeError: builder.getProjectGraph is not a function` ([3458f66](3458f66)), closes [#72](#72)
* enforce plugin `peerDependencies` on Nx `v15.0.0` and later ([4c220bb](4c220bb))
* fix executor output not restored when found in Nx cache ([fbb385a](fbb385a)), closes [#111](#111)
* fix installation issue due to `hpagent` not being found ([3620d23](3620d23)), closes [#128](#128)
* fix transitive `dependencies` from `@nxrocks/common` ([3594b1e](3594b1e)), closes [#131](#131)
* improve schemas of generators for a better UX in `Nx Console` ([0214736](0214736))
* loosen `peerDependencies` on `@nx/*` to support v16.0.0 AND higher ([fb2f8df](fb2f8df))
* **nx-spring-boot:** add `x-dropdown` to improve UX of `link` generator ([b056117](b056117))
* **nx-spring-boot:** add plugin to nx.json only if not included already ([15511ae](15511ae))
* **nx-spring-boot:** always restore executable permissions on wrappers ([b9875d8](b9875d8))
* **nx-spring-boot:** correct error when executing builders on Windows ([1a744ab](1a744ab)), closes [#38](#38)
* **nx-spring-boot:** correct generation issue on Nx workspaces >=v11.2.0 ([d3c3816](d3c3816)), closes [#37](#37)
* **nx-spring-boot:** correct wrong extension for `gradlew` on windows ([77899ce](77899ce))
* **nx-spring-boot:** fix `Premature close` error when generating project ([f6b433d](f6b433d)), closes [#97](#97)
* **nx-spring-boot:** fix `serve` and `apply-format` alias executors ([29f5183](29f5183))
* **nx-spring-boot:** fix creating spring boot libraries with `gradle` ([500a7d0](500a7d0))
* **nx-spring-boot:** fix error when generating a gradle/kotlin project ([abfbd04](abfbd04)), closes [#15](#15)
* **nx-spring-boot:** fix generation error when setting `javaVersion` ([364b228](364b228)), closes [#98](#98)
* **nx-spring-boot:** fix library projects should not be executable ([b118a4e](b118a4e)), closes [#113](#113)
* **nx-spring-boot:** fix prompts not working generating the application ([b96e1ce](b96e1ce)), closes [#6](#6)
* **nx-spring-boot:** fix wrong 'cwd' used to execute builders commands ([b39e7e7](b39e7e7))
* **nx-spring-boot:** make builders executable platform independant ([b27bc4c](b27bc4c))
* **nx-spring-boot:** remove `ratchetFrom` from the default Spotless conf ([1462022](1462022))
* **nx-spring-boot:** remove extra char in `dependencies` prompt ([5bc0290](5bc0290))
* **nx-spring-boot:** set correct path for executors ([89e16d3](89e16d3))
* **nx-spring-boot:** some user options were not used during generation ([6813e7d](6813e7d)), closes [#17](#17)
* plugins include spec files in distributed pkg ([21bac53](21bac53))
* set `@nrwl/*` packages as `peerDependencies` ([d03b709](d03b709)), closes [#106](#106)

### Features

* **common-cli:** add `common-cli` to share code among our `create-*` CLI packages ([bcb5fd2](bcb5fd2))
* **common:** add `addMavenProperty` helper and improve `xpath` matching ([9f89c08](9f89c08))
* **common:** add `MavenDependency` model ([5ab8c1d](5ab8c1d))
* **common:** add a utility to disable a gradle plugin ([171ad81](171ad81))
* **common:** add a utility to remove a maven plugin from the `pom.xml` ([8c13087](8c13087))
* **common:** add helper to get project root directory ([adbc8a9](adbc8a9))
* **common:** add support for `nx-micronaut` plugin ([b72cdaf](b72cdaf))
* **common:** add utilities for multi-module `maven`/`gradle` projects ([f2e4939](f2e4939))
* **common:** add utilities to add `maven`/`gradle` modules ([2237201](2237201))
* **common:** add utility method to get http[s] proxy agent ([da61925](da61925))
* **common:** add utility to check the presence of a plugin in `pom.xml` ([bfec05f](bfec05f))
* **common:** add utility to unzip a zip stream ([a472c00](a472c00))
* **common:** add xml utilities to remove or check if a node is empty ([d07b827](d07b827))
* **common:** allow using legacy wrappers (i.e `.bat`, for maven mostly) ([7a13720](7a13720))
* **common:** increase the `maxBuffer` when running executors commands ([4bc388d](4bc388d))
* **common:** make the `version` optional when adding a gradle plugin ([bd3a182](bd3a182))
* **common:** move `octal` function into e2e testing utils ([b15a616](b15a616))
* **common:** update Spotless gradle plugin from `6.2.2` --> `6.8.0` ([8c76d3b](8c76d3b))
* **common:** update Spotless maven plugin from `2.20.2` --> `2.23.0` ([ab182ef](ab182ef))
* **create-nx-spring-boot:** add custom CLI to create Spring Boot projects ([32ca53c](32ca53c))
* **nx-flutter:** add nx-flutter plugin ([e7426e9](e7426e9))
* **nx-flutter:** add support for Nx 's dependency graph generation ([6fb58de](6fb58de)), closes [#28](#28)
* **nx-flutter:** auto-adapt prompt & builders based on previous answers ([668dd28](668dd28)), closes [#26](#26)
* **nx-flutter:** migrate to Nrwl's DevKit executors/generators API ([8c72ed5](8c72ed5))
* **nx-ktor:** add `nx-ktor` plugin ([cb74a79](cb74a79))
* **nx-melos:** add `nx-melos` plugin ([4fb5da8](4fb5da8))
* **nx-micronaut:** add `nx-micronaut` plugin ([08d6099](08d6099))
* **nx-quarkus:** add plugin to integrate `Quarkus` inside Nx workspace ([2f7c6c0](2f7c6c0))
* **nx-spring-boot:**  add proxy support for project generation ([bd3ac7e](bd3ac7e)), closes [#125](#125)
* **nx-spring-boot:** add  java 16 support to align w/ Spring Initializr ([89c1d1e](89c1d1e))
* **nx-spring-boot:** add  java 17 support to align w/ Spring Initializr ([131df91](131df91))
* **nx-spring-boot:** add `application` schematics ([f22e63f](f22e63f))
* **nx-spring-boot:** add `build-image` and `test` to cached outputs ([1cc3a71](1cc3a71))
* **nx-spring-boot:** add `clean` builder ([33a1435](33a1435))
* **nx-spring-boot:** add `format-check` executor to check code format ([337fca8](337fca8))
* **nx-spring-boot:** add `format` executor ([b5362ae](b5362ae))
* **nx-spring-boot:** add `ignoreWrapper` option to all builders ([e045bca](e045bca)), closes [#31](#31)
* **nx-spring-boot:** add `install` executor + make `build` depend on it ([68e1a5e](68e1a5e)), closes [#65](#65) [#66](#66) [#71](#71)
* **nx-spring-boot:** add `link` generator to link projects implicitly ([1142d04](1142d04))
* **nx-spring-boot:** add `serve` builder (alias to `run` builder) ([16dfdb4](16dfdb4)), closes [#8](#8)
* **nx-spring-boot:** add `skipFormat` to control code formatting ([8bff29b](8bff29b))
* **nx-spring-boot:** add `test` builder ([e257d27](e257d27)), closes [#30](#30)
* **nx-spring-boot:** add `User-Agent` header to requests to Initializr ([4c7f345](4c7f345)), closes [#11](#11)
* **nx-spring-boot:** add aliases for the format executor ([cbcee00](cbcee00))
* **nx-spring-boot:** add builders for run, buildJar/War, buildImage and buildInfo commands ([5c75781](5c75781))
* **nx-spring-boot:** add dynamic prompt to fetch boot dependencies list ([6d9f3e4](6d9f3e4))
* **nx-spring-boot:** add support for  `Kotlin DSL` when using `gradle` ([31063fe](31063fe))
* **nx-spring-boot:** add support for additional params for `buildJar` and `buildWar` builders ([b85ad9c](b85ad9c))
* **nx-spring-boot:** add support for additional params for `run` and `buildImage` builders ([1d9fbb3](1d9fbb3))
* **nx-spring-boot:** add support for creating multi-modules projects ([7c2de5a](7c2de5a))
* **nx-spring-boot:** add support for Java 18 ([6dd94e1](6dd94e1))
* **nx-spring-boot:** add support for Java 21 ([ba566e9](ba566e9))
* **nx-spring-boot:** add support for Nx's dependency graph generation ([95abe9d](95abe9d))
* **nx-spring-boot:** align Java versions with `Spring Initializr` ([1f6545d](1f6545d))
* **nx-spring-boot:** allow generating `application` or `library` ([530186c](530186c))
* **nx-spring-boot:** better determine the underlying  build system ([0edfe51](0edfe51))
* **nx-spring-boot:** check if source is a valid boot project on linking ([f74e524](f74e524))
* **nx-spring-boot:** improve detection of boot projects in  workspace ([bfb99ed](bfb99ed))
* **nx-spring-boot:** improve logging when cannot generate project ([3cc8eb6](3cc8eb6))
* **nx-spring-boot:** improve logging when project zip can't be fetched ([f1a5229](f1a5229))
* **nx-spring-boot:** make `build` executor results cacheable ([4528715](4528715))
* **nx-spring-boot:** make jar of `library` projects not executable ([1e2984f](1e2984f)), closes [#67](#67)
* **nx-spring-boot:** merge `buildJar` and `buildWar` executors ([9fdfec2](9fdfec2)), closes [#43](#43)
* **nx-spring-boot:** migrate to Nrwl's DevKit executors/generators API ([47231fd](47231fd))
* **nx-spring-boot:** rename executors to use `kebab-case` ([1e5d9f4](1e5d9f4)), closes [#117](#117)
* **nx-spring-boot:** rename the `application` generator into `project` ([05b5272](05b5272))
* **nx-spring-boot:** set `Java 17` as default version ([f41c555](f41c555))
* **nx-spring-boot:** unselect by default adding code formatting support ([005ad95](005ad95))
* **nx-spring-boot:** use `NX_VERBOSE_LOGGING` to control dep graph logs ([ed9e444](ed9e444)), closes [#68](#68)
* update dependencies and fix lint issues ([cfac383](cfac383))
* update to Nx workspace `v15.0.0` ([a0af206](a0af206)), closes [#138](#138)
* update to Nx workspace `v16.0.0` ([ab11ea8](ab11ea8))

### BREAKING CHANGES

* Nx `v16.x.x` is now the minimum required version to use the plugin
* **nx-spring-boot:** Nx `v15.8.x` is now the minimum required version to run the plugin

We now leverage Nx's new `NX_INTERACTIVE` environment variable to check whether we are running in interactive mode (normal cli) or not.
When true, we automatically fetch `Spring Boot` dependencies and present them in an **autocomplete** prompt with **multi-select** support,
so you can easily select which ones you want to include in your project.
* Nx `v15.x.x` is now the minimum required version to use the plugin
* **nx-spring-boot:** `format-check` executor was renamed into `check-format`
* **nx-spring-boot:** All executors of this plugin now use `kebab-case` over `camelCase` for consistency

This only affect `buildImage` and `buildInfo` executors, which have been renamed into `build-image` and `build-info` respectively.
* **nx-spring-boot:** `build` is now the only executor to use to build the final jar or war
* Nx v12.6.x is now the minimum version required to use the plugins

This is due to breaking changes in DevKit's project graph API starting from v12.6.x
* **nx-flutter:** Nx workspace v11 is now the minimum version required to use this plugin.

In fact, all builders/schematics have been rewritten into executors/generators using its new `@nrwl/devkit` API.
* **nx-spring-boot:** the `app` alias has been replaced with one of [`proj`, `new`, `gen`, `init`, `create`, `generate`].
* **nx-spring-boot:** Nx workspace v11 is now the minimum version required to use this plugin.

In fact, all builders/schematics have been rewritten into executors/generators using its new `@nrwl/devkit` API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants