I want to use jaxb2 plugin to generate a WSDL accessible from a secure URL (basic authentication with user id and password).
Where should I specify the credentials to generate the schema? Without providing them, I get one 401 error during schema generation.
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.13.1</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaLanguage>WSDL</schemaLanguage>
<generatePackage>hello.wsdl</generatePackage>
<schemas>
<schema>
<url>http://www.webservicex.com/stockquote.asmx?WSDL</url>
</schema>
</schemas>
</configuration>
</plugin>
HTTP authentication to download schemas is currently not supported, and a pull request to add it was declined, so it won't be implemented. This is because it is always preferable to download the WSDL and work on it locally, rather than downloading it during each build:
There is a somewhat hacky way to do this with Apache CXF Codegen Plugin instead, but I really wouldn't recommend it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With