如何使用maven pom中的Apache CXF插件扫描文件夹中的所有模式

时间:2014-05-08 13:20:06

标签: apache maven cxf pom.xml

我正在配置maven pom.xml文件以从xsds生成类,并且我正在使用apache cxf-xjc插件。这是我的配置:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-xjc-plugin</artifactId>
            <version>2.6.0</version>
            <configuration>
                <sourceRoot>${basedir}/src/main/java</sourceRoot>
                <schemaDirectory>${basedir}/resources/schemas</schemaDirectory>
                <xsdOptions>                                                
                    <xsdOption>
                        <extension>true</extension>
                        <xsd>${basedir}/resources/schemas/Schema1.xsd</xsd>
                        <extensionArgs>
                            <extensionArg>-XJsr303Annotations</extensionArg>                                
                        </extensionArgs>                            
                    </xsdOption>
                    <xsdOption>
                        <extension>true</extension>
                        <xsd>${basedir}/resources/schemas/Schema2.xsd</xsd>
                        <extensionArgs>
                            <extensionArg>-XJsr303Annotations</extensionArg>                                
                        </extensionArgs>
                    </xsdOption>
                    <xsdOption>
                        <extension>true</extension>
                        <xsd>${basedir}/resources/schemas/Schema3.xsd</xsd>                            
                        <extensionArgs>
                            <extensionArg>-XJsr303Annotations</extensionArg>                                
                        </extensionArgs>
                    </xsdOption>                        
                </xsdOptions>
                <extensions>
                    <extension>com.github.krasa:krasa-jaxb-tools:1.1</extension>
                </extensions>                    
            </configuration>
            <executions>
                <execution>
                    <id>generate-sources</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>xsdtojava</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

如何摆脱所有<xsdOption>元素,只需设置模式所在的文件夹?

谢谢!

0 个答案:

没有答案