node-gradle / node-gradle/gradle-node-plugin

How to correctly configure multi project builds for spring boot?

Open
#218 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Groovy
Stars
677
Forks
120
PR merge metrics
No merged PRs in 30d

Description

Thanks for this plugin and for your example shown in https://github.com/node-gradle/gradle-node-plugin/tree/master/examples/spring-boot-angular.

While my current setup already triggers some npm tasks and compiles without any problem, localhost:8080 still shows some json with my spring repositories/ data structures instead of the angular app. The only way to use my angular app is ng serve on localhost:4200 and annotate @CrossOrigin(origins = "http://localhost:4200") in the controllers.

May I ask some questions regarding this problem / related to your example:

  • Is it really correct to have the spring application on the root level while the webapp is a subproject? From the gradle documentation (https://docs.gradle.org/current/userguide/multi_project_builds.html), I actually expected a more parallel structure without any src folder on the root level and rather two subprojects spring and webapp in parallel. In case both structures are possible, how do I configure the gradle-node-plugin to handle this parallel structure?
  • Is gradle-node-plugin actually intended to also support local development of an angular app, i.e. are angular sources updated automatically under localhost:8080 just as I am used to it with ng serve under localhost:4200? If that is possible, I could actually remove the @CrossOrigin(origins = "http://localhost:4200") annotation in my controllers, right?

Any help is much appreciated, thanks in advance!

PS: I think part of the problem might be that in a parallel setup (spring and webapp as subprojects, no src folder on root level), webapp has it's own build-folder and hence the static resources are not copied into the output of spring???

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the examples/spring-boot-angular example and compare its root-level Spring application and webapp subproject with the proposed parallel spring and webapp structure. Check how the plugin handles the webapp build output and whether localhost:8080 can provide Angular development behavior; done means the supported configuration and development workflow are clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, nodejs, spring-boot
Domain
build-system, web-dev
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.