Comments (5)
I've been meaning to add a convention object, but time has not allowed it. Think it would be easy to add just to be able to change the schemaDir. Not sure how it would work with the dynamic nature of the source sets.
JaxbSourceDirectory is not a normal plugin convention as one is created for each source set. So it is more a convention object for each JAXB source drectory set. So a plugin convention would be a new object :-)
Good point about changing the default from jaxb to xsd. A little narrowminded of me. That, at least, is a very easy fix.
from gradle-jaxb-plugin.
I have been able to work around the issue by adding this code to my build:
project.convention.plugins.java.sourceSets.all { SourceSet sourceSet ->
sourceSet.jaxb { srcDir 'src/main/xsd' }
}
Maybe something like this be nice to have?
sourceSets {
main {
xsd { srcDir 'src/main/xsd' }
}
}
from gradle-jaxb-plugin.
I'm afraid your sourceSets.all
thing only works when you only have schemas in the main source directory set. An example:
sourceSets {
main {
...
}
customer1 {
...
}
customer2 {
...
}
}
Here you have 3 source sets which normally has 3 schema source directory sets:
src/main/jaxb
src/customer1/jaxb
src/customer2/jaxb
If you had applied your sourceSets.all
thing on such a project, you would only get 1 source directory (src/main/xsd
)
for all source sets, which was not your intention, I would guess.
But you can actually change the directory properly for multiple source sets with the current version of the plugin, just like what
you have done in the second block, but with jaxb
as the source directory set name instead of xsd
:
sourceSets {
main {
jaxb { srcDir 'src/main/xsd' }
}
customer1 {
jaxb { srcDir 'src/customer1/xsd' }
}
customer2 {
jaxb { srcDir 'src/customer2/xsd' }
}
}
So when this issue is closed, the previous code block will be the standard setup, that is, the directory for the schemas will be
src/<source set name>/xsd
from gradle-jaxb-plugin.
Regarding your wish for this:
sourceSets {
main {
xsd { <some overrides> }
}
}
I think this is better:
sourceSets {
main {
jaxb { <some overrides> }
}
}
As it is a source directory set for the JAXB plugin, it is better to name it jaxb
than xsd
.
from gradle-jaxb-plugin.
Changing the default source directory to .../xsd is moved into its own issue.
Then the rest of this issue is solved by using the options available in source sets as shown in previous comments.
from gradle-jaxb-plugin.
Related Issues (20)
- Do not force jaxb-xjc to be in compile configuration HOT 2
- Add feature for adding a catalog.cat HOT 1
- Create issue for xjc failing in separate compilation for packages
- Do not enable verbose mode for XJC Ant task HOT 1
- Should be possible to use XJC plugins HOT 1
- Set the encoding name for generated sources
- Release notes
- Failure due to external resource restriction in recent Java 7/8 HOT 6
- Publish a new release? HOT 1
- Questions about the "Usage" section HOT 1
- Question (2) about the usage section
- Usage
- Cannot get plugin to work
- gradle-jaxb-plugin pulls down jaxb, I want to use JDK native jaxb integration
- Dead project HOT 2
- jaxb source sets
- This plugin is broken & hangs with JDK 1.6
- Project dead confirmation
- ear
- Change the default source directory to .../xsd
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-jaxb-plugin.