Start plugin
A plugin to start up Magnolia and display the logs.
Package name |
|
Repository link |
|
Latest version |
|
Changelog link |
By default, the start
command searches within the current directory for a folder whose name begins with apache-tomcat
.
If you need to specify a different directory, use the -t <path>
(or --tomcat <path>
) option.
Magnolia loads light modules from a location specified in the magnolia.resources.dir
property in the magnolia.properties
file.
For more information about the magnolia.resources.dir property, see here.
|
Even though the light-modules folder is in the project structure, and you want to use this folder, you must pass it through the option to indicate that you want to override the default magnolia.resources.dir .
To override the default magnolia.resources.dir value, use the -lmp <path> or --light-modules-path <path> option.
|
Use the Jumpstart plugin (see: Jumpstarting a project) to create a project directory. |
The plugin automatically updates the magnolia.resources.dir
property to the light-modules
folder of the project and prepares the required configuration for you.
To stop a running Magnolia, press CTRL+C. The plugin will start the stop process and will inform you when Magnolia stops.
Installing
The plugin doesn’t come pre-installed with Magnolia CLI.
You must add it to the mgnl.config.js
project file.
The plugin is installed automatically by the Jumpstart plugin if it is defined in a project template. |
Usage
Options
Form (short and long) | Description |
---|---|
|
Sets the path to the |
|
Sets the path to the |
|
Displays the version. |
|
Displays help information. |
Examples
In the following examples, assume that the mgnl.config.js
file looks like this:
import StartPlugin from "@magnolia/cli-start-plugin";
export default {
plugins: [
new StartPlugin()
]
};
For more information, see Configuring plugins.
Start Magnolia
npm run mgnl -- start
If the apache-tomcat
isn’t found in the current working directory, the plugin will prompt you to specify the directory.
The plugin writes the following properties to the mgnl.config.js
file:
-
Plugin
-
tomcatPath
-
Start Magnolia with a specific apache-tomcat
path
npm run mgnl -- start --tomcat "./magnolia/apache-tomcat"
If the ./magnolia/apache-tomcat
directory doesn’t exist, the plugin will prompt you to specify the directory.
The plugin writes the following properties to the mgnl.config.js
file:
-
Plugin
-
tomcatPath
-
Start Magnolia with a specific light-modules
path
npm run mgnl -- start --light-modules-path "./magnolia/light-modules"
This command initializes Magnolia with modules loaded from the ./magnolia/light-modules
directory.
If the apache-tomcat
isn’t found in the current working directory, the plugin will prompt you to specify the directory.
If the ./magnolia/light-modules
directory doesn’t exist, the plugin will prompt you to choose the directory containing all light modules.
The plugin writes the following properties to the mgnl.config.js
file:
-
Global
-
lightModulesPath
-
-
Plugin
-
tomcatPath
-
Configuration
You can set the following properties in mgnl.config.js
to predefine the plugin’s behavior.
Global properties
Property name | Description |
---|---|
|
The path to a directory containing all light modules. Alternative forms: |
Plugin properties
Property name | Description |
---|---|
|
The path to the Alternative forms: |
For more information, see Configuring plugins.