You may not find any example of using frontend-maven-plugin in Gradle, as it is dedicated to Maven. But you can take a look at the Siouan Frontend Gradle plugin , which is the equivalent solution for Gradle and allows (from the official site):
Integrate your NPM / Yarn frontend with Gradle.
Usage and configuration seem close to your Maven configuration. Define the version of Node / NPM / Yarn in the build.gradle file, link the scripts you want to run, depending on the Gradle life cycle task (clean / build / check) and thatβs it. The following is a typical example of using Gradle 5.4 with NPM, taken from the documentation:
// build.gradle plugins { id 'org.siouan.frontend' version '1.1.0' } frontend { nodeVersion = '10.15.3' // See 'scripts' section in your 'package.json file' cleanScript = 'run clean' assembleScript = 'run assemble' checkScript = 'run check' }
You will notice:
- Unlike
frontend-maven-plugin there is no declaration / configuration for starting the frontend assembly with Gradle, since it is already provided out of the box. Downloading, installing Node / NPM / Yarn does not require a declaration / configuration - except for version numbers, as well as build tasks. Just provide the NPM / Yarn command line to clean / build / test your interface. - The maximum supported version of Node should be
6.2.1 . Thus, your initial configuration from 4.2.4 will require node migration. - The plugin does not support Bower, and I do not think it will be supported in the future, since Bower now encourages migration to Yarn. You will find the migration guide on the Bower website.
- The plugin does not support the use of a specific NPM release. NPM now ships with Node; the plugin uses the version built into the downloaded Node distribution.
Yours faithfully
user8058386
source share