mojohaus / jaxb2-maven-plugin

JAXB2 Maven Plugin
https://www.mojohaus.org/jaxb2-maven-plugin/
Apache License 2.0
106 stars 77 forks source link

Default source directory for xsd files appears to be src/main/xjb, not src/main/xsd #65

Closed GaryAitken closed 6 years ago

GaryAitken commented 7 years ago

The default source directory for the xjc goal appears to be "src/main/xjb", not "src/main/xsd". If a single file is specified in with no path, e.g. "Foo.xsd", the file is treated as non-existent with the INFO messages: [INFO] Ignored given or default sources [Foo.xsd], since it is not an existent file or directory. [INFO] Ignored given or default xjbSources [/home/user/project/src/main/xjb], since it is not an existent file or directory. [INFO] No changes detected in schema or binding files - skipping JAXB generation. The examples page for the plugin http://www.mojohaus.org/jaxb2-maven-plugin/Documentation/v2.2/example_xjc_basic.html states that the default directory is "src/main/xsd" under "Example 4".

arend-von-reinersdorff commented 7 years ago

The xjc goal has two parameters:

The message is about the second parameter. I think the message is confusing and should not be written as INFO output, maybe at DEBUG.

The plugin seems to resolve relative paths against the project's base directory. For your example, the source file should be configured as src/main/xsd/Foo.xsd.

lennartj commented 6 years ago

Actually, Example 6 on the same side documents the XJB files, default directory as well as provides examples from POM and XJB files.