能否指定已解压的FHIR包目录运行IG Publisher工具?
Absolutely! This approach is completely feasible and is a smart optimization to cut out the repetitive 1-2 minute decompression step—you’re totally right that the static FHIR package files don’t need unpacking every time you run the publisher.
Here’s how to implement this smoothly:
Manually extract the package.tgz file first
Use your system’s built-in tools or a utility to unpack the archive into a dedicated directory. For Unix-like systems (Linux/macOS), run this command:tar -xzf package.tgz -C ./package/On Windows, you can use tools like 7-Zip to extract the contents into a folder named
packagein your working directory.Update your IG Publisher command
Replace the-spec package.tgzargument with the path to your extracted directory. Your command will look like this:java -jar org.hl7.fhir.igpublisher.jar -spec ./package/ -ig ig.jsonVerify the setup
Run the updated command and confirm your static documentation generates correctly. It should produce identical output to when you used the.tgzfile, but with a much faster start time.
A few key notes to keep in mind:
- Keep the extracted directory’s full structure intact—don’t delete or modify any files inside. The IG Publisher depends on the complete set of FHIR specification resources and metadata files.
- When you need to update to a newer FHIR STU3 version, re-download the corresponding
package.tgzand extract it over your existingpackagedirectory (avoid patching individual files). - Ensure the path you pass to
-specpoints to the root of the extracted package (where thepackage.jsonfile resides)—this is required for the publisher to locate all resources correctly.
内容的提问来源于stack exchange,提问作者tbsalling

