[GRADLE-1738] class org.dom4j.io.SAXReader cannot be resolved Created: 10/Aug/11  Updated: 04/Jan/13  Resolved: 10/Aug/11

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-4
Fix Version/s: None

Type: Bug
Reporter: Martin Kováčik Assignee: Unassigned
Resolution: Not A Bug Votes: 0


My build script could not be compiled due to unresolved class org.dom4j.io.SAXReader (yes I'm using SAXReader in my build script).

unable to resolve class org.dom4j.io.SAXReader
@ line 314, column 16.
def reader = new org.dom4j.io.SAXReader()

I had to switch back to 1.0-milestone-2, where it works fine.

Comment by Adam Murdoch [ 10/Aug/11 ]

The dom4j classes were unintentionally made visible to build scripts in earlier versions of Gradle. They are no longer visible in milestone-4. Instead, you need to declare the dependency in your build script:

buildscript {
   repositories { mavenCentral() }
   dependencies { classpath 'dom4j:dom4j:1.6.1' }
Generated at Wed Jun 30 12:03:06 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.