我正在使用maven-jaxb-plugin根据xsd文件生成类文件源代码:
<plugin>
<groupId>com.sun.tools.xjc.maven2</groupId>
<artifactId>maven-jaxb-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>jaxb-xsd-constants</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generatePackage>com.mypackage</generatePackage>
<schemaDirectory>${basedir}/src/main/resources/xsd/mylist</schemaDirectory>
<includeSchemas>
<includeSchema>mylist.xsd</includeSchema>
</includeSchemas>
<strict>true</strict>
</configuration>
</execution>
</executions>
</plugin>
然后我需要将这些文件夹添加为源文件夹,以便Eclipse在加载和编译它们时可以使用:
如何使用插件或其他方法将文件夹添加为源文件夹?不必手动添加这些文件夹。