【问题标题】:How to run xjc -nv in java如何在java中运行xjc -nv
【发布时间】:2018-05-17 12:19:21
【问题描述】:

我有一个相当大的 .xsd。我在使用 xjc 创建类时遇到了问题。出现以下错误:

[ERROR] Current configuration of the parser doesn't allow a maxOccurs attribute value to be set greater than the value 5,000.

我使用 xjc -nv 做了一个解决方法。

我目前正在尝试通过 maven 创建 java 类。

<build>
<plugins>
  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxb2-maven-plugin</artifactId>
    <version>2.2</version>
    <executions>
      <execution>
        <id>xjc</id>
        <goals>
          <goal>xjc</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <!-- The package of your generated sources -->
    </configuration>
  </plugin>
</plugins>

每当我编译项目时,都会出现错误。

有没有办法让 maven 也使用 -nv 参数?

【问题讨论】:

标签: java maven jaxb pom.xml xjc


【解决方案1】:

所以解决方案就在我眼前。 你只需要添加

<arguments>-nv</arguments>

到 pom.xml 里面的配置。

【讨论】:

    猜你喜欢
    • 2019-03-08
    • 2019-06-15
    • 2013-06-23
    • 1970-01-01
    • 2022-07-19
    • 2020-04-02
    • 1970-01-01
    • 2020-01-24
    • 1970-01-01
    相关资源
    最近更新 更多