0

I have a complete angular7 project and want to integrate with java. is there any way to do it?

I am using eclipse maven + ibm websphere. (not spring boot)

I referred this post(by @TimeTraveler) and tried to follow... however when I run command mvn clean package, I encounter this error

[INFO] --- frontend-maven-plugin:1.0:npm (npm install) @ angular7test ---
[INFO] Running 'npm install' in C:\Users\eclipse-workspace\angular7test\angular-project
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:01 min
[INFO] Finished at: 2018-11-29T23:16:03+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.0:npm (npm install) on project angular7test: Failed to run task: 'npm install' failed. java.io.IOException: Cannot run program "C:\Users\eclipse-workspace\angular7test\node_installation\node\node.exe" (in directory "C:\Users\eclipse-workspace\angular7test\angular-project"): CreateProcess error=267, The directory name is invalid -> [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/MojoFailureException

and I also have a question .. based on that post, maven project looks like below

  • Maven Project -
  • src
    • main
    • java
    • resources
    • webapp
      • WEB-INF
      • web.xml
  • angular-project (I paste my angular project here)
  • node_installation ========>what is this?????
  • pom.xml

what is node_installation? .. is that a folder? do i need to create?

this is my package.. enter image description here

Energy
  • 940
  • 13
  • 20
  • What about that answer is unclear to you? And what errors are you getting? There really isn't a difference between Angular 2+ versions when it comes to deploying them in a war, as far as I know... – lwestby Nov 28 '18 at 15:13
  • @lwestby hi, Please check my update.. – Energy Nov 29 '18 at 15:25

1 Answers1

1

The error you posted indicates that Maven can't find the node.js executable node.exe in order to build your Angular project. Make sure you configure your pom as indicated on the frontend-maven-plugin readme page so that it will install node and npm into your project dir where maven expects to find it. This will create the node_installation directory you are missing and populate it with the node.exe executable, which should resolve the error.

lwestby
  • 1,209
  • 6
  • 10
  • thanks.. i resolved posted error. however i encounter new one... which is [l (npm build) on project angular7test: Failed to run task: 'npm run build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error:] do you have any idea on this...? – Energy Dec 01 '18 at 05:18
  • Sounds like npm itself failed. Scroll up in your logs a bit and look for other errors coming directly from npm – lwestby Dec 01 '18 at 17:17