I have developed a Maven plugin. How to run custom Maven goal from a directory that does not contain a pom.xml
?
E.g. mvn my.plugin:mygoal
<- no pom.xml in this dir.
I have developed a Maven plugin. How to run custom Maven goal from a directory that does not contain a pom.xml
?
E.g. mvn my.plugin:mygoal
<- no pom.xml in this dir.
You can set the requiresProject
attribute of your MOJO to false
:
Flags this Mojo to run inside of a project.
By default, it is true
meaning that this MOJO requires a project (hence a POM). As such, you should have in your plugin:
@Mojo(requiresProject = false, ...)
public class MyMojo extends AbstractMojo { ... }