RE: buildCSS shows warning about NOP slf4j logging binding

Michael Green, modified 5 Years ago. New Member Posts: 21 Join Date: 3/5/20 Recent Posts
Liferay IDE Version: 3.8.0.202002250521-ga1
Liferay 7.3.1 ga2

A note for other newbies, I was getting this warning from the buildCSS gradle task. Following the link in the error text only describes adding the jar to the classpath and a lot of the google results talk about adding a dependency for your project . Not really anything on how to fix this for the gradle plugin.  So I went down a lot of dead ends before I found the answer.
> Task :modules:guestbook-web:buildCSS
Using native Sass compiler
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Parsed /META-INF/resources/css/main.scss in 336ms

Answer: Add the following line to the build.gradle file of the module project.
     cssBuilder group: "org.slf4j",   name: "slf4j-simple", version:"1.7.10"


Do not put it in the top level build.gradle file of the liferay workspace. This will produce the error:
* What went wrong:
A problem occurred evaluating root project 'gb'.
> Could not find method cssBuilder() for arguments [{group=org.slf4j, name=slf4j-simple, version=1.7.10}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
thumbnail
Gregory Amerson, modified 5 Years ago. Liferay Legend Posts: 1123 Join Date: 2/16/10 Recent Posts
Hello Michael,
Thanks for this report.  However, I was unable to reproduce the problem you are describing.  Can you share with me a standalone workspace repo (on github?) where I could see this?  I'm wondering if its a particular version of gradle/workspace that is causing this to show up.
Michael Green, modified 5 Years ago. New Member Posts: 21 Join Date: 3/5/20 Recent Posts
blade version 3.9.2.202004101340

$ ./gradlew --version

------------------------------------------------------------
Gradle 5.6.4
------------------------------------------------------------

Build time:   2019-11-01 20:42:00 UTC
Revision:     dd870424f9bd8e195d614dc14bb140f43c22da98

Kotlin:       1.3.41
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM:          11.0.2 (Oracle Corporation 11.0.2+9-Debian-3bpo91)
OS:           Linux 4.9.0-8-amd64 amd64



Sure thing I will get something for you in the next couple of days.Also I have just repeated the guestbook tute with the next IDE, liferay portal and I still get this error .
Michael Green, modified 5 Years ago. New Member Posts: 21 Join Date: 3/5/20 Recent Posts
Oh and thanks for following up my posts. 
Michael Green, modified 5 Years ago. New Member Posts: 21 Join Date: 3/5/20 Recent Posts
So in the process of making a cut down version and a store in git I think I have worked out the issues.


The IDE creates a gradle.properties file with:
liferay.workspace.target.platform.version = 7.3.0



This causes the gradle and blade build tools to use the old library and tool config. This can not be changed in the IDE as it only lets you set 7.3 without an option for 7.3.X.

This is probably the cause of a lot of the other posts I have made.

So long story short, it is a config error caused by the IDE and can be fixed by overriding the value on the gradle.properties.

For interest I have add the script I used to cycle through the different versions :https://github.com/micko920/liferay-tests
thumbnail
Gregory Amerson, modified 5 Years ago. Liferay Legend Posts: 1123 Join Date: 2/16/10 Recent Posts
"So long story short, it is a config error caused by the IDE and can be fixed by overriding the value on the gradle.properties."
Can you post a followup with a list of steps how to reproduce this?  @ashley could you follow up with creating a ticket that we could track?  Thanks Michael
Michael Green, modified 5 Years ago. New Member Posts: 21 Join Date: 3/5/20 Recent Posts
The cssBuilder error is not producible with the latest version of blade, gradle and IDE.  
This is just the starting point the other errors listed in https://github.com/micko920/liferay-tests The steps:
  1. Open the IDE and create a blank New Liferay Workspace 
    1. Use the latest version 7.3 and 7.3.0 in the Liferay Version and Target Version
    2. Click the download liferay bundle and use the link for 7.3.2-ga2  https://releases-cdn.liferay.com/portal/7.3.2-ga3/liferay-ce-portal-tomcat-7.3.2-ga3-20200519164024819.tar.gz
    3. The issues do not happen if the download liferay bundle url is left as the default 7.3.0-ga1
  2.  Add a new ServiceBuilder project
  3. perform BuildService task
  4. perform Build task
  5. deploy service builder module to server instance
  6. Once the Server is up and the module deployed and started an error will show up "Could not create output jar" see attach images

Workaround:Change the target version in the gradle.properties file to match the bundle. 

liferay.workspace.target.platform.version = 7.3.2
thumbnail
Gregory Amerson, modified 5 Years ago. Liferay Legend Posts: 1123 Join Date: 2/16/10 Recent Posts
Thanks for the detail,  We will followup soon.
thumbnail
Yanan Yuan, modified 5 Years ago. Junior Member Posts: 89 Join Date: 10/8/11 Recent Posts
Hello Michael,

Thanks for bringing up the problem. I've created the ticket https://issues.liferay.com/browse/IDE-4798, and we've fixed the problem you've run into, which will be included in the next 3.9 Milestone 1 release officially.
Please let us know if anything else and I will share the updatesite file if you would like to try the 3.9 M1 SNAPSHOT version.
Michael Green, modified 5 Years ago. New Member Posts: 21 Join Date: 3/5/20 Recent Posts
Thanks Gregory and Yanan.