Skip to content

schemaDirectory/schemaIncludes don't seem to work as expected #580

Open
@robertpatrick

Description

@robertpatrick

I have an existing Java project that uses JAXB 2.x that I am trying to move to JAXB 3.0 and as such, have modified the project to use the org.jvnet.jaxb:jaxb-maven-plugin:3.0.2 plugin's generate goal.

The schemas are located in subdirectories under src/main/resources. For example:

src/main/resources/com/mycompany/package1/package1.xsd
src/main/resources/com/mycompany/package2/package2.xsd
src/main/resources/com/mycompany/package3/package3.xsd

I have tried all sorts of values for schemaDirectory and schemaIncludes and nothing seems to work since I get this message from running the build:

[INFO] --- jaxb:3.0.2:generate (generate-package1-classes) @ comdev ---
[WARNING] No schemas to compile. Skipping XJC execution. 

My plugin declaration is pretty simple so I do not understand why this isn't working:

            <plugin>
                <groupId>org.jvnet.jaxb</groupId>
                <artifactId>jaxb-maven-plugin</artifactId>
                <version>3.0.2</version>
                <executions>
                    <execution>
                        <id>generate-package1-classes</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <specVersion>3.0</specVersion>
                            <episodeFile>src/main/resources/jaxb-episode.xsl</episodeFile>
                            <schemaDirectory>src/main/resources/com/mycompany/package1</schemaDirectory>
                            <schemaIncludes>
                                <include>package1.xsd</include>
                            </schemaIncludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

If I place all of my schema in src/main/resources directly and remove the schemaDirectory and schemaIncludes, the plugin finds the schemas and is able to compile them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions