apache / apache/grails-core

Scaffolding should be in resources root?

Open
#10,792 0 comments 0 reactions 0 assignees View on GitHub
status: acknowledged
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

I noticed that during configurePluginResources taks, custom scripts and scaffolding templates are copied to META-INF subfolder of the resources root:
https://github.com/grails/grails-core/blob/cd0fbb1237417476e3b4743e840e3e7f3d3ce332/grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/core/GrailsPluginGradlePlugin.groovy#L198

Resulting package resources folder will have following structure
/resources
- [any_other_folder]
- main
- META-INF
- assets
- commands
- templates

According to [jar file specification](http://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html), META-INF is intended to hold manifests and specific configuration files. On other side Spring use it to store static web assets.
If it is possible, maybe it will be good to move commands and templates folders one level up in order to enforce clean structure of resulting jar. In that case it can also be used as guidance for plugin developers where to store their custom scripts and files (since developers that are 'going with the flow' would end up putting any custom resources in META-INF folder).

BR
Zoran

Contributor guide

Open the contributing guide

Research direction

Start in grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/core/GrailsPluginGradlePlugin.groovy at configurePluginResources. Inspect how commands and templates are copied into the packaged resources, then examine the resulting JAR layout. Done means those folders are placed one level above META-INF while custom plugin resources remain usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
build-system
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.