jvanzyl 2003/12/09 08:44:54
Modified: maven-project/src/java/org/apache/maven/project Project.java
Log:
o correct failing test case for inheriting property by allow the parent project
to be consulted in the event the child has no record of the said property. this
should allow projects using any level or extension to have their properties resolve
correctly.
Revision Changes Path
1.13 +14 -2
maven-components/maven-project/src/java/org/apache/maven/project/Project.java
Index: Project.java
===================================================================
RCS file:
/home/cvs/maven-components/maven-project/src/java/org/apache/maven/project/Project.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Project.java 8 Dec 2003 22:14:57 -0000 1.12
+++ Project.java 9 Dec 2003 16:44:54 -0000 1.13
@@ -92,6 +92,11 @@
this.parent = parent;
}
+ public boolean hasParent()
+ {
+ return getParent() != null;
+ }
+
/**
*
* @return
@@ -550,7 +555,14 @@
public String getProperty( String key )
{
- return (String) properties.get( key );
+ String property = (String) properties.get( key );
+
+ if ( property == null && hasParent() )
+ {
+ property = getParent().getProperty( key );
+ }
+
+ return property;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]