简体   繁体   中英

How to run goals in aggregate pom after all of the child poms in maven

I have two child projects that generate jar files. I also have an aggregate pom.xml to build them in the package phase, which works. I now would like to have a goal that runs after the child projects have been packaged to generate a dockerfile using the dockerfile-maven-plugin from spotify.

Is it possible to configure the aggregate pom with the dockerfile plugin in such a way that it will run only when the jars are fully built?

The simple thing is to have a multi module build which looks like this:

+-- pom.xml (root)
+--- child1
!       +-- pom.xml
+--- child2
!       +-- pom.xml
+--- aggregate-child
        +-- pom.xml

In the aggregate-child you define all the childs you would like to package as dependencies and in that you can also define the docker-maven-plugin to create the image.

Based on that structure you can call Maven from the root via mvn clean package .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM