mnd
mnd

Reputation: 2789

Asset Pipeline not including CSS or JS in Grails 3 on external Tomcat 7

I ran into this problem on an application, and was able to reproduce it with a brand new application. Here are the steps I went through.

  1. Create an application with grails create-app new-application. This is using Grails 3.0.3, Groovy 2.4.3 and Java 1.8.0_25.
  2. Modify build.gradle and switch the spring-boot-tomcat-starter from a scope of compile to provided (so that it can run in an external Tomcat 7).
  3. Create the war with gradle clean build.
  4. Transfer the war file to Tomcat's webapp directory.
  5. Start Tomcat
  6. Navigate to the default Grails landing page, and there is no CSS. Check the source, and the javascript and css are not included.

In main.gsp these lines exist:

<asset:stylesheet src="application.css"/>
<asset:javascript src="application.js"/>

But in the source of the loaded page, there are simply blank lines where the CSS and JS should be included.

Any ideas how to get assets to load properly through the Asset Pipeline in Grails 3 using Tomcat 7?

Upvotes: 1

Views: 671

Answers (1)

davydotcom
davydotcom

Reputation: 2210

Use the latest version of Grails 3.0.5 or update to using asset-pipeline:3.0.8

Upvotes: 2

Related Questions