[GRADLE-2448] Dependency pom.xml parsing errors Created: 27/Aug/12  Updated: 10/Nov/13  Resolved: 10/Nov/13

Status: Resolved
Project: Gradle
Affects Version/s: 1.1
Fix Version/s: None

Type: Bug
Reporter: Erik Broes Assignee: Unassigned
Resolution: Not A Bug Votes: 0


 Description   

When referencing 'net.sourceforge.argo:argo:2.25' as a compiletime dependency in my java project it get the following error:

[Fatal Error] argo-2.25.pom:3:10: Already seen doctype.
org.xml.sax.SAXParseException: Already seen doctype.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:246)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)

The xml looks rather decent: ( /Users/erikbroes/.gradle/caches/artifacts-14/filestore/net.sourceforge.argo/argo/2.25/pom/3c2dad469893c76856b74dcd0ce9a330f426961b/argo-2.25.pom )

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>net.sourceforge.argo</groupId>
<artifactId>argo</artifactId>
<version>2.25</version>
<packaging>jar</packaging>
<name>Argo</name>
<description>Argo is an open source JSON parser and generator written in Java. It offers document, push, and pull APIs.</description>
<url>http://argo.sourceforge.net</url>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://argo.svn.sourceforge.net/svnroot/argo/tags/2.25</url>
</scm>
<dependencies></dependencies>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
</project>

When I remove the line with the <!DOCTYPE the problem 'resolves' itself, but that is quite a halfassed workaround (can't expect all devs to go change their gradle-cached dependencies) and I cannot really control what I download from a maven repo (of which I haven't set any so it should just get it from whereever is default).

Maven has no problems handling the file itself and seems to fetch it from http://repo.maven.apache.org/maven2/net/sourceforge/argo/argo/2.25/argo-2.25.pom

Maybe make the parsing of the pom files a bit less strict because unless someone changes the uploaded file there is no real workaround



 Comments   
Comment by Kelly Robinson [ 01/Nov/12 ]

This just recently started happening on my builds using 1.2 as well.

Comment by Adam Murdoch [ 13/Nov/12 ]

Do you have the full stack trace for the failure?

Comment by Kelly Robinson [ 13/Nov/12 ]

I don't have the full stacktrace available, but did track back the issue to our nexus repository and some corrupted data returned from a repo we were proxying(wicket). Looked like the proxied repository started returning html instead of the expected poms, which led to the parsing error. Removing that repo and deleting the indexed data on our nexus resolved the issue, so from my perspective this wasn't even a bug in Gradle.

Comment by Adam Murdoch [ 06/Dec/12 ]

Do you mind if I close this issue, then?

Comment by AbrarSyed [ 21/May/13 ]

I have had the same problem with grabbing argo 3.3 from Maven Central, and I DO have a stack trace...

on second thaught.. i will NOT paste it here....

http://pastebin.com/JdWRj4pB

Comment by AbrarSyed [ 25/May/13 ]

Someone please mark this as solved. The issue I reported on soruceforge to teh Argo guys has been resolved, so this issue should be fixed now.

http://sourceforge.net/p/argo/bug-reports/5/

Generated at Wed Jun 30 12:22:12 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.