aspose file tools
The moose likes Ant, Maven and Other Build Tools and the fly likes maven inheritance for plugin configurations Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "maven inheritance for plugin configurations" Watch "maven inheritance for plugin configurations" New topic
Author

maven inheritance for plugin configurations

Prash Negu
Ranch Hand

Joined: Apr 20, 2009
Posts: 45
Hi,

Just wanted to know how inheritance works in maven. Lets say i have pom project-a and project-b which inherits project-a. Below snippet shows maven-release plugin configuration.

project-a
..........
<plugin>
<artifactId>maven-release-plugin</artifactId>
<goals>deploy</goals>
<autoVersionSubmodules>true</autoVersionSubmodules>
<updateBranchVersions>true</updateBranchVersions>
<releaseProfiles>profile1</releaseProfiles>
<useReleaseProfile>false</useReleaseProfile>
</configuration>
</plugin>
...............

project -b (extends prpject-a)
..........
<plugin>
<artifactId>maven-release-plugin</artifactId>
<goals>deploy</goals>
<autoVersionSubmodules>true</autoVersionSubmodules>
<updateBranchVersions>true</updateBranchVersions>
<releaseProfiles>profile2</releaseProfiles>
<useReleaseProfile>false</useReleaseProfile>
</configuration>
</plugin>
...............

Now, another jar project-c extends project-b. If i release project-c using maven release plugin, will both profiles profile1 and profile2 will be executed or ONLY profile2 is executed?

Thanks,
Prashant
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5536

I think that only profile2 is applied because the settings in project B override the settings in project A.


JBoss In Action
Prash Negu
Ranch Hand

Joined: Apr 20, 2009
Posts: 45
Ok thanks. Could you please help me achieve below requirement?

As i mentioned in the example, project-c is extending project-b and when project-c is released profile1 and profile2 both should be applied. I have another project project-d that extends project-a and when it is released only profile1 should be applied.

Thanks,
Prashant
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5536

The including the maven-release-plugin section in your pom.xml file project-c and use this:

 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: maven inheritance for plugin configurations
 
Similar Threads
Richfaces + Spring + Maven Setup help
mvn sql:execute does not execute the scripts
Spring Major version '3' expected
Could not resolve dependencies for maven project
Build problem with maven and eclipse web project