Tutorial: Steps to Build a WAR File From Scratch Using Maven

121 views
Skip to first unread message

Mat Davis

unread,
Oct 19, 2025, 11:23:05 PMOct 19
to Edge Test Tool (ETT)
Hi all.

See below for steps and for the threads related to local instance questions since the Government Shutdown.

Thanks - Mat Davis

NOTE: These steps are from a Windows Server perspective

Thread History

Building A WAR File
1. Files I downloaded
  1. maven-mvnd-1.0.3-windows-amd64.zip
  2. Git-2.51.1-64-bit.exe
  3. jdk-8u421-windows-x64.exe
2. Prerequisites
  1. Install Java JDK
    1. https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html
    2. You may/will need to create an account or sign into your account
  2. Install Maven
    1. https://maven.apache.org/download.cgi
  3. Install Git (optional)
    1. https://git-scm.com/downloads
  4. Set your JAVA_HOME path for the System Environment Variables
  5. Set your MAVEN_HOME path for the  System Environment Variables
    2025-10-19 21h16_06_01_hyperv-homeenvvariables.png
  6. Add a new folder --- "C:\Maven"
    1. Copy the extracted contents of the downloaded Maven zip to that folder
    2. Start Menu > Edit the System Environment Variables > System Variables > click Path > click Edit
    3. Add "C:\Maven\bin"
    4. Add your Java > JDK > bin folder > "C:\Program Files\Java\jdk-1.8\bin"
      2025-10-19 21h24_10_01_hyperv-pathvariable.png

  7. Confirm install and configuration success
    1. Start a new CMD Prompt or Powershell session
    2. Run the following command without the double quotes --- "java -version"
    3. Run the following command without the double quotes --- "javac -version"
    4. Run the following command without the double quotes --- "mvn -v"
      2025-10-19 21h28_16_01_hyperv-versioncheck.png
3. Download 3 Repos
  1. Create a new folder
    1. C:\Temp\Github\Version_1.1.3
  2. Download files manually or via git clone "[Enter Repo URL]"
    1. Download latest files for the Code Validator Project
      1. Browse to https://github.com/onc-healthit/code-validator-api
      2. Click the "<> Code" button in green
      3. Click "Download zip"
      4. Download the zip to "C:\Temp\Github\Version_1.1.3"
    2. Download latest files from Content Validator
      1. Browse to https://github.com/onc-healthit/content-validator-api
      2. Repeat the same process
    3. Download latest files from Reference Validator
      1. Browse to https://github.com/onc-healthit/reference-ccda-validator
      2. Repeat the same process
    4. Unzip all (3) projects before proceeding
4. Run Maven Install
  1. Make sure to start a new CMD Prompt or Powershell session for the latest changes to take effect
  2. Run the following commands for the Code Validator Project
    1. Change to the directory of your Code Validator download
    2. cd "C:\Temp\Github\Version_1.1.3\code-validator-api-master"
      2025-10-19 21h37_59_01_hyperv-codevalidator.png
    3. Run a Maven command
      1. mvn clean install -DskipTests
      2. This will build the dependency
      3. This will copy the dependency aka JAR file to your local .m2 folder
      4. .m2 folder = C:\Users\<YourUsername>\.m2
      5. Your result should be BUILD SUCCESS
        2025-10-19 21h40_32_01_hyperv-maveninstall1.png
  3. Run the following commands for the Content Validator Project 
    1.  Change to the directory of your Content Validator download
    2. cd "C:\Temp\Github\Version_1.1.3\content-validator-api-master"
    3. Run a Maven command
      1. mvn clean install -DskipTests
      2. Your result should be BUILD SUCCESS
        2025-10-19 21h47_36_01_hyperv-maveninstall.png
5. Run Maven Package
  1. Run the following commands for the Reference Validator Project
    1. Change to the directory of your Content Validator download
    2. cd "C:\Temp\Github\Version_1.1.3\reference-ccda-validator-master"
    3. Run a Maven command
      1. mvn clean package -DskipTests
      2. This will create the WAR File and reference the code-validator and content-validator as needed when it's mentioned in the pom.xml file for dependencies
      3. Your result should be BUILD SUCCESS
        2025-10-19 21h53_51_01_hyperv-mavenpackage.png
