You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for this plugin, it is well documented and very useful 🎉
I have a minor feature to add: is it possible to add to the -classpath argument via a dedicated configuration?
Let me expand: I tried to use a JAXB plugin and ran into the following problem, where the service loader complains that the requested plugin is not actually an instance of com.sun.tools.xjc.Plugin. The root cause are different classloaders for Plugin and the class that is supposed to be a subtype. The solution is that all plugin JARs must be on the list of -classpath (an argument XJC), and not on the regular classpath from java -cp. See also https://stackoverflow.com/a/28197814.
With the current plugin, one can only add to -classpath by adding dependencies to the compile classpath:
However, I would prefer not to add JAXB plugins to my implementation configuration (or to generally have the JAXB plugin and its dependencies on the compile classpath).
I would suggest to add a dedicated configuration for plugins, like jaxbPlugins, and use that in addition to compileClasspath.
Would you accept a PR for that?
The text was updated successfully, but these errors were encountered:
It is not really visible in the documentation: "It is possible to overwrite the project dependency configuration 'jaxb', if you want use an other version of JAXB. The classpath of the xjc can be extended with a project configuration 'jaxb' and dependencies."
So it is possible to replace all necessary dependencies in the jaxb configuration. That is necessary for the tooling. The class path is necessary for the code generation self and is the xjc parameter -classpath.
Do you want a separate class path configuration for these files?
Thank you very much @m-raab, looking forward to it. Actually, I saw the relevant documentation, but it does not address the problem, because the existing dependency configurations do not add to -classpath (maybe that is a bit clearer).
First of all, thank you for this plugin, it is well documented and very useful 🎉
I have a minor feature to add: is it possible to add to the
-classpath
argument via a dedicated configuration?Let me expand: I tried to use a JAXB plugin and ran into the following problem, where the service loader complains that the requested plugin is not actually an instance of
com.sun.tools.xjc.Plugin
. The root cause are different classloaders forPlugin
and the class that is supposed to be a subtype. The solution is that all plugin JARs must be on the list of-classpath
(an argument XJC), and not on the regular classpath fromjava -cp
. See also https://stackoverflow.com/a/28197814.With the current plugin, one can only add to
-classpath
by adding dependencies to the compile classpath:jaxb-gradle-plugin/src/main/kotlin/com/intershop/gradle/jaxb/task/SchemaToJavaTask.kt
Lines 392 to 395 in a058fae
resp.
jaxb-gradle-plugin/src/main/kotlin/com/intershop/gradle/jaxb/task/SchemaToJavaTask.kt
Lines 326 to 332 in a058fae
However, I would prefer not to add JAXB plugins to my
implementation
configuration (or to generally have the JAXB plugin and its dependencies on the compile classpath).jaxbPlugins
, and use that in addition tocompileClasspath
.The text was updated successfully, but these errors were encountered: