[jira] Commented: (IVY-900) Parsing of m2 pom does not handle properties correctly.

2008-09-24 Thread Kevin Brockhoff (JIRA)

[ 
https://issues.apache.org/jira/browse/IVY-900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12634189#action_12634189
 ] 

Kevin Brockhoff commented on IVY-900:
-

This is the same as IVY-914. The current trunk solves the issue.


 Parsing of m2 pom does not handle properties correctly.
 ---

 Key: IVY-900
 URL: https://issues.apache.org/jira/browse/IVY-900
 Project: Ivy
  Issue Type: Bug
  Components: Core
Affects Versions: 2.0.0-beta-2
Reporter: Kevin Brockhoff
 Attachments: PomReader.java


 There are a bunch of issues (IVY-512, IVY-550, IVY-620, IVY-637) that are 
 marked fixed that are not fixed. The attached file will actually fix these 
 issues.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (IVY-900) Parsing of m2 pom does not handle properties correctly.

2008-09-11 Thread Kevin Brockhoff (JIRA)

[ 
https://issues.apache.org/jira/browse/IVY-900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12630189#action_12630189
 ] 

Kevin Brockhoff commented on IVY-900:
-

I am working on the test case(s) and will upload them in a couple of  
days.





 Parsing of m2 pom does not handle properties correctly.
 ---

 Key: IVY-900
 URL: https://issues.apache.org/jira/browse/IVY-900
 Project: Ivy
  Issue Type: Bug
  Components: Core
Affects Versions: 2.0.0-beta-2
Reporter: Kevin Brockhoff
 Attachments: PomReader.java


 There are a bunch of issues (IVY-512, IVY-550, IVY-620, IVY-637) that are 
 marked fixed that are not fixed. The attached file will actually fix these 
 issues.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (IVY-900) Parsing of m2 pom does not handle properties correctly.

