File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
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: 5812
    
    7

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: 5812
    
    7

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

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: maven inheritance for plugin configurations
 
Similar Threads
Richfaces + Spring + Maven Setup help
Could not resolve dependencies for maven project
Build problem with maven and eclipse web project
mvn sql:execute does not execute the scripts
Spring Major version '3' expected