updated pom parsing to resolve issue #210

Former-commit-id: e1092139cc27a01fba8ecfa37aa3904ee96154e6
This commit is contained in:
Jeremy Long
2015-04-07 08:56:45 -04:00
parent 3dd95180e0
commit 70e0c84a20
3 changed files with 4 additions and 18 deletions

View File

@@ -83,8 +83,8 @@ public class PomParser {
try {
final PomHandler handler = new PomHandler();
final SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
factory.setValidating(true);
// factory.setNamespaceAware(true);
// factory.setValidating(true);
final SAXParser saxParser = factory.newSAXParser();
final XMLReader xmlReader = saxParser.getXMLReader();
xmlReader.setContentHandler(handler);

View File

@@ -56,7 +56,7 @@ public final class PomUtils {
Model model = null;
try {
PomParser parser = new PomParser();
parser.parse(file);
model = parser.parse(file);
} catch (PomParseException ex) {
final String msg = String.format("Unable to parse pom '%s'", file.getPath());
LOGGER.log(Level.WARNING, msg);

View File

@@ -58,24 +58,10 @@ public class PomUtilsTest {
*/
@Test
public void testReadPom_File() throws Exception {
File file = BaseTest.getResourceAsFile(this, "dwr-xml.pom");
File file = BaseTest.getResourceAsFile(this, "dwr-pom.xml");
String expResult = "Direct Web Remoting";
Model result = PomUtils.readPom(file);
assertEquals(expResult, result.getName());
}
// /**
// * Test of analyzePOM method, of class PomUtils.
// */
// @Test
// public void testAnalyzePOM() throws Exception {
// System.out.println("analyzePOM");
// Dependency dependency = null;
// File pomFile = null;
// PomUtils instance = new PomUtils();
// instance.analyzePOM(dependency, pomFile);
// // TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
// }
}