Package com.vaadin.flow.plugin.maven
Class BuildFrontendMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- com.vaadin.flow.plugin.maven.FlowModeAbstractMojo
-
- com.vaadin.flow.plugin.maven.BuildFrontendMojo
-
- All Implemented Interfaces:
PluginAdapterBase,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 PluginAdapterBuildGoal that builds the frontend bundle. It performs the following actions when creating a package:- Update
Constants.PACKAGE_JSONfile with theNpmPackageannotations 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_NAMEfile imports with theJsModuleThemeandJavaScriptannotations defined in the classpath, - Update
FrontendUtils.WEBPACK_CONFIGfile.
- Since:
- 2.0
-
-
Field Summary
-
Fields inherited from class com.vaadin.flow.plugin.maven.FlowModeAbstractMojo
INCLUDE_FROM_COMPILE_DEPS_REGEX
-
-
Constructor Summary
Constructors Constructor Description BuildFrontendMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanciBuild()voidexecute()FilefrontendResourcesDirectory()booleangenerateBundle()booleangenerateEmbeddableWebComponents()booleanoptimizeBundle()booleanrunNpmInstall()-
Methods inherited from class com.vaadin.flow.plugin.maven.FlowModeAbstractMojo
applicationProperties, buildFolder, eagerServerLoad, frontendDirectory, generatedFolder, generatedTsFolder, getClassFinder, getClasspathElements, getJarFiles, getUseDeprecatedV14Bootstrapping, isDebugEnabled, isJarProject, javaResourceFolder, javaSourceFolder, logDebug, logError, logInfo, logWarn, logWarn, nodeAutoUpdate, nodeDownloadRoot, nodeVersion, npmFolder, openApiJsonFile, pnpmEnable, postinstallPackages, productionMode, projectBaseDirectory, requireHomeNodeExec, servletResourceOutputDirectory, useGlobalPnpm, webpackOutputDirectory
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.plugin.base.PluginAdapterBase
applicationProperties, buildFolder, createLookup, eagerServerLoad, frontendDirectory, generatedFolder, generatedTsFolder, getClassFinder, getJarFiles, getUseDeprecatedV14Bootstrapping, isDebugEnabled, isJarProject, isUseDeprecatedV14Bootstrapping, javaResourceFolder, javaSourceFolder, logDebug, logError, logInfo, logWarn, logWarn, nodeAutoUpdate, nodeDownloadRoot, nodeVersion, npmFolder, openApiJsonFile, pnpmEnable, postinstallPackages, productionMode, projectBaseDirectory, requireHomeNodeExec, servletResourceOutputDirectory, useGlobalPnpm, webpackOutputDirectory
-
-
-
-
Method Detail
-
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
-
frontendResourcesDirectory
public File frontendResourcesDirectory()
- Specified by:
frontendResourcesDirectoryin interfacePluginAdapterBuild
-
generateBundle
public boolean generateBundle()
- Specified by:
generateBundlein interfacePluginAdapterBuild
-
generateEmbeddableWebComponents
public boolean generateEmbeddableWebComponents()
- Specified by:
generateEmbeddableWebComponentsin interfacePluginAdapterBuild
-
optimizeBundle
public boolean optimizeBundle()
- Specified by:
optimizeBundlein interfacePluginAdapterBuild
-
runNpmInstall
public boolean runNpmInstall()
- Specified by:
runNpmInstallin interfacePluginAdapterBuild
-
ciBuild
public boolean ciBuild()
- Specified by:
ciBuildin interfacePluginAdapterBuild
-
-