Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execution VS Configuration in Maven

Tags:

maven-plugin

It is interesting, if we have a plugin with configuration parameter named "fooParameter".

And we specify it twice: one in global configuration and the other in local configuration under execution section.

When we are execution test pahes what will take precedence global or local configuration?

<plugin>
    <groupId>com.myplugin</groupId>
    <artifactId>com.myplugin</artifactId>
    <version>1.0</version>

    <configuration>
        <fooParameter>10</fooParameter>
    </configuration>

    <executions>
        <execution>
            <id>myExecution</id>
            <phase>test</test>

            <configuration>
                <fooParameter>20</fooParameter>
            </configuration>
        </execution>
    </executions>
</plugin>
like image 697
Vitaly Avatar asked Aug 23 '26 02:08

Vitaly


1 Answers

The answer is the following:

take precedence local configuration

I.e. if we type

mvn package

we get fooParameter=20

like image 84
Vitaly Avatar answered Aug 26 '26 06:08

Vitaly