New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
layout/asset issues with distTar/distZip #9102
Comments
Good questions, maybe @davydotcom can chip in with an answer |
This is a good question. It has to do with what is considered "processed" assets and "unprocessed" assets. In a jar/lib/plugin these assets are not processed. They are not minified, nor digested, nor transpired. They are "raw" in this sense in This may be making you ask why they need to be and why we cant preprocess/minify them. The answer is minification only works when you bundle everything together due to the globbing of variable names. Once more it is possible to override things in your application that are not in your lib like say for Bootstrap you might override So your final jar or dist package puts all processed assets in the |
ok. raw vs. processed assets understood so far. 1.
|
the "workaround" does not work reliably and i am at the point that im not sure anymore this has to do wih asset-pipeline. when running the |
I'm seeing the same with the layout Sent from my iPhone
|
@davydotcom thx for confirming the behavior! does it work for you, too, if u run the dist runscript/bat from within the app dir? |
No i get a missing layout issue. It has nothing to do with asset-pipeline that I can tell |
@davydotcom sry to bother u again but trying to find the root cause i commented out the can u confirm that? and maybe you, or @graemerocher any idea what might be going on here? thanks, zyro |
@zyro23 Maybe if an example could be uploaded with steps to reproduce? |
@graemerocher that would be no problem but it would be a blank grails app. steps from initial description still lead to the incompletely rendered view.
|
Ok I see, will investigate.. |
Go to Sent from my iPhone
|
an additional observation:
|
reopened with edited title |
In a Grails 3.0.3 project, adding |
I also experienced the missing-asset problem (the grails logo wasn't displayed, stylesheets weren't applied) when deploying a grails-3.0.4 application via a war file under Tomcat 8, and can confirm that changing the line in build.gradle's dependencies section from
to
(and rebuilding, and redeploying) appears to have resolved those issues. |
this one is not about war deployments on a tomcat but "standalone" |
just checked and issue still present with grails-3.0.5/asset-pipeline-3.0.8 |
Just a note on this, in Grails 3.1 M1 (and Spring Boot 1.3) the TAR / ZIP distributions are no longer built, since we no longer rely on the Gradle |
so it is fair to say fat-jar and war are the recommended/supported ways of building/deploying application artefacts? if so, please go ahead closing this one. if really required, a shell script and/or win bat file launching the fat-jar are quickly written, too. thx! zyro |
Yes it is the recommended way |
currently, app assets are put into
myapp-0.1.jar/assets/...
.that works when used with
java -jar myapp-0.1.jar
.however,
distTar
anddistZip
are building distributions with a structure ofmyappdir/libs/myapp-0.1.jar
where the app jar resides next to the other dependency jars (no fat jar).that again means
myapp-0.1.jar
is searched for assets like a lib jar/binary plugin (META-INF/assets
) and so, the assets are not found.steps to reproduce:
then
http://localhost:8080
will show the defaultindex.gsp
without properly loaded assets.i opened this one here in
grails-core
because it does somehow spangrails-core/grails-gradle-plugin
,asset-pipeline
andasset-pipeline-core
.related question: why are assets not just always put into
META-INF/assets
when a jar is built (no matter if app/lib/plugin)? does the differentiation of putting the app assets into.jar/assets
allow asset-pipeline to distingiush between app assets and lib/plugin assets (overridability)? if so, has that been tested with a multi-module project where the modules are "libs" in the end?thanks, zyro
The text was updated successfully, but these errors were encountered: