I'm using Maven and I would like to execute a plugin without repeating some of the required dependencies:
<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>sql-maven-plugin</artifactId> <version>1.5</version> <dependencies> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>1.3.168</version> </dependency> <!-- ^^^ unnecessary duplication, IMO, because the project already imports the dependency below --> </dependencies> <!-- ... --> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>1.3.168</version> </dependency> </dependencies> In the above example, I would like to omit the com.h2database:h2 dependency, because I have already specified that in the project. Can this be done? How?
org.flywaydb:flyway-maven-plugin:5.0.7: if the project already uses, for example,org.postgresql:postgresql:42.2.2in the main project (as it likely would), why do I need to specify it again for the Flyway schema migration plugin? Let me know if you find an answer. For now I'm going to indicate in the lesson that the dependency must be listed in both places. Cheers!sql-maven-plugin, which doesn't do this. Out of the box, Maven doesn't support this kind of dependency "inheritance" mechanism. I think you best create a new question...