我有一些XSD文件,我尝试使用属性java.util.List的setter生成Java Class(Jaxb)。
我有这个pom.xml:
<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>
<schemaDirectory>src/main/resources/here</schemaDirectory>
<generatePackage>ws</generatePackage>
<includeSchema>${basedir}/src/main/resources/file.xsd</includeSchema>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.10.0</version>
</plugin>
</plugins>
</configuration>
</plugin>
我已添加,但无法识别此参数:
<arg>-Xcollection-setter-injector</arg>
你知道怎么做吗?
谢谢,
答案 0 :(得分:1)
我认为您错过了configuration
参数extension
。
<extension>true</extension>
<强>的pom.xml 强>
<configuration>
<extension>true</extension>
<args>
<arg>-Xsimplify</arg>
<arg>-Xcollection-setter-injector</arg>
</args>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.11.0</version>
</plugin>
</plugins>
</configuration>