Is there a proper way of doing this maybe through a command line? Or do I really have to modify the POM file itself? Let’s say I want to install the maven war plugin into an existing project. I tried googling but I can only find the usage and not the installation to an existing project.
Share
As documented here,
You must mean invoking or using a plugin than installing a plugin. You can invoke pretty much any maven plugin without updating the pom, so long as you are ok with the default configurations.
For instance, to generate a javadoc on a maven project, you could just type
Now, coming to
maven war plugin. This creates awarartifact of your project. It makes no sense to invoke it on a project, unless the project is awarproject. If it is so, thepackagingof the project should bewar.In this case, maven war plugin gets automatically invoked on it.
If you want to customize/configure a plugin or based on the type of plugin, you declare it in your pom (in
<plugins>section and do the configurations).