I have written a plugin that creates custom tasks for both XJC and WS Import to generate Java code from schema (XSD) and web service (WSDL) files.
In the plugin portion, I define a few configurations to make dependencies between projects easy to manage, but I ran into an issue when I had a web service that defined more than one schema (’*.xsd’) file. In particular, I create two configurations that are related:
- ‘schemaFiles’ configuration is created on the project without applying anything to it. 2. ‘schemaFilesZip’ configuration is created on the project and it is extended by ‘archives’.
The ‘schemaFilesZip’ configuration is meant for incoming dependencies and it is automatically formed as a single zip file containing everything in the ‘schemaFiles’ configuration. This works well when deploying to repositories like Nexus that rename artifacts, which is difficult to undo without a lot of extra information.
My problem is that I am defining my ‘schemaFiles’ configuration like so:
artifacts {
schemaFiles new File(wsImport.wsdlsDir, "ws.v1.wsdl"),
new File(wsImport.wsdlsDir, "schema1.v1.xsd"),
new File(wsImport.wsdlsDir, "schema2.v1.xsd")
}
This works for compilation and dependencies quite well. However, when ‘uploadArchives’ is used, it automatically attempts to upload each file, which fails because it cannot submit two ‘*.xsd’ files with the same classifier.
My goal is to avoid uploading the ‘schemaFiles’ configuration at all, but I don’t know how to disable ‘uploadArchives’ for it or otherwise specify the inputs without it automatically happening (e.g., some block that works like ‘artifacts’ for defining configuration inputs that I am unaware of).