You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ji...@codehaus.org on 2004/10/27 23:12:08 UTC

[jira] Commented: (MAVEN-1422) Inheritence with more than 3 layers does not work

The following comment has been added to this issue:

     Author: Edwin Chiu
    Created: Wed, 27 Oct 2004 5:11 PM
       Body:
Seen MAVEN-1479 for a possible fix
---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/MAVEN-1422?page=comments#action_25822

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MAVEN-1422

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MAVEN-1422
    Summary: Inheritence with more than 3 layers does not work
       Type: Bug

     Status: Unassigned
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven
 Components: 
             inheritance
   Fix Fors:
             1.0.1
   Versions:
             1.0

   Assignee: 
   Reporter: Eric Lapierre

    Created: Tue, 10 Aug 2004 10:33 AM
    Updated: Wed, 27 Oct 2004 5:11 PM

Description:
I have a project with 5 layers each inheriting from its parent layer.

layer1
layer1/maven.xml
layer1/project.properties
layer1/layer2
layer1/layer2/project.xml
layer1/layer2/project.properties
layer1/layer2/layer3
layer1/layer2/layer3/project.xml
layer1/layer2/layer3/layer4
layer1/layer2/layer3/layer4/project.xml
layer1/layer2/layer3/layer4/layer5
layer1/layer2/layer3/layer4/layer5/project.xml
layer1/project.xml


In the layer1, I have defined a property, and I have defined a goal in the layer1 maven.xml to echo the value of that property.


When I use the multiproject goals ( maven -Dgoal=build multiproject:goal ) from layer1, layer2  inheritence works fine.

1 option is to fix the MavenUtils.java
--- MavenUtils.java     Tue Aug 10 08:48:30 2004
+++ MavenUtils.java.fix1        Tue Aug 10 08:40:13 2004
@@ -810,7 +810,7 @@
             String key = (String) i.next();
             Object value;
 
-            if ( context.getVariable( key ) == null )
+            if ( context.getVariables().get( key ) == null )
             {
                 value = map.get( key );

Another option is to look at JellyContext.java. The getVariable function only looks at the parent variables, not all its ancestors.

/** @return the value of the given variable name */
    public Object getVariable(String name) {
        Object value = variables.get(name);
		
        if ( value == null && isInherit() ) {
            JellyContext parent = getParent();
            if (parent != null) {                
                value = parent.getVariable( name );
            }
        }


 








---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org