Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: 7.1 Theme building with maven and sass errors
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:
- I don't want to have to hack files like this
- 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...
Edit: The Problem was resolved after upgrading Maven Plugin com.liferay.css.builder v 2.1.3 --> v 3.0.0
Powered by Liferay™