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:
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 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.ClassFindergetClasspathElements(org.apache.maven.project.MavenProject project) Deprecated, for removal: This API element is subject to removal in a future version.will be removed without replacement.booleanbooleanbooleanbooleanChecks 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) booleanbooleanbooleanbooleanprotected 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.
-
getClasspathElements
@Deprecated(forRemoval=true) public static List<String> getClasspathElements(org.apache.maven.project.MavenProject project) Deprecated, for removal: This API element is subject to removal in a future version.will be removed without replacement.Generates a List of ClasspathElements (Run and CompileTime) from a MavenProject.- Parameters:
project- a given MavenProject- Returns:
- List of ClasspathElements
-
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 interfacePluginAdapterBase
-
eagerServerLoad
public boolean eagerServerLoad()- Specified by:
eagerServerLoadin interfacePluginAdapterBase
-
frontendDirectory
- Specified by:
frontendDirectoryin interfacePluginAdapterBase
-
generatedTsFolder
- Specified by:
generatedTsFolderin interfacePluginAdapterBase
-
getClassFinder
public com.vaadin.flow.server.frontend.scanner.ClassFinder getClassFinder()- Specified by:
getClassFinderin interfacePluginAdapterBase
-
getJarFiles
- Specified by:
getJarFilesin interfacePluginAdapterBase
-
isDebugEnabled
public boolean isDebugEnabled()- Specified by:
isDebugEnabledin interfacePluginAdapterBase
-
javaSourceFolder
- Specified by:
javaSourceFolderin interfacePluginAdapterBase
-
javaResourceFolder
- Specified by:
javaResourceFolderin interfacePluginAdapterBase
-
logDebug
- Specified by:
logDebugin interfacePluginAdapterBase
-
logDebug
- Specified by:
logDebugin interfacePluginAdapterBase
-
logInfo
- Specified by:
logInfoin interfacePluginAdapterBase
-
logWarn
- Specified by:
logWarnin interfacePluginAdapterBase
-
logError
- Specified by:
logErrorin interfacePluginAdapterBase
-
logWarn
- Specified by:
logWarnin interfacePluginAdapterBase
-
logError
- Specified by:
logErrorin interfacePluginAdapterBase
-
nodeDownloadRoot
- Specified by:
nodeDownloadRootin interfacePluginAdapterBase- Throws:
URISyntaxException
-
nodeAutoUpdate
public boolean nodeAutoUpdate()- Specified by:
nodeAutoUpdatein interfacePluginAdapterBase
-
nodeVersion
- Specified by:
nodeVersionin interfacePluginAdapterBase
-
npmFolder
- Specified by:
npmFolderin interfacePluginAdapterBase
-
openApiJsonFile
- Specified by:
openApiJsonFilein interfacePluginAdapterBase
-
pnpmEnable
public boolean pnpmEnable()- Specified by:
pnpmEnablein interfacePluginAdapterBase
-
bunEnable
public boolean bunEnable()- Specified by:
bunEnablein interfacePluginAdapterBase
-
useGlobalPnpm
public boolean useGlobalPnpm()- Specified by:
useGlobalPnpmin interfacePluginAdapterBase
-
projectBaseDirectory
- Specified by:
projectBaseDirectoryin interfacePluginAdapterBase
-
requireHomeNodeExec
public boolean requireHomeNodeExec()- Specified by:
requireHomeNodeExecin interfacePluginAdapterBase
-
servletResourceOutputDirectory
- Specified by:
servletResourceOutputDirectoryin interfacePluginAdapterBase
-
webpackOutputDirectory
- Specified by:
webpackOutputDirectoryin interfacePluginAdapterBase
-
frontendOutputDirectory
- Specified by:
frontendOutputDirectoryin interfacePluginAdapterBase
-
isJarProject
public boolean isJarProject()- Specified by:
isJarProjectin interfacePluginAdapterBase
-
buildFolder
- Specified by:
buildFolderin interfacePluginAdapterBase
-
postinstallPackages
- Specified by:
postinstallPackagesin interfacePluginAdapterBase
-
isFrontendHotdeploy
public boolean isFrontendHotdeploy()- Specified by:
isFrontendHotdeployin interfacePluginAdapterBase
-
skipDevBundleBuild
public boolean skipDevBundleBuild()- Specified by:
skipDevBundleBuildin interfacePluginAdapterBase
-
isPrepareFrontendCacheDisabled
public boolean isPrepareFrontendCacheDisabled()- Specified by:
isPrepareFrontendCacheDisabledin interfacePluginAdapterBase
-
isReactEnabled
public boolean isReactEnabled()- Specified by:
isReactEnabledin interfacePluginAdapterBase
-
applicationIdentifier
- Specified by:
applicationIdentifierin interfacePluginAdapterBase
-
frontendExtraFileExtensions
- Specified by:
frontendExtraFileExtensionsin interfacePluginAdapterBase
-
isNpmExcludeWebComponents
public boolean isNpmExcludeWebComponents()- Specified by:
isNpmExcludeWebComponentsin interfacePluginAdapterBase
-
isFrontendIgnoreVersionChecks
public boolean isFrontendIgnoreVersionChecks()- Specified by:
isFrontendIgnoreVersionChecksin interfacePluginAdapterBase
-