I have this multi-module project.
At the beginning of each build, I would like to run some bat file.
So, I did the following:
<profile> <id>deploy-db</id> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.1.1</version> </plugin> </plugins> <pluginManagement> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.1.1</version> <executions> <execution> <phase>validate</phase> <goals> <goal>exec</goal> </goals> <inherited>false</inherited> </execution> </executions> <configuration> <executable>../database/schemas/import_databases.bat</executable> </configuration> </plugin> </plugins> </pluginManagement> </build> </profile>
when I run mvn verify -Pdeploy-dbfrom the root, I get this script executed again and again in each of my modules.
mvn verify -Pdeploy-db
I want it to be executed only once, in the root module.
What am I missing there?
thank
I may be wrong, but when you add a plugin to a section <pluginManagement>, each submodule inherits it and “launches” it.
<pluginManagement>
, exec-maven-plugin <execution> <plugins> .
<execution>
<plugins>
, , - POM. , maven (.. " maven" ). "leaf node" poms, , .
, script , , ( , ), . - , , .
maven. "../database/schemas/import_databases.bat". import_databases.bat , , . - "$ {basedir}/src/main/scripts/import_databases.bat"
Source: https://habr.com/ru/post/1738856/More articles:Haskell: преобразование целочисленного числа unicode в фактический символ Юникода - unicodeCan replacing statements with expressions with the C ++ comma operator allow more optimized compilation? - c ++How to check image quality in a program using C #? - c #Can I use the MAX function for each tuple in a dataset - sqlA cast-type array into a common array? - arraysBeginAnimations and CommitAnimations with NavigationController.PushViewController - uiviewHow could I avoid the SAVE dialog in my regular Blackberry application? - user-interfaceDoes it make sense to have a separate Scala library in the Android market? - androidCombined performance and performance issues - design-patternsjQuery prevents insertion into iframe designmode from MS Word - jqueryAll Articles