RE: 7.1 Theme building with maven and sass errors

Ben Collins, modified 6 Years ago. New Member Posts: 17 Join Date: 2/16/18 Recent Posts

I'm still trying to get theme development working with Liferay 7.1 and Maven and whilst I've made some progress it's still not 100%, i'm having to hack a few things which I don;t like to do, so I'm looking for advice/pointers incase I am missing something. 

 

This is where I am at now:

  • I have used the Maven archetype to build the project
  • I have updated the pom file to include the latest versions of the styled and unstyled themes through the dependencies section (by default the css builder includes the old 7.0 theme files, which generate css for AUI not Clay, as required by 7.1)

However the one stumbling block is still that I can't get the SASS files to build without me hacking a few things. 

This is the error I get:

[ERROR] Failed to execute goal com.liferay:com.liferay.css.builder:2.1.3:build (default) on project mellon-public-theme: Error: It's not clear which file to import for '@import "bootstrap/bootstrap"'.
[ERROR] Candidates:
[ERROR] bootstrap/bootstrap.scss
[ERROR] bootstrap/bootstrap.css
[ERROR] Please delete or rename all but one of these files.
[ERROR] on line 4 of target/build-theme/css/clay/bootstrap.scss
[ERROR] >> @import "bootstrap/bootstrap";

 

Now I *can* get around this by adding my own copy of "/css/clay/bootstrap.scss" and editing it to change the import line to say @import "bootstrap/bootstrap.scss"; and this error goes away but:

  1. I don't want to have to hack files like this
  2. i also have to do this for a number of files across the theme

I believe the issue is because the source has the file /css/clay/bootstrap/boostrap.scss, and because the file doesn't start with an underscore it will generate the file bootstrap.css during the sass build process. This then means we have two files called bootstrap (.css and .scss) which then causes the issue i am getting.

 

So... the questions:

  • Am i missing something simple here?
  • Is anyone else seeing this?
  • Is this a bug in the theme source files or something on my side?

 

Thanks,

Ben

 

ps if anyone wants to see how i go the theme project to import the 7.1 styled/unstyled resources just let me know...

 

 

 

Ben Collins, modified 6 Years ago. New Member Posts: 17 Join Date: 2/16/18 Recent Posts
No-one else seeing this? 
Alexander Wolf, modified 6 Years ago. New Member Posts: 14 Join Date: 8/18/16 Recent Posts
Got the same Problem in Liferay 7.2

Edit: The Problem was resolved after upgrading Maven Plugin com.liferay.css.builder v 2.1.3 --> v 3.0.0
Ben Collins, modified 6 Years ago. New Member Posts: 17 Join Date: 2/16/18 Recent Posts
Thanks for the comment - i will try this myself shortly!