Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running the same plugin multiple times in Maven

Tags:

maven

minify

I'm using maven-minify-plugin. It can produce only one output file. I need to produce two minified js files. One from one set of files, the other from another set of files.

Can I somehow trick Maven into running two different configurations for the same plugin?

Thanks for help, Yuri.

like image 637
Yuri Geinish Avatar asked Oct 28 '10 20:10

Yuri Geinish


People also ask

Are Maven plugins reusable?

Almost any action that you can think of performing on a project is implemented as a Maven plugin. Plugins are the central feature of Maven that allow for the reuse of common build logic across multiple projects.

Are Maven plugins executed in order?

Plugin executions are ordered according to their phases. See https://maven.apache.org/ref/current/maven-core/lifecycles.html for the order of phases. For example, here mavin-plugin-1 is executed before maven-plugin-2 because the process-resources phase is defined as taking place before the compile phase.

Does Maven allow third party plugins?

plugins for prefix-to-artifactId mappings for the plugins it needs to perform a given build. However, as previously mentioned, the user may have a need for third-party plugins.


1 Answers

Turned out to be pretty easy. Use different executions, like explained here: http://maven.apache.org/guides/mini/guide-configuring-plugins.html#Using_the_executions_Tag

like image 152
Yuri Geinish Avatar answered Sep 18 '22 17:09

Yuri Geinish