Search code examples
cxfmaven-plugin

Maven cxf plugin logging


I'm using the Apache cxf maven plugin (v3.3.0) to successfully to generate java wrappers.

However, the output from the maven build contains thousands of DEBUG logging lines from the wsdl2java which I am unable to remove. Is there an extraarg or other way to silence the process so I get just a success (or possibly failure) message?

<plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>${cxf.version}</version>
    <executions>
        <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
                <sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
                <defaultOptions>
                    <autoNameResolution>true</autoNameResolution>
                </defaultOptions>
                <wsdlOptions>
                    <!--Some Web Service -->
                    <wsdlOption>
                        <wsdl>https://some/web/service.wsdl</wsdl>
                        <extraargs>
                            <extraarg>-client</extraarg>
                            <extraarg>-quiet</extraarg>
                            <extraarg>-p</extraarg>
                            <extraarg>com.foo.bar</extraarg>
                        </extraargs>
                    </wsdlOption>
                </wsdlOptions>
            </configuration>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Solution

  • Sorry for not getting into the root solutions, but adding this in my dependencies help:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-logging</artifactId>
            </exclusion>
        </exclusions>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-log4j2</artifactId>
        <scope>provided</scope>
    </dependency>
    

    or put following in plugin execution helps too except for velocity logs

    <additionalJvmArgs>
        -Dorg.apache.cxf.Logger=null
    </additionalJvmArgs>
    

    Hope this would give a hints for someone to come out with a much proper solution.