Wrap 3rdparty task to be incremental

Hi, using gradle 4.5.1 on Java8,

i am trying to integrate this plugin in our build:

it has a task ‘xjc’ that generates .java files from .xsd files. It seems it is not implemented incrementally, meaning it seems to always run, even if inputs have not changed.

Is it possible to “wrap” this in another task that defines the same in and outputs and thus make it incremental with minimal effort?

Hi @Thibault_Kruse,

you don’t need to wrap the task in another task - just use the runtime API to declare the task’s inputs and outputs.



That plugin was abandoned several years ago and my team and I started maintaining a fork off of it. We also publish it to the Plugin Portal and you can find it here:

We updated it for the Gradle v4.x Up-To-Date checks and to play well with some of the security changes in Java 8. There are a few issues with moving to Java 9 and beyond that are on our backlog. There is also an issue handling circular dependencies in the XSD’s, but that is a bad practice anyway so it hasn’t bubbled to the top to fix yet.

@Stefan_Wolf: thx.
@wdschei: BTW, because your fork is known to github as a fork, googling for “gradle jaxb plugin” does not return your fork I believe. If you think the original will not see activity in the future, you could consider deleting your github repository and creating it again fresh without forking it off the original. That way, I believe users will more easily find yours with Google.