6. The WAR file will be created and located here
"C:\Temp\Github\Version_1.1.3\reference-ccda-validator-master\target\referenceccdaservice.war"

7. Review the POM.XML file located here to confirm the version matches the target Github release
"C:\Temp\Github\Version_1.1.3\reference-ccda-validator-master\pom.xml"
2025-10-19 21h56_55_01_hyperv-pomfile.png

2025-10-19 22h16_09_01_github-referencevalidatorreleases.png
Fresh Installing a WAR File
Troubleshooting Building A WAR File
  • I had a few issues due to not properly setting my JAVA_HOME > Path and other environment variables
  • I also had to make sure I installed the JDK vs the JRE download from Oracle
  • Make sure to Google to find others who have had similar Java issues
  • Make sure to review previous ETT Google Group conversations
  • Feel free to post here as well but there's no guarantee on support or if I can help

Updating To The Latest WAR File
  1. These are the steps I've taken that have been successful
  2. I backed up my folders and files
    1. I especially backed up this file:
      "C:\Program Files\Apache Software Foundation\Tomcat 8.5\conf\Catalina\localhost\referenceccdaservice.xml"
    2. I backed up any other folders as needed as well
  3. I deleted my web app folders
    1. After backing up my C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps folders, I deleted the following:
    2. Deleted - "C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\referenceccdaservice"
    3. Deleted - "C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\referenceccdaservice.war"
  4. Get the latest WAR File and save it anywhere to disk for now
  5. Drop that latest WAR File directly into "C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps"
  6. Tomcat will automatically extract and deploy the app
  7. NOTE: This auto deployment will also auto delete your config file from 
    1. "C:\Program Files\Apache Software Foundation\Tomcat 8.5\conf\Catalina\localhost\referenceccdaservice.xml"
  8. Now, copy your previous referenceccdaservice.xml file back to "C:\Program Files\Apache Software Foundation\Tomcat 8.5\conf\Catalina\localhost"
  9. Reload or stop and start your site via the TomCat Manager
    2025-10-19 16h27_37_01_ettgoogle.png

    2025-10-19 16h28_36_01_ettgoogle.png
  10. Perform Post Update Testing to confirm
    1. The sites load:
      1. http://localhost:8080/
      2. http://localhost:8080/referenceccdaservice/static/validationui.html
      3. http://localhost:8080/referenceccdaservice/swagger-ui.html#/
    2. You should validate a C-CDA XML file as well
  11. Review the latest version of the referenceccdaservice.xml to confirm if any changes have been made
  12. If changes have been made, you'll need to: 
    1. copy the latest file
    2. re-update the defaults paths to match your paths
    3. then copy that file back into "C:\Program Files\Apache Software Foundation\Tomcat 8.5\conf\Catalina\localhost"
    4. Reload your web app again
    5. Confirm all is well

Other Related Threads
  • There are many threads from historical conversations that helped me
  • There is one thread in particular that gave me a AH HA moment of possible success by viewing the issues with dependency errors as a resolvable problem
  • https://groups.google.com/g/edge-test-tool/c/Eh7LxPUZu_M/m/g-8GWoNvDAAJ
  • Thanks again to Dan Brown, Dragon, many and any others for their support and comments over the years
  • Hoping this contribution will help others like it helped
  • Lots of troubleshooting and time consumption but many wins were achieved in the end!!

Mat Davis

unread,
Oct 19, 2025, 11:40:08 PMOct 19
to Edge Test Tool (ETT)
Minor Typo Correction

5. Run Maven Package
  1. Run the following commands for the Reference Validator Project
    1. Change to the directory of your Reference Validator download vs Change to the directory of your Content Validator download
    1. cd "C:\Temp\Github\Version_1.1.3\reference-ccda-validator-master"
    Any other feedback is welcomed.
    Reply all
    Reply to author
    Forward
    0 new messages