You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "matrei (via GitHub)" <gi...@apache.org> on 2025/12/16 15:39:42 UTC
[PR] Add app class to `urlMappingsReport` task args [grails-core]
matrei opened a new pull request, #15295:
URL: https://github.com/apache/grails-core/pull/15295
Closes #15286
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add app class to `urlMappingsReport` task args [grails-core]
Posted by "matrei (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add app class to `urlMappingsReport` task args [grails-core]
Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei merged PR #15295:
URL: https://github.com/apache/grails-core/pull/15295
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add app class to `urlMappingsReport` task args [grails-core]
Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on code in PR #15295:
URL: https://github.com/apache/grails-core/pull/15295#discussion_r2626229018
##########
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:
And it seems that the `META-INF/services/grails-factories.properties` file in `grails-web-url-mappings` is moot as `GlobalGrailsClassInjectorTransformation` creates `META-INF/grails-factories.properties` files dynamically.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add app class to `urlMappingsReport` task args [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on code in PR #15295:
URL: https://github.com/apache/grails-core/pull/15295#discussion_r2627253518
##########
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?
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add app class to `urlMappingsReport` task args [grails-core]
Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on code in PR #15295:
URL: https://github.com/apache/grails-core/pull/15295#discussion_r2626084147
##########
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:
@jdaugherty Yes, you are right. I was not aware of this factory loading. I'll update the PR to utilize this functionality instead.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add app class to `urlMappingsReport` task args [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on code in PR #15295:
URL: https://github.com/apache/grails-core/pull/15295#discussion_r2628262202
##########
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:
Ah, good point. We can't do that since we have a central one. Alright, let's leave it.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add app class to `urlMappingsReport` task args [grails-core]
Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on code in PR #15295:
URL: https://github.com/apache/grails-core/pull/15295#discussion_r2626166537
##########
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:
So, the problem seems to be that `grails-web-url-mappings` which contains the `UrlMappingsReportCommand` class and also registers that class as a command in `META-INF/services/grails.factories` is currently not added to the build classpath in Grails applications.
The `SchemaExportCommand` from `grails-data-hibernate5` is picked up as we explicitly add it to the buildscript block.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add app class to `urlMappingsReport` task args [grails-core]
Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on code in PR #15295:
URL: https://github.com/apache/grails-core/pull/15295#discussion_r2626166537
##########
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:
So, the problem seems to be that `grails-web-url-mappings` which contains the `UrlMappingsReportCommand` class and also registers that class as a command in `META-INF/services/grails-factories.properties` is currently not added to the build classpath in Grails applications.
The `SchemaExportCommand` from `grails-data-hibernate5` is picked up as we explicitly add it to the buildscript block.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add app class to `urlMappingsReport` task args [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on code in PR #15295:
URL: https://github.com/apache/grails-core/pull/15295#discussion_r2623875670
##########
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:
So why do we have to even register a custom command here? Why isn't the UrlMappingsReportCommand being found by `configureApplicationCommands` in `GrailsGradlePlugin`?
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add app class to `urlMappingsReport` task args [grails-core]
Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on code in PR #15295:
URL: https://github.com/apache/grails-core/pull/15295#discussion_r2626229018
##########
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:
And it seems that the `META-INF/services/grails.factories` file in `grails-web-url-mappings` is moot as `GlobalGrailsClassInjectorTransformation` creates `META-INF/grails.factories` files dynamically.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add app class to `urlMappingsReport` task args [grails-core]
Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on code in PR #15295:
URL: https://github.com/apache/grails-core/pull/15295#discussion_r2626166537
##########
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:
So, the problem seems to be that `grails-url-mappings` which contains the `UrlMappingsReportCommand` class and also registers that class as a command in `META-INF/services/grails-factories.properties` is currently not added to the build classpath in Grails applications.
The `SchemaExportCommand` from `grails-data-hibernate5` is picked up as we explicitly add it to the buildscript block.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org