Building only with Maven repository mirror

Up to Vaadin 13, it was possible to build projects without additional tools (especially without “out-of-band” downloads"). With Vaadin 14, the vaadin-maven-plugin needs additional tools installed or downloaded them from the Internet (node, yarn). Behind an authenticating proxy with a local Maven mirror as only source for 3rd party components, this is at least annoying. There may be workarounds like a proxy authentication service, local installation of tools etc. However, all developers participating in a project then need some special setup for performing local builds, and the CI infrastructure needs to be extended (e.g. npm / node.js / yarn installed on a Jenkins server).

Is there a way to build a Vaadin 14 application without additional tools, i.e. only using a Maven mirror for retrieving stuff from outside?

Thanks & Regards
Jochen

Hi,

Vaadin 14 combines the Java ecosystem with the JavaScript ecosystem. To accomplish this in a sensible way, commonly used tools from both systems are used.

For the Java part, you need a JDK and Maven.
For the JavaScript part, you need Node (which includes npm).

Java dependencies are downloaded from Maven central, like you would expect from a Java project. To deal with this in an offline/restricted environment you can have a Maven proxy.

JavaScript dependencies are downloaded using npm from npmjs.com, like you would expect from a JavaScript project. To deal with this in an offline/restricted environment you can have an npm proxy.

I think e.g. Nexus offers both a Maven and an npm proxy in the same package.

If you have a system where the dependencies (JDK, Maven, Node) are not available, you need to install them.

  1. You must install a JDK manually as everything is based on Java.
  2. If you want to download Maven automatically, you can add the Maven Wrapper (https://github.com/takari/maven-wrapper) to the project. It will download Maven if it is not yet available on the system. Remember to build using mvnw
  3. If you want to download Node automatically, you can add the frontend-maven-plugin (https://github.com/eirslett/frontend-maven-plugin) to your project. It will download Node if it is not yet available on the system.

Thanks, Artur!

We have an Artifactory server mirroring external Maven repositories, and it can also mirror the npm registry. This part works.

I’ll try the frontend-maven-plugin. Better than installing more and more tools on Jenkins, especially since node versions seem to change now and then. I assume that I have to add some .npmrc file to the root of my project to specify the mirror.

Regards
Jochen