简体   繁体   English

Java 类不是使用 maven-jaxb2-plugin 从 wsdl 文件生成的

[英]Java classes are not generated from wsdl file using maven-jaxb2-plugin

I'm trying to generate request/response classes using jaxb2-maven-plugin but I'm really struggling with it.我正在尝试使用 jaxb2-maven-plugin 生成请求/响应类,但我真的很挣扎。 I use code below to try and generate the classes but for some reason only thing that is generated is episode file.我使用下面的代码来尝试生成类,但由于某种原因,只生成了剧集文件。 I tried with downloaded wsdl file and also with url but I can't make any of it work.我尝试使用下载的 wsdl 文件和 url,但我无法使其正常工作。

<plugin>
                    <groupId>org.jvnet.jaxb2.maven2</groupId>
                    <artifactId>maven-jaxb2-plugin</artifactId>
                    <version>0.14.0</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <schemaDirectory>src/main/resources</schemaDirectory>
                        <generatePackage>com.example.wsdl</generatePackage>
                        <schemaIncludes>
                          <include>*.wsdl</include>
                        </schemaIncludes>
                        <generateDirectory>src/main/java</generateDirectory>
                    </configuration>
            </plugin>

This one works for me :这个对我有用:

<plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <version>0.14.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                    
                </executions>
                <configuration>
                    <schemaLanguage>WSDL</schemaLanguage>
                    <generatePackage>com.example.consumingwebservice.wsdl</generatePackage>
                    <schemas>
                        <schema>
                            <url>YOUR.URL</url>
                        </schema>
                    </schemas>
                </configuration>
        </plugin>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM