com.vaadin.flow.server.frontend.installer.
Class NodeInstaller
- java.lang.Object
-
- com.vaadin.flow.server.frontend.installer.NodeInstaller
-
public class NodeInstaller extends Object
Node installation class.
Derived from eirslett/frontend-maven-plugin
For internal use only. May be renamed or removed in a future release.
Since:
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_NODEJS_DOWNLOAD_ROOT
static String
INSTALL_PATH
static String
PROVIDED_VERSION
static String
UNOFFICIAL_NODEJS_DOWNLOAD_ROOT
-
Constructor Summary
Constructors Constructor Description NodeInstaller(File installDirectory, Platform platform, com.vaadin.flow.server.frontend.installer.ArchiveExtractor archiveExtractor, com.vaadin.flow.server.frontend.installer.FileDownloader fileDownloader)
Initialize a new NodeInstaller.
NodeInstaller(File installDirectory, Platform platform, List<ProxyConfig.Proxy> proxies)
Create NoodeInstaller with default extractor and downloader.
NodeInstaller(File installDirectory, List<ProxyConfig.Proxy> proxies)
Create NodeInstaller with default extractor and downloader and guess platform.
-
Method Summary
All Methods Modifier and Type Method Description String
getInstallDirectory()
void
install()
Install node and npm.
NodeInstaller
setNodeDownloadRoot(URI nodeDownloadRoot)
Set a custom download root.
NodeInstaller
setNodeVersion(String nodeVersion)
Set the node version to install.
NodeInstaller
setPassword(String password)
Set password to use.
NodeInstaller
setUserName(String userName)
Set user name to use.
-
-
-
Field Detail
-
INSTALL_PATH
public static final String INSTALL_PATH
See Also:
-
DEFAULT_NODEJS_DOWNLOAD_ROOT
public static final String DEFAULT_NODEJS_DOWNLOAD_ROOT
See Also:
-
UNOFFICIAL_NODEJS_DOWNLOAD_ROOT
public static final String UNOFFICIAL_NODEJS_DOWNLOAD_ROOT
See Also:
-
PROVIDED_VERSION
public static final String PROVIDED_VERSION
See Also:
-
-
Constructor Detail
-
NodeInstaller
public NodeInstaller(File installDirectory, List<ProxyConfig.Proxy> proxies)
Create NodeInstaller with default extractor and downloader and guess platform.
Parameters:
installDirectory
- installation directoryproxies
- list of proxies
-
NodeInstaller
public NodeInstaller(File installDirectory, Platform platform, List<ProxyConfig.Proxy> proxies)
Create NoodeInstaller with default extractor and downloader.
Parameters:
installDirectory
- installation directoryplatform
- platform informationproxies
- list of proxies
-
NodeInstaller
public NodeInstaller(File installDirectory, Platform platform, com.vaadin.flow.server.frontend.installer.ArchiveExtractor archiveExtractor, com.vaadin.flow.server.frontend.installer.FileDownloader fileDownloader)
Initialize a new NodeInstaller.
Parameters:
installDirectory
- installation directoryplatform
- platform informationarchiveExtractor
- archive extractorfileDownloader
- file downloader
-
-
Method Detail
-
setNodeVersion
public NodeInstaller setNodeVersion(String nodeVersion)
Set the node version to install. (given as "v16.0.0")
Parameters:
nodeVersion
- version stringReturns:
this
-
setNodeDownloadRoot
public NodeInstaller setNodeDownloadRoot(URI nodeDownloadRoot)
Set a custom download root.
This should be a url or directory under which we can find a directory
nodeVersion
and there should then exist the archived node packages. For instance for v16.0.0 we should have under nodeDownloadRoot: ./v16.0.0/node-v16.0.0-linux-x64.tar.xz ./v16.0.0/node-v16.0.0-darwin-x64.tar.gz ./v16.0.0/node-v16.0.0-win-x64.zip ./v16.0.0/node-v16.0.0-win-x86.zipParameters:
nodeDownloadRoot
- custom download rootReturns:
this
-
setUserName
public NodeInstaller setUserName(String userName)
Set user name to use.
Parameters:
userName
- user nameReturns:
this
-
setPassword
public NodeInstaller setPassword(String password)
Set password to use.
Parameters:
password
- passwordReturns:
this
-
install
public void install() throws InstallationException
Install node and npm.
Throws:
InstallationException
- exception thrown when installation fails
-
getInstallDirectory
public String getInstallDirectory()
-
-