Closed felixgao closed 6 years ago
Same problem here. My log shows something like this
> Task :xsd-dependency-tree UP-TO-DATE
> Task :xjc FAILED
XajbXjc.manager
field is mapped to use project.jaxb.dependencyGraph but that one is only set from xsd-dependency-tree
action execution. But if that preceding task is UP-TO-DATE it is left with null
and xjc
fails.
Felt on the same issue. No workaround right?
Same for me when using --info to get more clues about what's going on I can see that the plugin is looking for schemas in the default xsdDir path rather than my custom "src/main/schemas"
We have tracked down what is causing this and there will be a fix forthcoming. It basically boils down to the Inputs for the dependency tree task are not complete and the task is not always running when it needs to. This was introduced in during the updates to make the Up To Date checks work with Gradle 4.x. During our investigation, we decided there was no need for this to have ever been a separate task, so it will just be merged into the xjc task.
The short-term workaround is to perform a cleanXsd-dependency-tree
anytime there is a modification to a schema or bindings file. This will force the dependency tree to be generated.
This is a duplicate of #36 .
The up-to-date checks are greatly welcomed. In 2.4 gradle always executed some tasks even if there really should have been nothing to do. 2.5 now correctly says everything is up-to-date on a second build invocation. However we are also bitten by this issue - at least I guess so: The error for us is "Cannot get property 'treeRoot' on null object" (which has been mentioned in relation to this bug at https://github.com/rackerlabs/gradle-jaxb-plugin/issues/36).
Will there be a 2.5.1 sometimes soon?
@eekboom This is a side project that we started maintaining since it was previously abandoned and PR's were just sitting. We do dogfood this plugin and have run into this issue occasionally. However, the the pain threshold has not been reached to force it to bubble to the top of our backlog. That said, I can't give you a good date for a bug fix release. Maybe during our 4'th quarter hack day.
We are more than happy to accept PR's if this is something you think you might want to tackle.
@wdschei Why is this closed if this is not fixed? Pain is super high for us. The XSD generation project is super slow and failure in another component makes rebuilding the project fail on XSD generation part with this error. We are forced to do gradle clean and rebuild the complete project to solve the issue.
@ghilainm It is a duplicate.
Trying to use the jaxb plugin and my xsd file is located at src/main/resources/schema/axml.xsd
The interesting part of the gradle file is the following
./gradlew --version
when I run ./gradlew --stacktrace :xjc
Not sure what it is actually looking for since the doc does not mention anything regarding the 'managedNodes' property.