Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
robertpatrick opened this issue Dec 10, 2024 · 3 comments
Open

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

robertpatrick opened this issue Dec 10, 2024 · 3 comments
Labels
jaxb3 Issue with jaxb 3.x question

Comments

@robertpatrick
Copy link

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.

@laurentschoelens laurentschoelens added question jaxb3 Issue with jaxb 3.x labels Dec 11, 2024
@robertpatrick
Copy link
Author

Same issue with 4.0.8. Can someone please explain how these configuration parameters are supposed to work?

@laurentschoelens
Copy link
Collaborator

Hi @robertpatrick

I'll try to reproduce your issue and see what could be wrong in your configuration.

Regards,
Laurent

@laurentschoelens
Copy link
Collaborator

Could you provide with a MRE (Minimal Reproductible Exemple) please ? I didn't manage to get the same problem as yours 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jaxb3 Issue with jaxb 3.x question
Projects
None yet
Development

No branches or pull requests

2 participants