对于所有给定的 XSD,jaxb2-maven-plugin 不会生成 package-info.java 文件。(它只生成类)。我们仍然使用 Java 1.8
我的 pom 看起来像这样:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<locale>en</locale>
<outputDirectory>${project.build.directory}/generated-sources/jaxb</outputDirectory>
<extension>true</extension>
<encoding>UTF-8</encoding>
<target>2.1</target>
<verbose>false</verbose>
<clearOutputDir>false</clearOutputDir>
<extension>true</extension>
<noGeneratedHeaderComments>true</noGeneratedHeaderComments>
<generateEpisode>false</generateEpisode>
<addGeneratedAnnotation>true</addGeneratedAnnotation>
<xjbSources>
<xjbSource>res/bindings.xml</xjbSource>
</xjbSources>
<noPackageLevelAnnotations>false</noPackageLevelAnnotations>
</configuration>
<executions>
<execution>
<id>services</id>
<phase>generate-sources</phase>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<packageName>common.input.services</packageName>
<sources>
<source>${project.basedir}/src/main/xsd/ServiceCatalogue.xsd</source>
</sources>
</configuration>
</execution>
...
有任何想法吗?