code: public static String calculateChecksum(final File installedFile) throws MojoExecutionException {
          int bufsize = CHECKSUM_BUFFER_SIZE;
          byte[] buffer = new byte[bufsize];
          FileInputStream fis = null;
          BufferedInputStream bis = null;
          String checksum = null;
  
          try {
              MessageDigest sha1 = MessageDigest.getInstance("SHA-1");
              
              fis = new FileInputStream(installedFile);
              sha1.reset();
              int size = fis.read(buffer, 0, bufsize);
              while (size >= 0) {
                  sha1.update(buffer, 0, size);
                  size = fis.read(buffer, 0, bufsize);
              }
              checksum = String.format("%040x", new BigInteger(1, sha1.digest()));
          } catch (Exception e) {
              throw new MojoExecutionException("Failed to calculate digest checksum for " + installedFile, e);
          } finally {
              IOUtil.close(bis);
              IOUtil.close(fis);
          }
          
          if (checksum != null) {
              return checksum;
          } else {
              throw new MojoExecutionException("Failed to calculate digest checksum for " + installedFile); 
          }
      }
docs: Calculates the SHA1 checksum for a file using a crude method.
  
  @param installedFile  The installed artifact for which the checksum is being computed
  @return String The SHA1 checksum
  @throws MojoExecutionException In case of IO error or checksum calculation error