This is an ORCID-Model Java API generated (using JAXB) from the official ORCID XSDs.
Resources:
- ORCID-Model Official XSDs: https://github.com/ORCID/ORCID-Source/tree/master/orcid-model/src/main/resources
All source code in src/main/java/
has been auto-generated (by JAXB) via the official ORCID.org XSDs.
USE AT YOUR OWN RISK. This source code has only been tested with DSpace and may or may not work for other ORCID use cases.
The below will regenerate/update the ORCID Java API stored in the src/main/java
folder of this GitHub repo.
- Clone this
orcid-jaxb-api
repo locally - Clone the ORCID-Source repo (to a different location), and optionally checkout a specific tag:
git clone https://github.com/ORCID/ORCID-Source.git
- Copy the necessary ORCID XSD folders into this repo's
src/main/resources/xsd/
folder. Check the POM<schemaIncludes>
list for the XSDs we need. Be sure not to overwrite the.gitignore
already in the "empty"xsd
folder, as we do NOT want to keep the XSDs in this repo!# Copy over common_2.1 XSDs cp -r [ORCID-Source]/orcid-model/src/main/resources/common_2.1 [orcid-jaxb-api]/src/main/resources/xsd/ # Copy over record_2.1 XSDs cp -r [ORCID-Source]/orcid-model/src/main/resources/record_2.1 [orcid-jaxb-api]/src/main/resources/xsd/
- Build project (with profile
generate-sources-from-jaxb
enabled)cd [orcid-jaxb-api] # WARNING This next line overwrites Java source in ./src/main/java/ mvn -U clean package -Pgenerate-sources-from-jaxb
- Double check the source code generated. If any class names or package names need to be updated, you may need to modify our custom
orcid-2.1.xjb
, as this is the JAXB Binding file used in the code generation process.- Keep an eye out especially for any source code generated under an
ns
package path, as this means a specific XSD was not assigned a package name.
- Keep an eye out especially for any source code generated under an
- If everything looks good, create a PR, noting which version of the ORCID XSDs you used to update the Java source code (e.g. either a specific release number or
master
of a given date)
After regenerating the ORCID Java API (using JAXB and ORCID's XSDs -- see above), you can easily build this project by just running:
mvn -U clean package
The result will be a ./target/orcid-jaxb-api-[version].jar
The project retains the ORCID MIT-Style license, as all code within it is automatically generated from ORCID's XSDs.