Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions scripts/_GrailsWar.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -209,26 +209,14 @@ target (war: "The implementation target") {
if (includeJars) {
if (pluginInfos) {
def libDir = "${stagingDir}/WEB-INF/lib"
// Copy embedded libs (dependencies declared inside dependencies.groovy are already provided)
ant.copy(todir:libDir, flatten:true, failonerror:false, preservelastmodified:true) {
for (GrailsPluginInfo info in pluginInfos) {
fileset(dir: info.pluginDir.file.path) {
include(name:"lib/*.jar")
}
}
}

for(GrailsPluginInfo info in pluginInfos) {
IvyDependencyManager freshManager = new IvyDependencyManager(info.name, info.version)
freshManager.parseDependencies {}
freshManager.chainResolver = grailsSettings.dependencyManager.chainResolver
grailsSettings.pluginDependencyHandler(freshManager).call(info.pluginDir.file.canonicalFile)
for(File file in freshManager.resolveDependencies("runtime").allArtifactsReports.localFile) {
if(file) {
ant.copy(file:file, todir:libDir)
}
}

}
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/java/grails/util/BuildSettings.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class BuildSettings extends AbstractBuildSettings {
Message.info "Resolving [compile] dependencies..."
def jarFiles = dependencyManager
.resolveDependencies(IvyDependencyManager.COMPILE_CONFIGURATION)
.allArtifactsReports
.getArtifactsReports(null, false)
.localFile + applicationJars
Message.debug("Resolved jars for [compile]: ${{->jarFiles.join('\n')}}")
resolveCache['compile'] = jarFiles
Expand Down Expand Up @@ -341,7 +341,7 @@ class BuildSettings extends AbstractBuildSettings {
Message.info "Resolving [test] dependencies..."
def jarFiles = dependencyManager
.resolveDependencies(IvyDependencyManager.TEST_CONFIGURATION)
.allArtifactsReports
.getArtifactsReports(null, false)
.localFile + applicationJars
Message.debug("Resolved jars for [test]: ${{->jarFiles.join('\n')}}")
resolveCache['test'] = jarFiles
Expand Down Expand Up @@ -373,7 +373,7 @@ class BuildSettings extends AbstractBuildSettings {
Message.info "Resolving [runtime] dependencies..."
def jarFiles = dependencyManager
.resolveDependencies(IvyDependencyManager.RUNTIME_CONFIGURATION)
.allArtifactsReports
.getArtifactsReports(null, false)
.localFile + applicationJars
Message.debug("Resolved jars for [runtime]: ${{->jarFiles.join('\n')}}")
resolveCache['runtime'] = jarFiles
Expand Down Expand Up @@ -408,7 +408,7 @@ class BuildSettings extends AbstractBuildSettings {
Message.info "Resolving [provided] dependencies..."
def jarFiles = dependencyManager
.resolveDependencies(IvyDependencyManager.PROVIDED_CONFIGURATION)
.allArtifactsReports
.getArtifactsReports(null, false)
.localFile

Message.debug("Resolved jars for [provided]: ${{->jarFiles.join('\n')}}")
Expand Down Expand Up @@ -447,7 +447,7 @@ class BuildSettings extends AbstractBuildSettings {
Message.info "Resolving [build] dependencies..."
def jarFiles = dependencyManager
.resolveDependencies(IvyDependencyManager.BUILD_CONFIGURATION)
.allArtifactsReports
.getArtifactsReports(null, false)
.localFile + applicationJars

Message.debug("Resolved jars for [build]: ${{->jarFiles.join('\n')}}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class PluginInstallEngine {
errorHandler "Failed to resolve plugins."
}
else {
for (ArtifactDownloadReport ar in report.allArtifactsReports) {
for (ArtifactDownloadReport ar in report.getArtifactsReports(null, false)) {
def arName = ar.artifact.moduleRevisionId.name
if (plugins.any { it.name == arName }) {
installPlugin ar.localFile
Expand Down Expand Up @@ -363,7 +363,7 @@ You cannot upgrade a plugin that is configured via BuildConfig.groovy, remove th
errorHandler("Failed to install plugin [${pluginName}]. Plugin has missing JAR dependencies.")
}
else {
addJarsToRootLoader resolveReport.allArtifactsReports.localFile
addJarsToRootLoader resolveReport.getArtifactsReports(null, false).localFile
}
}
}
Expand Down Expand Up @@ -540,7 +540,7 @@ You cannot upgrade a plugin that is configured via BuildConfig.groovy, remove th
private void resolveDependenciesAgain() {
for (type in ['compile', 'build', 'test', 'runtime']) {
def existing = settings."${type}Dependencies"
def all = settings.dependencyManager.resolveDependencies(IvyDependencyManager."${type.toUpperCase()}_CONFIGURATION").allArtifactsReports.localFile
def all = settings.dependencyManager.resolveDependencies(IvyDependencyManager."${type.toUpperCase()}_CONFIGURATION").getArtifactsReports(null, false).localFile
def toAdd = all - existing
if (toAdd) {
existing.addAll(toAdd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ final class PluginResolveEngine {
return null
}

def reports = report.allArtifactsReports
def reports = report.getArtifactsReports(null, false)
def artifactReport = reports.find { it.artifact.attributes.organisation == resolveArgs.group && it.artifact.name == resolveArgs.name && (pluginVersion == null || it.artifact.moduleRevisionId.revision == pluginVersion) }
if(artifactReport == null) {
artifactReport = reports.find { it.artifact.name == pluginName && (pluginVersion == null || it.artifact.moduleRevisionId.revision == pluginVersion) }
Expand Down Expand Up @@ -132,8 +132,8 @@ final class PluginResolveEngine {
}
}
def report = dependencyManager.resolvePluginDependencies('runtime', [download:false])
if (!report.hasError() && report.allArtifactsReports) {
ArtifactOrigin origin = report.allArtifactsReports.origin.first()
if (!report.hasError() && report.getArtifactsReports(null, false)) {
ArtifactOrigin origin = report.getArtifactsReports(null, false).origin.first()
def location = origin.location
def parent = location[0..location.lastIndexOf('/')-1]
for (DependencyResolver dr in dependencyManager.chainResolver.resolvers) {
Expand Down Expand Up @@ -172,11 +172,11 @@ final class PluginResolveEngine {

report = dependencyManager.resolvePluginDependencies()

if (report.hasError() || !report.allArtifactsReports) {
if (report.hasError() || !report.getArtifactsReports(null, false)) {
return null
}

return new XmlSlurper().parse(report.allArtifactsReports.localFile.first())
return new XmlSlurper().parse(report.getArtifactsReports(null, false).localFile.first())
}
}
}