【问题标题】:How to generate toString method with jaxb2?如何使用 jaxb2 生成 toString 方法?
【发布时间】:2018-04-15 21:47:45
【问题描述】:

我想从我的 wsdl 中重载 toString 方法。

在我的 pom.xml 中

  1. 我在依赖项中添加了它:

    <dependency>
        <groupId>org.jvnet.jaxb2_commons</groupId>
        <artifactId>jaxb2-basics-runtime</artifactId>
        <version>1.11.1</version>
    </dependency>
    
  2. 我在 build/plugins 中添加了这个插件

块引用

<plugin>
    <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <version>0.7.0</version>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <schemaDirectory>${project.build.directory}/wsdl/META-INF/wsdl/</schemaDirectory>
                <schemaIncludes>
                    <include>FrameworkGedServiceMetier.wsdl</include>
                </schemaIncludes>
                <args>
                    <arg>-XtoString</arg>
                    <arg>-Xequals</arg>
                    <arg>-XhashCode</arg>
                    <arg>-Xcopyable</arg>
                </args>
                <plugins>
                    <plugin>
                        <groupId>org.jvnet.jaxb2_commons</groupId>
                        <artifactId>jaxb2-basics</artifactId>
                        <version>1.11.1</version>
                    </plugin>
                </plugins>
            </configuration>
        </plugin> 

我构建 maven 是成功的,但我的类中没有我的方法 toString。

To inspirate me i use this documentation

【问题讨论】:

标签: java maven jaxb pom.xml tostring


【解决方案1】:

我认为那个版本有问题。请尝试:

<version>0.12.0</version>

(看起来1.11.1published by mistake。)

【讨论】:

    猜你喜欢
    • 2018-06-01
    • 1970-01-01
    • 2012-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多