diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index 1d1b0f2..4de8fd8 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -188,7 +188,7 @@ class LicenseResolver { Configuration pomConfiguration = project.configurations.detachedConfiguration(d) File pStream = pomConfiguration.resolve().asList().first() - GPathResult xml = new XmlSlurper().parse(pStream) + GPathResult xml = new XmlSlurper(true, false).parse(pStream) DependencyMetadata pomData = new DependencyMetadata(dependency: initialDependency) xml.licenses.license.each { diff --git a/src/test/groovy/nl/javadude/gradle/plugins/license/DownloadLicensesIntegTest.groovy b/src/test/groovy/nl/javadude/gradle/plugins/license/DownloadLicensesIntegTest.groovy index 1570cfb..44cec18 100644 --- a/src/test/groovy/nl/javadude/gradle/plugins/license/DownloadLicensesIntegTest.groovy +++ b/src/test/groovy/nl/javadude/gradle/plugins/license/DownloadLicensesIntegTest.groovy @@ -56,6 +56,23 @@ class DownloadLicensesIntegTest extends Specification { ant.delete(dir: projectDir) } + def "Test that poms with xlint args are handled"() { + setup: + project.dependencies { + compile "com.sun.mail:javax.mail:1.5.4" + } + + when: + downloadLicenses.execute() + + then: + File f = getLicenseReportFolder() + assertLicenseReportsExist(f) + dependenciesInReport(xml4LicenseByDependencyReport(f)) == 2 + licensesInReport(xml4DependencyByLicenseReport(f)) == 2 + + } + def "Test that report generating in multi module build doesn't include unrelated subprojects dependencies"() { setup: subproject.dependencies {