With maven, is it possible to "add" a property or plugin value specified in the parent pump?

If in my parent maven project pom.xml it has the following property:

<properties>
   <argLine>some args</argLine>
</properties>

      

Is it possible for a child to somehow simply "increase" that, for example,

<properties>
   <argLine>${parent.argLine} some more args</argLine>
</properties>

      

Similarly, for example, plugin settings, for example

<build>
   <plugins>
    <plugin>
       <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
            <argLine>${parent.plugin.maven-surefire-plugin.argLine} -Xmx1G</argLine>
          </configuration> 

      

Am I basically just adding to some setting specified in the parent?

The impetus for this question is that I am wondering how to use the jacoco plugin and for example specify "-Xmx1G" in the root pump and other parameters for children. ref: stackoverflow question/62581 / ...

I assumed I could just rename the jacoco parameter generating ( stack overflow) "propertyName") and then I could use the parent $ {argLine} and add it to jacococ one, but my question is all still remains.

+3


source to share


4 answers


The only way I could do would be to duplicate the parameter from the parent. The problem in this case is that the plugin "overrides" the maven variable. So, you could use a "duplicate" from the parent, perhaps.



0


source


The property should be directly visible on your child pump: ${argLine}



+1


source


Use pluginMagement in parent folder and point configs there. They will be distributed to all parent modules.

0


source


With Maven 3 you can use the reference $ {project.parent.propertyName}

0


source







All Articles