Class BuildDevBundleMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.vaadin.flow.plugin.maven.BuildDevBundleMojo
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-dev-bundle", requiresDependencyResolution=COMPILE_PLUS_RUNTIME, defaultPhase=PROCESS_CLASSES) public class BuildDevBundleMojo extends org.apache.maven.plugin.AbstractMojo implements com.vaadin.flow.plugin.base.PluginAdapterBuild, com.vaadin.flow.plugin.base.PluginAdapterBase
Goal that builds the dev frontend bundle to be used in Express Build mode. 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.VITE_CONFIG file.
Since:
2.0
  • Field Details

    • INCLUDE_FROM_COMPILE_DEPS_REGEX

      public static final String INCLUDE_FROM_COMPILE_DEPS_REGEX
      Additionally include compile-time-only dependencies matching the pattern.
      See Also:
  • Constructor Details

    • BuildDevBundleMojo

      public BuildDevBundleMojo()
  • Method Details

    • 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
    • executeInternal

      public void executeInternal() throws org.apache.maven.plugin.MojoFailureException
      Throws:
      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
    • forceProductionBuild

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

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

      public File applicationProperties()
      Specified by:
      applicationProperties in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • eagerServerLoad

      public boolean eagerServerLoad()
      Specified by:
      eagerServerLoad in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • frontendDirectory

      public File frontendDirectory()
      Specified by:
      frontendDirectory in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • generatedTsFolder

      public File generatedTsFolder()
      Specified by:
      generatedTsFolder in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • getClassFinder

      public com.vaadin.flow.server.frontend.scanner.ClassFinder getClassFinder()
      Specified by:
      getClassFinder in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • getJarFiles

      public Set<File> getJarFiles()
      Specified by:
      getJarFiles in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • isDebugEnabled

      public boolean isDebugEnabled()
      Specified by:
      isDebugEnabled in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • javaSourceFolder

      public File javaSourceFolder()
      Specified by:
      javaSourceFolder in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • javaResourceFolder

      public File javaResourceFolder()
      Specified by:
      javaResourceFolder in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • logDebug

      public void logDebug(CharSequence debugMessage)
      Specified by:
      logDebug in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • logDebug

      public void logDebug(CharSequence debugMessage, Throwable e)
      Specified by:
      logDebug in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • logInfo

      public void logInfo(CharSequence infoMessage)
      Specified by:
      logInfo in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • logWarn

      public void logWarn(CharSequence warning)
      Specified by:
      logWarn in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • logError

      public void logError(CharSequence error)
      Specified by:
      logError in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • logWarn

      public void logWarn(CharSequence warning, Throwable e)
      Specified by:
      logWarn in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • logError

      public void logError(CharSequence error, Throwable e)
      Specified by:
      logError in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • nodeDownloadRoot

      public URI nodeDownloadRoot() throws URISyntaxException
      Specified by:
      nodeDownloadRoot in interface com.vaadin.flow.plugin.base.PluginAdapterBase
      Throws:
      URISyntaxException
    • nodeAutoUpdate

      public boolean nodeAutoUpdate()
      Specified by:
      nodeAutoUpdate in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • nodeVersion

      public String nodeVersion()
      Specified by:
      nodeVersion in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • npmFolder

      public File npmFolder()
      Specified by:
      npmFolder in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • openApiJsonFile

      public File openApiJsonFile()
      Specified by:
      openApiJsonFile in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • pnpmEnable

      public boolean pnpmEnable()
      Specified by:
      pnpmEnable in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • bunEnable

      public boolean bunEnable()
      Specified by:
      bunEnable in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • useGlobalPnpm

      public boolean useGlobalPnpm()
      Specified by:
      useGlobalPnpm in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • projectBaseDirectory

      public Path projectBaseDirectory()
      Specified by:
      projectBaseDirectory in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • requireHomeNodeExec

      public boolean requireHomeNodeExec()
      Specified by:
      requireHomeNodeExec in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • servletResourceOutputDirectory

      public File servletResourceOutputDirectory()
      Specified by:
      servletResourceOutputDirectory in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • webpackOutputDirectory

      public File webpackOutputDirectory()
      Specified by:
      webpackOutputDirectory in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • frontendOutputDirectory

      public File frontendOutputDirectory()
      Specified by:
      frontendOutputDirectory in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • isJarProject

      public boolean isJarProject()
      Specified by:
      isJarProject in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • buildFolder

      public String buildFolder()
      Specified by:
      buildFolder in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • postinstallPackages

      public List<String> postinstallPackages()
      Specified by:
      postinstallPackages in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • isFrontendHotdeploy

      public boolean isFrontendHotdeploy()
      Specified by:
      isFrontendHotdeploy in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • skipDevBundleBuild

      public boolean skipDevBundleBuild()
      Specified by:
      skipDevBundleBuild in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • isPrepareFrontendCacheDisabled

      public boolean isPrepareFrontendCacheDisabled()
      Specified by:
      isPrepareFrontendCacheDisabled in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • isReactEnabled

      public boolean isReactEnabled()
      Specified by:
      isReactEnabled in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • applicationIdentifier

      public String applicationIdentifier()
      Specified by:
      applicationIdentifier in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • frontendExtraFileExtensions

      public List<String> frontendExtraFileExtensions()
      Specified by:
      frontendExtraFileExtensions in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • checkRuntimeDependency

      public boolean checkRuntimeDependency(String groupId, String artifactId, Consumer<String> missingDependencyMessageConsumer)
      Specified by:
      checkRuntimeDependency in interface com.vaadin.flow.plugin.base.PluginAdapterBuild
    • isNpmExcludeWebComponents

      public boolean isNpmExcludeWebComponents()
      Specified by:
      isNpmExcludeWebComponents in interface com.vaadin.flow.plugin.base.PluginAdapterBase
    • isFrontendIgnoreVersionChecks

      public boolean isFrontendIgnoreVersionChecks()
      Specified by:
      isFrontendIgnoreVersionChecks in interface com.vaadin.flow.plugin.base.PluginAdapterBase