matrei commented on code in PR #15295:
URL: https://github.com/apache/grails-core/pull/15295#discussion_r2627320854
##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/web/GrailsWebGradlePlugin.groovy:
##########
@@ -46,19 +44,25 @@ class GrailsWebGradlePlugin extends GrailsGradlePlugin {
super(registry)
}
- @CompileDynamic
@Override
void apply(Project project) {
super.apply(project)
-
- TaskContainer taskContainer = project.tasks
- if (taskContainer.findByName('urlMappingsReport') == null) {
- FileCollection fileCollection = buildClasspath(project,
project.configurations.runtimeClasspath, project.configurations.console)
- taskContainer.create('urlMappingsReport',
ApplicationContextCommandTask) {
- classpath = fileCollection
- systemProperty(Environment.KEY,
System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName()))
- command = 'url-mappings-report'
- }
+ project.tasks.register('urlMappingsReport',
ApplicationContextCommandTask) { task ->
Review Comment:
> Shouldn't the gradle web plugin then have it as an api dependency?
I'm not sure you can add a dependency to only one of the published Gradle
plugins. They all share the same dependencies.
It seems that the way these commands are handled by other modules is to add
them to the build dependencies explicitly in the application. For example the
`grails-data-hibernate5` and `grails-data-hibernate5-dbmigration` below:
```groovy
buildscript {
repositories {
mavenCentral()
maven {
url = 'https://repo.grails.org/grails/restricted'
}
}
dependencies { // Not Published to Gradle Plugin Portal
classpath "cloud.wondrify:asset-pipeline-gradle"
classpath platform("org.apache.grails:grails-bom:$grailsVersion")
classpath "org.apache.grails:grails-data-hibernate5"
classpath "org.apache.grails:grails-data-hibernate5-dbmigration"
classpath "org.apache.grails:grails-gradle-plugins"
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]