代码之家  ›  专栏  ›  技术社区  ›  Walter Kuhn

jaxb2 maven插件未生成package-info.java

  •  1
  • Walter Kuhn  · 技术社区  · 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>
    ...
    

    1 回复  |  直到 8 年前
        1
  •  2
  •   Selaron Egesa Michael    8 年前

    ServiceCatalogue.xsd 不使用声明目标命名空间 targetNamespace 和 xmlns 中的属性 <xsd> 根元素。

    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
      xmlns="https://stackoverflow.com/ServiceCatalogue.xsd"
      targetNamespace="https://stackoverflow.com/ServiceCatalogue.xsd"
    >
    ....
    </xsd>