Maven archetype - run external commands after creation

I am looking for a way to execute additional commands (e.g. perl script) after running mvn archetype: automatically generate my custom archetype.

Is it possible?

Context

I am writing an archetype that creates OSGi packages that I want to integrate into the parent project as modules. After creating the package, I want to organize it in the parent directory structure, and then automatically manipulate the pumps and other configuration files.

This was asked in the maven forums before 1 , however there was no answer.

+6
source share
1 answer

Thrau, you can call the mojo post execution of the archetype: generate by adding -Dgoals = "your custom mojo plugin" , inside the plugin you can write your own code. Hope this helps.

+2
source

Source: https://habr.com/ru/post/945456/


All Articles