[ 
https://issues.apache.org/jira/browse/CXF-8998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18098335#comment-18098335
 ] 

Freeman Yue Fang commented on CXF-8998:
---------------------------------------

Hi Karl, 

Thanks for tracking down the root cause!

I think this can be explained by ClassLoaderSwitcher.switchClassLoader() 
(maven-plugins/codegen-plugin/.../ClassLoaderSwitcher.java:85): when 
useCompileClasspath is false (the default), it builds the classloader used to 
run wsdl2java — Velocity included — from project.getTestArtifacts(), so 
TEST-scoped dependencies end up on that classpath. If your project has a 
TEST-scope SLF4J binding (e.g. slf4j-simple), it becomes the active logger 
during code generation and prints Velocity's normally-swallowed INFO init 
messages. That also explains why I couldn't reproduce it with the plain 
wsdl_first sample earlier — it doesn't carry that test dependency.

Before we consider changing the Mojo's default ResolutionScope (which would 
affect every user's default classpath being there over decades, not just this 
case), can you try the existing useCompileClasspath option, which was added for 
exactly this kind of clash?

{code}
-Dcxf.useCompileClasspath=true
or
<configuration>
  <useCompileClasspath>true</useCompileClasspath>
</configuration>
{code}
And this option is introduced by CXF-1212.

If that resolves the debug output for you, I'd lean toward this being a 
documentation issue rather than a code fix — we could improve the plugin docs 
to call this out explicitly. If it doesn't resolve it, that'd tell us something 
else is going on and we should look further.

Best Regards
Freeman

> cxf-codegen-plugin - debug output velocity
> ------------------------------------------
>
>                 Key: CXF-8998
>                 URL: https://issues.apache.org/jira/browse/CXF-8998
>             Project: CXF
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 4.0.4
>            Reporter: Karl Heinz Marbaise
>            Priority: Minor
>
> Currently we are using {{cxf-codegen-plugin}}, which produces allways 
> debugging output of velocity, on the console
> {code}
> 15:59:45  [INFO] 
> 15:59:45  [INFO] --- cxf-codegen:4.0.4:wsdl2java (default) @ wsdls ---
> 15:59:45  [INFO] Running code generation in fork mode...
> 15:59:45  [INFO] bin/java
> 15:59:45  [INFO] Building jar: /tmp/cxf-tmp-77777/cxf-codegenxxxx.jar
> 15:59:45  [WARNING] Picked up JAVA_TOOL_OPTIONS: .....
> 15:59:46  [INFO] 15:59:46.356 [main] DEBUG org.apache.velocity -- 
> Initializing Velocity, Calling init()...
> 15:59:46  [INFO] 15:59:46.360 [main] DEBUG org.apache.velocity -- Starting 
> Apache Velocity v2.3
> 15:59:46  [INFO] 15:59:46.362 [main] DEBUG org.apache.velocity -- Default 
> Properties resource: org/apache/velocity/runtime/defaults/velocity.properties
> 15:59:53  [INFO] 
> {code}
> Is there an easy way to suppress the debug output for the execution of the 
> plugin?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to