I am working on TestNG Maven project, This worked for me by adding tag in pom.xml, this happens to be the path of my custom configuration file log4j2.xml.
http://maven.apache.org
UTF-8
UTF-8
src/main/java/resources
true
org.apache.maven.plugins
maven-surefire-plugin
3.0.0-M3
testng.xml