2008-09-09 Thread Kevin Brockhoff (JIRA)

 [ 
https://issues.apache.org/jira/browse/IVY-900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kevin Brockhoff updated IVY-900:


Description: 
There are a bunch of issues (IVY-512, IVY-550, IVY-620, IVY-637) that are 
makred fixed that not fixed. The attached file will actually fix these issues.

/*
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the License); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an AS IS BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
package org.apache.ivy.plugins.parser.m2;

import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.apache.ivy.core.IvyPatternHelper;
import org.apache.ivy.core.module.id.ModuleId;
import org.apache.ivy.core.module.id.ModuleRevisionId;
import org.apache.ivy.plugins.repository.Resource;
import org.apache.ivy.util.XMLHelper;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;



/**
 * Provides the method to read some data out of the DOM tree of a pom 
 * file.
 */
public class PomReader {

private static final String PACKAGING = packaging;
private static final String DEPENDENCY = dependency;
private static final String DEPENDENCIES = dependencies;
private static final String DEPENDENCY_MGT = dependencyManagement;
private static final String PROJECT = project;
private static final String GROUP_ID = groupId;
private static final String ARTIFACT_ID = artifactId;
private static final String VERSION = version;
private static final String PARENT = parent;
private static final String SCOPE = scope;
private static final String CLASSIFIER = classifier;
private static final String OPTIONAL = optional;
private static final String EXCLUSIONS = exclusions;
private static final String EXCLUSION = exclusion;
private static final String DISTRIBUTION_MGT = distributionManagement;
private static final String RELOCATION = relocation;
private static final String PROPERTIES = properties;




private HashMap properties = new HashMap();

private final Element projectElement;
private final Element parentElement;

public PomReader(URL descriptorURL, Resource res) throws IOException, 
SAXException {
Document pomDomDoc = XMLHelper.parseToDom(descriptorURL, res);
projectElement = pomDomDoc.getDocumentElement();
if (!PROJECT.equals(projectElement.getNodeName())) {
throw new SAXParseException(project must be the root tag , 
res.getName() , 
res.getName(), 0, 0);
}
parentElement = getFirstChildElement(projectElement , PARENT);
properties.putAll(getPomProperties());
}


public boolean hasParent() {
return parentElement != null;
}

/**
 * Add a property if not yet set and value is not null.
 * This garantee that property keep the first value that is put on it and 
that the properties
 * are never null.
 */
public void setProperty(String prop, String val) {
if (!properties.containsKey(prop)  val != null) {
properties.put(prop, val);
}
}


public String getGroupId() {
String groupId = getFirstChildText(projectElement , GROUP_ID);
if (groupId == null) {
groupId = getFirstChildText(parentElement, GROUP_ID);
} 
return replaceProps(groupId);

}

public String getParentGroupId() {
String groupId = getFirstChildText(parentElement , GROUP_ID);
if (groupId == null) {
groupId = getFirstChildText(projectElement, GROUP_ID);
}
return replaceProps(groupId);
}



public String getArtifactId() {
String val = getFirstChildText(projectElement , ARTIFACT_ID);
if (val == null) {
val = getFirstChildText(parentElement, ARTIFACT_ID);
}
return replaceProps(val);
}

public String getParentArtifactId() {
String val = getFirstChildText(parentElement , ARTIFACT_ID);
if (val == null) {
 

[jira] Updated: (IVY-900) Parsing of m2 pom does not handle properties correctly.

2008-09-09 Thread Kevin Brockhoff (JIRA)

 [ 
https://issues.apache.org/jira/browse/IVY-900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kevin Brockhoff updated IVY-900:


Attachment: PomReader.java

 Parsing of m2 pom does not handle properties correctly.
 ---

 Key: IVY-900
 URL: https://issues.apache.org/jira/browse/IVY-900
 Project: Ivy
  Issue Type: Bug
  Components: Core
Affects Versions: 2.0.0-beta-2
Reporter: Kevin Brockhoff
 Attachments: PomReader.java


 There are a bunch of issues (IVY-512, IVY-550, IVY-620, IVY-637) that are 
 marked fixed that are not fixed. The attached file will actually fix these 
 issues.
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one or more
  *  contributor license agreements.  See the NOTICE file distributed with
  *  this work for additional information regarding copyright ownership.
  *  The ASF licenses this file to You under the Apache License, Version 2.0
  *  (the License); you may not use this file except in compliance with
  *  the License.  You may obtain a copy of the License at
  *
  *  http://www.apache.org/licenses/LICENSE-2.0
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an AS IS BASIS,
  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
  */
 package org.apache.ivy.plugins.parser.m2;
 import java.io.IOException;
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import org.apache.ivy.core.IvyPatternHelper;
 import org.apache.ivy.core.module.id.ModuleId;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.plugins.repository.Resource;
 import org.apache.ivy.util.XMLHelper;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 /**
  * Provides the method to read some data out of the DOM tree of a pom 
  * file.
  */
 public class PomReader {
 
 private static final String PACKAGING = packaging;
 private static final String DEPENDENCY = dependency;
 private static final String DEPENDENCIES = dependencies;
 private static final String DEPENDENCY_MGT = dependencyManagement;
 private static final String PROJECT = project;
 private static final String GROUP_ID = groupId;
 private static final String ARTIFACT_ID = artifactId;
 private static final String VERSION = version;
 private static final String PARENT = parent;
 private static final String SCOPE = scope;
 private static final String CLASSIFIER = classifier;
 private static final String OPTIONAL = optional;
 private static final String EXCLUSIONS = exclusions;
 private static final String EXCLUSION = exclusion;
 private static final String DISTRIBUTION_MGT = distributionManagement;
 private static final String RELOCATION = relocation;
 private static final String PROPERTIES = properties;
 
 
 
 private HashMap properties = new HashMap();
 
 private final Element projectElement;
 private final Element parentElement;
 
 public PomReader(URL descriptorURL, Resource res) throws IOException, 
 SAXException {
 Document pomDomDoc = XMLHelper.parseToDom(descriptorURL, res);
 projectElement = pomDomDoc.getDocumentElement();
 if (!PROJECT.equals(projectElement.getNodeName())) {
 throw new SAXParseException(project must be the root tag , 
 res.getName() , 
 res.getName(), 0, 0);
 }
 parentElement = getFirstChildElement(projectElement , PARENT);
 properties.putAll(getPomProperties());
 }
 public boolean hasParent() {
 return parentElement != null;
 }
 
 /**
  * Add a property if not yet set and value is not null.
  * This garantee that property keep the first value that is put on it and 
 that the properties
  * are never null.
  */
 public void setProperty(String prop, String val) {
 if (!properties.containsKey(prop)  val != null) {
 properties.put(prop, val);
 }
 }
 
 public String getGroupId() {
 String groupId = getFirstChildText(projectElement , GROUP_ID);
 if (groupId == null) {
 groupId = getFirstChildText(parentElement, GROUP_ID);
 } 
 return replaceProps(groupId);
 }
 public String getParentGroupId() {
 String groupId = getFirstChildText(parentElement , GROUP_ID);
 if (groupId == null) {
 

[jira] Updated: (IVY-900) Parsing of m2 pom does not handle properties correctly.

2008-09-09 Thread Kevin Brockhoff (JIRA)

 [ 
https://issues.apache.org/jira/browse/IVY-900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kevin Brockhoff updated IVY-900:


Description: 
There are a bunch of issues (IVY-512, IVY-550, IVY-620, IVY-637) that are 
marked fixed that are not fixed. The attached file will actually fix these 
issues.

/*
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the License); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an AS IS BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
package org.apache.ivy.plugins.parser.m2;

import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.apache.ivy.core.IvyPatternHelper;
import org.apache.ivy.core.module.id.ModuleId;
import org.apache.ivy.core.module.id.ModuleRevisionId;
import org.apache.ivy.plugins.repository.Resource;
import org.apache.ivy.util.XMLHelper;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;



/**
 * Provides the method to read some data out of the DOM tree of a pom 
 * file.
 */
public class PomReader {

private static final String PACKAGING = packaging;
private static final String DEPENDENCY = dependency;
private static final String DEPENDENCIES = dependencies;
private static final String DEPENDENCY_MGT = dependencyManagement;
private static final String PROJECT = project;
private static final String GROUP_ID = groupId;
private static final String ARTIFACT_ID = artifactId;
private static final String VERSION = version;
private static final String PARENT = parent;
private static final String SCOPE = scope;
private static final String CLASSIFIER = classifier;
private static final String OPTIONAL = optional;
private static final String EXCLUSIONS = exclusions;
private static final String EXCLUSION = exclusion;
private static final String DISTRIBUTION_MGT = distributionManagement;
private static final String RELOCATION = relocation;
private static final String PROPERTIES = properties;




private HashMap properties = new HashMap();

private final Element projectElement;
private final Element parentElement;

public PomReader(URL descriptorURL, Resource res) throws IOException, 
SAXException {
Document pomDomDoc = XMLHelper.parseToDom(descriptorURL, res);
projectElement = pomDomDoc.getDocumentElement();
if (!PROJECT.equals(projectElement.getNodeName())) {
throw new SAXParseException(project must be the root tag , 
res.getName() , 
res.getName(), 0, 0);
}
parentElement = getFirstChildElement(projectElement , PARENT);
properties.putAll(getPomProperties());
}


public boolean hasParent() {
return parentElement != null;
}

/**
 * Add a property if not yet set and value is not null.
 * This garantee that property keep the first value that is put on it and 
that the properties
 * are never null.
 */
public void setProperty(String prop, String val) {
if (!properties.containsKey(prop)  val != null) {
properties.put(prop, val);
}
}


public String getGroupId() {
String groupId = getFirstChildText(projectElement , GROUP_ID);
if (groupId == null) {
groupId = getFirstChildText(parentElement, GROUP_ID);
} 
return replaceProps(groupId);

}

public String getParentGroupId() {
String groupId = getFirstChildText(parentElement , GROUP_ID);
if (groupId == null) {
groupId = getFirstChildText(projectElement, GROUP_ID);
}
return replaceProps(groupId);
}



public String getArtifactId() {
String val = getFirstChildText(projectElement , ARTIFACT_ID);
if (val == null) {
val = getFirstChildText(parentElement, ARTIFACT_ID);
}
return replaceProps(val);
}

public String getParentArtifactId() {
String val = getFirstChildText(parentElement , ARTIFACT_ID);
if (val == null) {

[jira] Updated: (IVY-900) Parsing of m2 pom does not handle properties correctly.

2008-09-09 Thread Kevin Brockhoff (JIRA)

 [ 
https://issues.apache.org/jira/browse/IVY-900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kevin Brockhoff updated IVY-900:


Description: 
There are a bunch of issues (IVY-512, IVY-550, IVY-620, IVY-637) that are 
marked fixed that are not fixed. The attached file will actually fix these 
issues.


  was:
There are a bunch of issues (IVY-512, IVY-550, IVY-620, IVY-637) that are 
marked fixed that are not fixed. The attached file will actually fix these 
issues.

/*
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the License); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an AS IS BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
package org.apache.ivy.plugins.parser.m2;

import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.apache.ivy.core.IvyPatternHelper;
import org.apache.ivy.core.module.id.ModuleId;
import org.apache.ivy.core.module.id.ModuleRevisionId;
import org.apache.ivy.plugins.repository.Resource;
import org.apache.ivy.util.XMLHelper;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;



/**
 * Provides the method to read some data out of the DOM tree of a pom 
 * file.
 */
public class PomReader {

private static final String PACKAGING = packaging;
private static final String DEPENDENCY = dependency;
private static final String DEPENDENCIES = dependencies;
private static final String DEPENDENCY_MGT = dependencyManagement;
private static final String PROJECT = project;
private static final String GROUP_ID = groupId;
private static final String ARTIFACT_ID = artifactId;
private static final String VERSION = version;
private static final String PARENT = parent;
private static final String SCOPE = scope;
private static final String CLASSIFIER = classifier;
private static final String OPTIONAL = optional;
private static final String EXCLUSIONS = exclusions;
private static final String EXCLUSION = exclusion;
private static final String DISTRIBUTION_MGT = distributionManagement;
private static final String RELOCATION = relocation;
private static final String PROPERTIES = properties;




private HashMap properties = new HashMap();

private final Element projectElement;
private final Element parentElement;

public PomReader(URL descriptorURL, Resource res) throws IOException, 
SAXException {
Document pomDomDoc = XMLHelper.parseToDom(descriptorURL, res);
projectElement = pomDomDoc.getDocumentElement();
if (!PROJECT.equals(projectElement.getNodeName())) {
throw new SAXParseException(project must be the root tag , 
res.getName() , 
res.getName(), 0, 0);
}
parentElement = getFirstChildElement(projectElement , PARENT);
properties.putAll(getPomProperties());
}


public boolean hasParent() {
return parentElement != null;
}

/**
 * Add a property if not yet set and value is not null.
 * This garantee that property keep the first value that is put on it and 
that the properties
 * are never null.
 */
public void setProperty(String prop, String val) {
if (!properties.containsKey(prop)  val != null) {
properties.put(prop, val);
}
}


public String getGroupId() {
String groupId = getFirstChildText(projectElement , GROUP_ID);
if (groupId == null) {
groupId = getFirstChildText(parentElement, GROUP_ID);
} 
return replaceProps(groupId);

}

public String getParentGroupId() {
String groupId = getFirstChildText(parentElement , GROUP_ID);
if (groupId == null) {
groupId = getFirstChildText(projectElement, GROUP_ID);
}
return replaceProps(groupId);
}



public String getArtifactId() {
String val = getFirstChildText(projectElement , ARTIFACT_ID);
if (val == null) {
val = getFirstChildText(parentElement, ARTIFACT_ID);
}
return