cancel
Showing results for 
Search instead for 
Did you mean: 

MVN clean install failed during InstallCdsdkMojo Installation

idefix
Participant
0 Kudos
2,076

I cloned fresh git repository and tried to mvn clean install the cloud cap sample project:

https://github.com/SAP-samples/cloud-cap-samples-java

It failed. I got an error:

[ERROR] Failed to execute goal com.sap.cds:cds-maven-plugin:1.12.1:install-cdsdk (install-cdsdk) on project bookshop: Process exited with an error: 137 (Exit value: 137) -> [Help 1]
[ERROR] 
[ERROR] InstallCdsdkMojo: 
[ERROR] InstallCdsdkMojo: 
[ERROR] 
org.apache.commons.exec.ExecuteException: Process exited with an error: 137 (Exit value: 137)

Could you tell me what is wrong?

My Machine:

╰─➤  java --version                                                                                                                                 1 ↵
openjdk 11.0.10 2021-01-19 LTS
OpenJDK Runtime Environment SapMachine (build 11.0.10+9-LTS-sapmachine)
OpenJDK 64-Bit Server VM SapMachine (build 11.0.10+9-LTS-sapmachine, mixed mode)

╰─➤  node --version
v10.23.0

╰─➤  cds --version
@sap/cds: 4.3.0
@sap/cds-compiler: 1.45.0
@sap/cds-dk: 3.2.0
@sap/cds-foss: 2.2.0
@sap/cds-reflect: 2.13.3
@sap/cds-runtime: 2.6.0
Node.js: v10.23.0
bookshop-java: 1.0.0
home: /Users/myuser/.nvm/versions/node/v10.23.0/lib/node_modules/@sap/cds-dk/node_modules/@sap/cds
╰─➤  mvn -v                                                                                                                                       127 ↵
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
Java version: 15.0.1, vendor: N/A, runtime: /usr/local/Cellar/openjdk/15.0.1/libexec/openjdk.jdk/Contents/Home
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "11.1", arch: "x86_64", family: "mac"

Full error:

INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (Project Structure Checks) @ bookshop ---
[INFO] 
[INFO] --- cds-maven-plugin:1.12.1:install-node (cds.install-node) @ bookshop ---
[INFO] InstallNodeMojo: Node.js v12.16.2 already installed.
[WARNING] InstallNodeMojo: Executable /Users/myuser/.m2/repository/com/sap/cds/cds-maven-plugin/cache/unpacked/12.16.2/unpacked-12.16.2-darwin-x64.tar.gz/node-v12.16.2-darwin-x64/bin/npm not found in Node.js installation.
[WARNING] InstallNodeMojo: Executable /Users/myuser/.m2/repository/com/sap/cds/cds-maven-plugin/cache/unpacked/12.16.2/unpacked-12.16.2-darwin-x64.tar.gz/node-v12.16.2-darwin-x64/bin/npx not found in Node.js installation.
[INFO] 
[INFO] --- cds-maven-plugin:1.12.1:install-cdsdk (install-cdsdk) @ bookshop ---
[INFO] InstallCdsdkMojo: Using directory containing a .cdsrc.json as working directory: /Users/myuser/cds_tutorial/cloud-cap-samples-java
[INFO] InstallCdsdkMojo: Installing @sap/cds-dk@latest into: /Users/myuser/cds_tutorial/cloud-cap-samples-java
[INFO] InstallCdsdkMojo: Searching npm on local file-system.
[INFO] InstallCdsdkMojo: Found /Users/myuser/.nvm/versions/node/v10.23.0/bin/npm
[INFO] InstallCdsdkMojo: Executing [/Users/myuser/.nvm/versions/node/v10.23.0/bin/npm, install, @sap/cds-dk@latest, --no-save] in working directory /Users/myuser/cds_tutorial/cloud-cap-samples-java
[ERROR] InstallCdsdkMojo: 
[ERROR] InstallCdsdkMojo: 
[ERROR] 
org.apache.commons.exec.ExecuteException: Process exited with an error: 137 (Exit value: 137)
    at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
    at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
    at com.sap.cds.maven.plugin.util.ProcessExecutor.execute (ProcessExecutor.java:83)
    at com.sap.cds.maven.plugin.build.AbstractNodejsMojo.execute (AbstractNodejsMojo.java:89)
    at com.sap.cds.maven.plugin.build.AbstractNpmMojo.executeNpm (AbstractNpmMojo.java:46)
    at com.sap.cds.maven.plugin.build.AbstractNpmMojo.executeNpm (AbstractNpmMojo.java:52)
    at com.sap.cds.maven.plugin.build.InstallCdsdkMojo.install (InstallCdsdkMojo.java:95)
    at com.sap.cds.maven.plugin.build.InstallCdsdkMojo.installIfMissing (InstallCdsdkMojo.java:108)
    at com.sap.cds.maven.plugin.build.InstallCdsdkMojo.execute (InstallCdsdkMojo.java:70)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for bookshop parent 1.0.0-SNAPSHOT:
[INFO] 
[INFO] bookshop parent .................................... SUCCESS [  0.572 s]
[INFO] bookshop ........................................... FAILURE [  0.389 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.092 s
[INFO] Finished at: 2021-01-28T22:43:11+07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.sap.cds:cds-maven-plugin:1.12.1:install-cdsdk (install-cdsdk) on project bookshop: Process exited with an error: 137 (Exit value: 137) -> [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/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :bookshop
View Entire Topic

Hi Edwin,

according the logs you have provided, there is an issue with the Node.js installation:

[INFO] InstallNodeMojo:Node.js v12.16.2 already installed.[WARNING] InstallNodeMojo: Executable /Users/myuser/.m2/repository/com/sap/cds/cds-maven-plugin/cache/unpacked/12.16.2/unpacked-12.16.2-darwin-x64.tar.gz/node-v12.16.2-darwin-x64/bin/npm notfoundinNode.js installation.[WARNING] InstallNodeMojo: Executable /Users/myuser/.m2/repository/com/sap/cds/cds-maven-plugin/cache/unpacked/12.16.2/unpacked-12.16.2-darwin-x64.tar.gz/node-v12.16.2-darwin-x64/bin/npx notfoundinNode.js installation.

It looks like the Node.js installation is not complete and the commands npm and npx are missing.

Please check, if in the Node.js installation directory /Users/myuser/.m2/repository/com/sap/cds/cds-maven-plugin/cache/unpacked/12.16.2/unpacked-12.16.2-darwin-x64.tar.gz/node-v12.16.2-darwin-x64/bin/

all tools (node, npm, npx) are existing. Also check if the execution flags are set on these executables.

If the Node.js installation is not complete you can force a new installation with the following maven command executed in folder /srv:

mvn cds:install-node -Dforce=true

For further details about the cds-maven-plugin have a look at the documentation: https://cap.cloud.sap/docs/assets/cds-maven-plugin-site/install-node-mojo.html

Regards,

Markus

idefix
Participant

Thank you Markus! Now I remember, I did ctrl-c during the cdsdk Installation, because it took long time (perhaps stucked). Your explanation helps me to understand the issue!

It works:

mvn com.sap.cds:cds-maven-plugin:install-node -Dforce=true

Thank you!