Expand my Community achievements bar.

SOLVED

front end maven plugin "npm install" issue

Avatar

Level 3

OS:
NAME="Ubuntu"
VERSION="16.04.6 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.6 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

Node : 10.13.0

npm: 6.9.0
85816999-a055c200-b721-11ea-8e82-f306c01fef22.png

 

 

Issue: when running "mvn clean install" or "npm install"

can some one shed some light or idea how to go about this issue?
I have front end maven plugin as part of my AEM maven project and project would not build with above issue.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@ramaem12 - I had a similar issue recently. We were working on generating dispatcher files via NodeJS scripts using com.github.eirslett.

We added the below execution goals in the plugin to do the following - 

  • Install Node.Js and npm
  • Trigger npm install to generate resources
  • Trigger npm run to run-script build

Please check the pom.xml as below - 

<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.11.3</version>
<configuration>
<installDirectory>${project.basedir}/.generator</installDirectory>
</configuration>
<executions>
<execution>
<id>Install Node.js and npm</id>
<phase>generate-resources</phase>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<workingDirectory>${project.basedir}/.generator</workingDirectory>
</configuration>
</execution>
<execution>
<id>npm install</id>
<phase>generate-resources</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<workingDirectory>${project.basedir}/.generator</workingDirectory>
</configuration>
</execution>
<execution>
<id>npm run</id>
<phase>generate-resources</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<workingDirectory>${project.basedir}/.generator</workingDirectory>
<arguments>run-script build</arguments>
</configuration>
</execution>
</executions>
</plugin>

View solution in original post

4 Replies

Avatar

Employee Advisor

Unfortunately it isn't clear from the screenshot what is causing the problem. The stacktrace should have some "caused by" statements as well. Also it would help if you can share the complete output of the maven build of the frontend module.

Avatar

Level 3
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.7.6:install-node-and-npm (install node and npm) on project aem-guides-wknd.ui.frontend: Could not download Node.js: Could not download https://nodejs.org/dist/v10.13.0/node-v10.13.0-linux-x64.tar.gz: Connection reset -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.7.6:install-node-and-npm (install node and npm) on project aem-guides-wknd.ui.frontend: Could not download Node.js: Could not download https://nodejs.org/dist/v10.13.0/node-v10.13.0-linux-x64.tar.gz
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: Could not download Node.js: Could not download https://nodejs.org/dist/v10.13.0/node-v10.13.0-linux-x64.tar.gz
        at com.github.eirslett.maven.plugins.frontend.mojo.MojoUtils.toMojoFailureException(MojoUtils.java:28)
        at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute(AbstractFrontendMojo.java:103)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 20 more
Caused by: com.github.eirslett.maven.plugins.frontend.lib.InstallationException: Could not download Node.js
        at com.github.eirslett.maven.plugins.frontend.lib.NodeInstaller.installNodeDefault(NodeInstaller.java:209)
        at com.github.eirslett.maven.plugins.frontend.lib.NodeInstaller.install(NodeInstaller.java:97)
        at com.github.eirslett.maven.plugins.frontend.mojo.InstallNodeAndNpmMojo.execute(InstallNodeAndNpmMojo.java:101)
        at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute(AbstractFrontendMojo.java:94)
        ... 22 more
Caused by: com.github.eirslett.maven.plugins.frontend.lib.DownloadException: Could not download https://nodejs.org/dist/v10.13.0/node-v10.13.0-linux-x64.tar.gz
        at com.github.eirslett.maven.plugins.frontend.lib.DefaultFileDownloader.download(FileDownloader.java:81)
        at com.github.eirslett.maven.plugins.frontend.lib.NodeInstaller.downloadFile(NodeInstaller.java:339)
        at com.github.eirslett.maven.plugins.frontend.lib.NodeInstaller.downloadFileIfMissing(NodeInstaller.java:332)
        at com.github.eirslett.maven.plugins.frontend.lib.NodeInstaller.installNodeDefault(NodeInstaller.java:142)
        ... 25 more
Caused by: java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java:210)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
        at sun.security.ssl.InputRecord.read(InputRecord.java:503)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:990)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1388)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1416)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1400)
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
        at com.github.eirslett.maven.plugins.frontend.lib.DefaultFileDownloader.execute(FileDownloader.java:105)
        at com.github.eirslett.maven.plugins.frontend.lib.DefaultFileDownloader.download(FileDownloader.java:69)
        ... 28 more

 

Avatar

Correct answer by
Community Advisor

@ramaem12 - I had a similar issue recently. We were working on generating dispatcher files via NodeJS scripts using com.github.eirslett.

We added the below execution goals in the plugin to do the following - 

  • Install Node.Js and npm
  • Trigger npm install to generate resources
  • Trigger npm run to run-script build

Please check the pom.xml as below - 

<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.11.3</version>
<configuration>
<installDirectory>${project.basedir}/.generator</installDirectory>
</configuration>
<executions>
<execution>
<id>Install Node.js and npm</id>
<phase>generate-resources</phase>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<workingDirectory>${project.basedir}/.generator</workingDirectory>
</configuration>
</execution>
<execution>
<id>npm install</id>
<phase>generate-resources</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<workingDirectory>${project.basedir}/.generator</workingDirectory>
</configuration>
</execution>
<execution>
<id>npm run</id>
<phase>generate-resources</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<workingDirectory>${project.basedir}/.generator</workingDirectory>
<arguments>run-script build</arguments>
</configuration>
</execution>
</executions>
</plugin>