For context, I'm running a jenkins build which has no direct internet access. We have a nexus with proxy repositories for maven, nodejs and npm.
I'm using the recommended frontend-maven-plugin to download and install node and npm. This step works fine. Afterwards the vaadin-maven-plugin is used with the prepare-frontend and build-frontend goals.
Apparently, this triggers the actual npm install so I need it to contact the private npm registry, yet I can't find any setting to specify this. I did find a npmRegistryURL variable in the vaadin-maven-plugin configuration, but apparently this isn't used for the build-frontend goal.
My pom setup looks like this:
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
</execution>
</executions>
<configuration>
<nodeVersion>v12.13.0</nodeVersion>
<nodeDownloadRoot>https://nexusrepo.com/repository/nodejs/</nodeDownloadRoot>
<npmDownloadRoot>https://nexusrepo.com/repository/npmjs/</npmDownloadRoot>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<executions>
<execution>
<id>prep</id>
<goals>
<goal>prepare-frontend</goal>
<goal>build-frontend</goal>
</goals>
</execution>
</executions>
<configuration>
<npmRegistryURL>https://nexusrepo.com/repository/npmjs/</npmRegistryURL>
</configuration>
</plugin>
</plugins>
</build>
I've also tried to let the frontend-maven-plugin handle the npm install but that doesn't work because the vaadin-maven-plugin is manually adding extras to the node_modules/@vaadin folder.
So I got the same Error: Cannot find module '@vaadin/stats-plugin' as specified in Vaadin issue 10306
I've also tried to add a .npmrc file to the root of my project to specify the npm registry, but that had no effect. Should this work or is it simply not checked by the vaadin-maven-plugin?
Some help would be greatly appreciated. I can't manually configure the node installation by using npm config set registry because it's not a static node installation, so the configuration needs to happen inside of the actual maven build.