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 PluginAdapterBuild
Goal 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.VITE_CONFIGfile.
- Since:
- 2.0
-
Field Summary
Fields inherited from class com.vaadin.flow.plugin.maven.FlowModeAbstractMojo
INCLUDE_FROM_COMPILE_DEPS_REGEX, productionModeFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.vaadin.flow.plugin.maven.FlowModeAbstractMojo
applicationProperties, buildFolder, eagerServerLoad, frontendDirectory, generatedTsFolder, getClassFinder, getClasspathElements, getJarFiles, isDebugEnabled, isFrontendHotdeploy, isJarProject, javaResourceFolder, javaSourceFolder, logDebug, logError, logInfo, logWarn, logWarn, nodeAutoUpdate, nodeDownloadRoot, nodeVersion, npmFolder, openApiJsonFile, pnpmEnable, postinstallPackages, projectBaseDirectory, requireHomeNodeExec, servletResourceOutputDirectory, skipDevBundleBuild, useGlobalPnpm, webpackOutputDirectoryMethods 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
applicationProperties, buildFolder, createLookup, eagerServerLoad, frontendDirectory, generatedTsFolder, getClassFinder, getJarFiles, isDebugEnabled, isFrontendHotdeploy, isJarProject, javaResourceFolder, javaSourceFolder, logDebug, logError, logInfo, logWarn, logWarn, nodeAutoUpdate, nodeDownloadRoot, nodeVersion, npmFolder, openApiJsonFile, pnpmEnable, postinstallPackages, projectBaseDirectory, requireHomeNodeExec, servletResourceOutputDirectory, skipDevBundleBuild, useGlobalPnpm, webpackOutputDirectory
-
Constructor Details
-
BuildFrontendMojo
public BuildFrontendMojo()
-
-
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
-
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
-
forceProductionBuild
public boolean forceProductionBuild()- Specified by:
forceProductionBuildin interfacePluginAdapterBuild
-