Maven - ERROR StatusLogger No log4j2 configuration file found

silver :

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.

Yuriy Alevohin :

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

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=474903&siteId=1