Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0
-
Fix Version/s: 1.0.1
-
Component/s: inheritance
-
Labels:None
-
Number of attachments :
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)
}
Issue Links
- relates to
-
MAVEN-1404
ClassCastException in the debug log when inheriting an undefined property
-
-
MAVEN-1479
Multiproject inheritance (again)
-
Could you check the output of maven -X to see if there's any exception?
This sounds related to MPMULTIPROJECT-39 and
MAVEN-1404