0

The Maven plugin goal database:run crashes when I try to run it without specifying the modules where it's defined.

My project has four modules (main, core, cli, and web) and I added a database plugin only in two of them (cli and web), in the standard form:

  <plugin>
    <groupId>org.tools.database</groupId>
    <artifactId>database-maven-plugin</artifactId>
    <version>1.0.3</version>
    <configuration>
      ...
    </configuration>
  </plugin>

It works well when I run:

mvn -pl cli,web database:run

But crashes if I omit the module's list:

mvn database:run

No plugin found for prefix 'database' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories...

Do I need to also define the plugin it in the main module/project, so it doesn't crash? But it wouldn't make sense... would it? Is this the expected behavior? I would prefer the shorter command line, if possible.

Joe DiNottra
  • 836
  • 8
  • 26
  • I suppose you have defined the plugin only in the children modules? Not via pluginManagement in the root of your projects ...I suppose also that you have a parent above main/core/cli/web ? – khmarbaise Dec 27 '19 at 21:40
  • @khmarbaise Yes, "main" is the parent, and I only defined the plugin in "cli" and "web". I'm not using pluginManagement. Should I? – Joe DiNottra Dec 27 '19 at 23:12
  • Yes you should and define all plugins in your parent... – khmarbaise Dec 28 '19 at 12:11

0 Answers0