Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven - ERROR StatusLogger No log4j2 configuration file found

When running mvn verify I am getting below message:

enter image description here

I already put the log4j2.xml under src/test/resources (but not in src/main/resources because I do not want it to ship with actual app) as suggested here to no avail.

enter image description here

The HTML report is generated, the log file is written, and the build is successful as seen above. I am unsure where the error is coming from.

like image 781
silver Avatar asked Mar 18 '18 12:03

silver


2 Answers

According http://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticConfiguration adding log4j2.xml to classpath should help.

If a JSON file cannot be located the XML ConfigurationFactory will try to locate log4j2.xml on the classpath.

So if you still get ERROR message problem not with your sources. It looks like problem in maven-cucumber-reporting plugin. As described here http://maven.apache.org/guides/mini/guide-maven-classloading.html

Please note that the plugin classloader does neither contain the dependencies of the current project nor its build output.

If maven plugin cannot find any log4j configuration in its own classpath (which is not including your sources/resources) you will see error messages. So yes, the only solution wait for release with fix https://github.com/damianszczepanik/cucumber-reporting/issues/675

like image 59
Yuriy Alevohin Avatar answered Oct 29 '22 17:10

Yuriy Alevohin


You use the latest Cucumber version 3.15.0 (at the time of writing this). Your problem was resolved as issue #675. There was a commit from a pull request meant to fix this problem, but probably you have to wait until the next version is released in order to profit from it - or build a snapshot version locally and see if it also fixes the problem for you.

like image 44
kriegaex Avatar answered Oct 29 '22 19:10

kriegaex