Class FlowModeAbstractMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.vaadin.flow.plugin.maven.FlowModeAbstractMojo
All Implemented Interfaces:
com.vaadin.flow.plugin.base.PluginAdapterBase, org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
BuildFrontendMojo, CleanFrontendMojo, ConvertPolymerMojo, GenerateNpmBOMMojo, PrepareFrontendMojo

public abstract class FlowModeAbstractMojo extends org.apache.maven.plugin.AbstractMojo implements com.vaadin.flow.plugin.base.PluginAdapterBase
The base class of Flow Mojos in order to compute correctly the modes.
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:
    • productionMode

      @Parameter(defaultValue="${null}") protected Boolean productionMode
      Whether or not we are running in productionMode.
  • Constructor Details

    • FlowModeAbstractMojo

      public FlowModeAbstractMojo()
  • 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

      protected abstract void executeInternal() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Perform whatever build-process behavior this Mojo implements.
      This is the main trigger for the Mojo inside the Maven system, and allows the Mojo to communicate errors.
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if an unexpected problem occurs. Throwing this exception causes a "BUILD ERROR" message to be displayed.
      org.apache.maven.plugin.MojoFailureException - if an expected problem (such as a compilation failure) occurs. Throwing this exception causes a "BUILD FAILURE" message to be displayed.
    • triggerRefresh

      protected void triggerRefresh(File file)
      Indicates that the file or folder content has been modified during the build.
      Parameters:
      file - a File object.
    • isHillaAvailable

      public boolean isHillaAvailable()
      Checks if Hilla is available based on the Maven project's classpath.
      Returns:
      true if Hilla is available, false otherwise
    • isHillaAvailable

      public static boolean isHillaAvailable(org.apache.maven.project.MavenProject mavenProject)
      Checks if Hilla is available based on the Maven project's classpath.
      Parameters:
      mavenProject - Target Maven project
      Returns:
      true if Hilla is available, false otherwise
    • isHillaUsed

      public boolean isHillaUsed(File frontendDirectory)
      Checks if Hilla is available and Hilla views are used in the Maven project based on what is in routes.ts or routes.tsx file.
      Parameters:
      frontendDirectory - Target frontend directory.
      Returns:
      true if Hilla is available and Hilla views are used, false otherwise
    • isHillaUsed

      public static boolean isHillaUsed(org.apache.maven.project.MavenProject mavenProject, File frontendDirectory)
      Checks if Hilla is available and Hilla views are used in the Maven project based on what is in routes.ts or routes.tsx file.
      Parameters:
      mavenProject - Target Maven project
      frontendDirectory - Target frontend directory.
      Returns:
      true if Hilla is available and Hilla views are used, false otherwise
    • 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
    • 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
    • nodeFolder

      public String nodeFolder()
      Specified by:
      nodeFolder 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
    • 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
    • isCommercialBannerEnabled

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