0
    <plugin>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-codegen-plugin</artifactId>
         <version>3.3.0</version>
         <dependencies>
             <dependency>
                 <groupId>org.slf4j</groupId>
                 <artifactId>slf4j-log4j12</artifactId>
                 <version>2.0.7</version>
             </dependency>
         </dependencies>
         <executions>
             <execution>
                 <id>generate-sources</id>
                 <phase>generate-sources</phase>
                 <configuration>
                     <sourceRoot>${basedir}/target/generated/cxf</sourceRoot>
                     <wsdlRoot>${basedir}/src/main/resources/wsdl</wsdlRoot>
                     <includes>
                         <include>*.wsdl</include>
                     </includes>
                     <systemProperties>
                         <property>
                             <name>log4j.configuration</name>
                             <value>${basedir}/src/main/resources/log4j.properties</value>
                         </property>
                     </systemProperties>
                 </configuration>
                 <goals>
                     <goal>wsdl2java</goal>
                 </goals>
             </execution>
         </executions>
     </plugin>

The above is the plugin in question, it currently produces sources, but does not log anything. Everything else in our codebase is tooled up to use log4j so that's what I want to use simply for consistency. I am happy with the idea that we need to use log4j via slf4j. However currently it gives the following warnings and no more information.

[INFO] --- cxf-codegen-plugin:3.3.0:wsdl2java (generate-sources) @ my-foo-project ---
[INFO] Running code generation in fork mode...
[INFO] The java executable is C:\Program Files\Eclipse Adoptium\jdk-11.0.19.7-hotspot\bin\java.exe
[INFO] Building jar: C:\Users\me-foo-bar\AppData\Local\Temp\cxf-tmp-16966806041345161397\cxf-codegen1104325003669032058.jar
[WARNING] log4j:WARN No appenders could be found for logger (org.apache.cxf.common.logging.LogUtils).
[WARNING] log4j:WARN Please initialize the log4j system properly.
[WARNING] log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

I have tried the advice at http://logging.apache.org/log4j/1.2/faq.html#noconfig and have found it to be somewhat useless.

So far I have tried a bunch of solutions, it appears that the main issue is that regardless of what I put in META-INF/cxf/org.apache.cxf.Logger or src/main/resources it appears to simply ignore those things. It also appears to ignore me providing vm args pointing to the log4j file. I'm simply running this via git bash.

0 Answers0