Class BuildFrontendMojo

  • All Implemented Interfaces:
    com.vaadin.flow.plugin.base.PluginAdapterBase, com.vaadin.flow.plugin.base.PluginAdapterBuild, org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="build-frontend",
          requiresDependencyResolution=COMPILE_PLUS_RUNTIME,
          defaultPhase=PROCESS_CLASSES)
    public class BuildFrontendMojo
    extends FlowModeAbstractMojo
    implements com.vaadin.flow.plugin.base.PluginAdapterBuild
    Goal that builds the frontend bundle. It performs the following actions when creating a package:
    • Update Constants.PACKAGE_JSON file with the NpmPackage annotations defined in the classpath,
    • Copy resource files used by flow from `.jar` files to the `node_modules` folder
    • Install dependencies by running npm install
    • Update the FrontendUtils.IMPORTS_NAME file imports with the JsModule Theme and JavaScript annotations defined in the classpath,
    • Update FrontendUtils.WEBPACK_CONFIG file.
    Since:
    2.0
    • Constructor Detail

      • BuildFrontendMojo

        public BuildFrontendMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Specified by:
        execute in interface org.apache.maven.plugin.Mojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • frontendResourcesDirectory

        public File frontendResourcesDirectory()
        Specified by:
        frontendResourcesDirectory in interface com.vaadin.flow.plugin.base.PluginAdapterBuild
      • generateBundle

        public boolean generateBundle()
        Specified by:
        generateBundle in interface com.vaadin.flow.plugin.base.PluginAdapterBuild
      • generateEmbeddableWebComponents

        public boolean generateEmbeddableWebComponents()
        Specified by:
        generateEmbeddableWebComponents in interface com.vaadin.flow.plugin.base.PluginAdapterBuild
      • optimizeBundle

        public boolean optimizeBundle()
        Specified by:
        optimizeBundle in interface com.vaadin.flow.plugin.base.PluginAdapterBuild
      • runNpmInstall

        public boolean runNpmInstall()
        Specified by:
        runNpmInstall in interface com.vaadin.flow.plugin.base.PluginAdapterBuild
      • ciBuild

        public boolean ciBuild()
        Specified by:
        ciBuild in interface com.vaadin.flow.plugin.base.PluginAdapterBuild