stianh/gradle-jaxb-plugin — Issue #10: Do not force jaxb-xjc to be in compile configuration
Author: mraccola
Created: 2011-12-15 19:13:47+00:00
State: open

The plugin currently requires the jaxb-xjc library to be added to the jaxb Configuration. The compile Configuration inherits from the jaxb Configuration which ultimately means that the jaxb-xjc library MUST be a part of the compile Configuration.

This is unwanted. The jaxb-xjc library is only needed during the build process to generate the Java classes it is not needed to actually compile the code.

One example of an unwanted side effect of this is that if you have a WAR file that depends on the project that has the jaxb plugin applied, the WAR file will end up with a jaxb-xjc.jar file in the WEB-INF/lib, unnecessarily bloating the WAR file. This of course can be worked around by excluding the jaxb-xjc from the War project's compile dependency but this should not be necessary.

Also, in regards to compiling the generated Java files I realize we still need to add the jaxb-api/jaxb-impl JARs to the compile Configuration. Please consider whether it is the job of the jaxb plugin to actual assist in seting up these JARs in the compile Configuration at all? Perhaps it is just expected that the jaxb-api/jaxb-impl will be added to the normal compile Confguration directly like this:

compile ("com.sun.xml.bind:jaxb-impl:2.1.3")

instead of

jaxb ("com.sun.xml.bind:jaxb-impl:2.1.3")

Not saying I have a strong opinion...just a question.