首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jaxb2-maven-plugin不生成包-info.java

jaxb2-maven-plugin不生成包-info.java
EN

Stack Overflow用户
提问于 2018-11-07 10:41:34
回答 1查看 1.2K关注 0票数 1

对于所有给定的XSD,jaxb2-maven-plugin不生成包info.java文件。(它只生成类)。我们仍然使用Java1.8

我的pom是这样的:

代码语言:javascript
复制
           <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>
...

有什么想法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-11-07 11:29:14

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

例如:

代码语言:javascript
复制
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns="https://stackoverflow.com/ServiceCatalogue.xsd"
  targetNamespace="https://stackoverflow.com/ServiceCatalogue.xsd"
>
....
</xsd>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53187844

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档