Package com.vaadin.flow.plugin.maven
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAdditionally include compile-time-only dependencies matching the pattern.protected BooleanWhether or not we are running in productionMode.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanvoidexecute()protected abstract voidPerform whatever build-process behavior thisMojoimplements.
This is the main trigger for theMojoinside theMavensystem, and allows theMojoto communicate errors.com.vaadin.flow.server.frontend.scanner.ClassFinderbooleanbooleanbooleanbooleanbooleanChecks if Hilla is available based on the Maven project's classpath.static booleanisHillaAvailable(org.apache.maven.project.MavenProject mavenProject) Checks if Hilla is available based on the Maven project's classpath.booleanisHillaUsed(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.static booleanisHillaUsed(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.booleanbooleanbooleanbooleanvoidlogDebug(CharSequence debugMessage) voidlogDebug(CharSequence debugMessage, Throwable e) voidlogError(CharSequence error) voidlogError(CharSequence error, Throwable e) voidlogInfo(CharSequence infoMessage) voidlogWarn(CharSequence warning) voidlogWarn(CharSequence warning, Throwable e) booleanbooleanbooleanprotected voidtriggerRefresh(File file) Indicates that the file or folder content has been modified during the build.booleanMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.plugin.base.PluginAdapterBase
createLookup
-
Field Details
-
INCLUDE_FROM_COMPILE_DEPS_REGEX
Additionally include compile-time-only dependencies matching the pattern.- See Also:
-
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:
executein interfaceorg.apache.maven.plugin.Mojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
executeInternal
protected abstract void executeInternal() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionPerform whatever build-process behavior thisMojoimplements.
This is the main trigger for theMojoinside theMavensystem, and allows theMojoto 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
Indicates that the file or folder content has been modified during the build.- Parameters:
file- aFileobject.
-
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
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:
trueif Hilla is available and Hilla views are used,falseotherwise
-
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 projectfrontendDirectory- Target frontend directory.- Returns:
trueif Hilla is available and Hilla views are used,falseotherwise
-
applicationProperties
- Specified by:
applicationPropertiesin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
eagerServerLoad
public boolean eagerServerLoad()- Specified by:
eagerServerLoadin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
frontendDirectory
- Specified by:
frontendDirectoryin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
generatedTsFolder
- Specified by:
generatedTsFolderin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
getClassFinder
public com.vaadin.flow.server.frontend.scanner.ClassFinder getClassFinder()- Specified by:
getClassFinderin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
getJarFiles
- Specified by:
getJarFilesin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
isDebugEnabled
public boolean isDebugEnabled()- Specified by:
isDebugEnabledin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
javaSourceFolder
- Specified by:
javaSourceFolderin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
javaResourceFolder
- Specified by:
javaResourceFolderin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
logDebug
- Specified by:
logDebugin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
logDebug
- Specified by:
logDebugin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
logInfo
- Specified by:
logInfoin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
logWarn
- Specified by:
logWarnin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
logError
- Specified by:
logErrorin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
logWarn
- Specified by:
logWarnin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
logError
- Specified by:
logErrorin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
nodeDownloadRoot
- Specified by:
nodeDownloadRootin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase- Throws:
URISyntaxException
-
nodeVersion
- Specified by:
nodeVersionin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
npmFolder
- Specified by:
npmFolderin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
openApiJsonFile
- Specified by:
openApiJsonFilein interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
pnpmEnable
public boolean pnpmEnable()- Specified by:
pnpmEnablein interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
bunEnable
public boolean bunEnable()- Specified by:
bunEnablein interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
useGlobalPnpm
public boolean useGlobalPnpm()- Specified by:
useGlobalPnpmin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
projectBaseDirectory
- Specified by:
projectBaseDirectoryin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
requireHomeNodeExec
public boolean requireHomeNodeExec()- Specified by:
requireHomeNodeExecin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
nodeFolder
- Specified by:
nodeFolderin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
servletResourceOutputDirectory
- Specified by:
servletResourceOutputDirectoryin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
webpackOutputDirectory
- Specified by:
webpackOutputDirectoryin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
frontendOutputDirectory
- Specified by:
frontendOutputDirectoryin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
isJarProject
public boolean isJarProject()- Specified by:
isJarProjectin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
buildFolder
- Specified by:
buildFolderin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
postinstallPackages
- Specified by:
postinstallPackagesin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
isFrontendHotdeploy
public boolean isFrontendHotdeploy()- Specified by:
isFrontendHotdeployin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
skipDevBundleBuild
public boolean skipDevBundleBuild()- Specified by:
skipDevBundleBuildin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
isPrepareFrontendCacheDisabled
public boolean isPrepareFrontendCacheDisabled()- Specified by:
isPrepareFrontendCacheDisabledin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
isReactEnabled
public boolean isReactEnabled()- Specified by:
isReactEnabledin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
applicationIdentifier
- Specified by:
applicationIdentifierin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
frontendExtraFileExtensions
- Specified by:
frontendExtraFileExtensionsin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
isNpmExcludeWebComponents
public boolean isNpmExcludeWebComponents()- Specified by:
isNpmExcludeWebComponentsin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
isFrontendIgnoreVersionChecks
public boolean isFrontendIgnoreVersionChecks()- Specified by:
isFrontendIgnoreVersionChecksin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-
isCommercialBannerEnabled
public boolean isCommercialBannerEnabled()- Specified by:
isCommercialBannerEnabledin interfacecom.vaadin.flow.plugin.base.PluginAdapterBase
-