docs: @TaskAction
      public void packageForSwarm() throws Exception {
          final Project project = getProject();
          final ThorntailExtension extension = getThorntailExtension();
  
          GradleArtifactResolvingHelper resolvingHelper = new GradleArtifactResolvingHelper(project);
          Properties propertiesFromExtension = extension.getProperties();
          Set<File> moduleDirs = extension.getModules();
          if (moduleDirs.isEmpty()) {
              Path resourcesOutputDir = project.getConvention()
                      .getPlugin(JavaPluginConvention.class)
                      .getSourceSets()
                      .findByName(SourceSet.MAIN_SOURCE_SET_NAME)
                      .getOutput()
                      .getResourcesDir()
                      .toPath()
                      .resolve(MODULE_DIR_NAME);
              if (Files.isDirectory(resourcesOutputDir)) {
                  File moduleDir = resourcesOutputDir.toFile();
  
                  moduleDirs.add(moduleDir);
              }
          }
  
  
          BuildTool tool = new BuildTool(resolvingHelper)
                  .projectArtifact(this.jarTask.getGroup(), this.jarTask.getBaseName(), this.jarTask.getVersion(),
                                   getPackaging(), getProjectArtifactFile())
                  .mainClass(getMainClassName())
                  .bundleDependencies(extension.isBundleDependencies())
                  .executable(extension.isIncludeExecutable())
                  .executableScript(extension.getExecutableScript())
                  .properties(propertiesFromExtension)
                  .properties(getPropertiesFromFile())
                  .properties(PropertiesUtil.filteredSystemProperties(propertiesFromExtension, false))
                  .fractionDetectionMode(extension.getFractionDetectionMode())
                  .hollow(extension.isHollow())
                  .additionalModules(moduleDirs.stream()
                                             .filter(File::exists)
                                             .map(File::getAbsolutePath)
                                             .collect(Collectors.toList()))
                  .logger(new SimpleLogger() {
                      @Override
                      public void debug(String msg) {
                          getLogger().debug(msg);
                      }
  
                      @Override
                      public void info(String msg) {
                          getLogger().info(msg);
                      }
  
                      @Override
                      public void error(String msg) {
                          getLogger().error(msg);
                      }
  
                      @Override
                      public void error(String msg, Throwable t) {
                          getLogger().error(msg, t);
                      }
                  });
  
          tool.declaredDependencies(GradleToolingHelper.toDeclaredDependencies(extension.getDependencies()));
          tool.bundleDependencies(extension.isBundleDependencies());
          // Add the explicitly defined fractions from the configuration.
          extension.getDeclaredFractions().stream().map(DependencyDescriptor::toArtifactSpec).forEach(tool::fraction);
          // Build the Thorntail archive.
          tool.build(getOutputFile().getName(), getOutputDirectory());
  
          /* We expect a war task to be present before scanning for war files. */
          final java.util.Optional<Task> task = project.getTasks().stream().filter(t -> "war".equals(t.getName())).findAny();
          if (task.isPresent()) {
              /* Look for all the war archives present */
              final Set<File> warArchives = project.getConfigurations()
                      .stream()
                      .map(Configuration::getAllArtifacts)
                      .map(PublishArtifactSet::getFiles)
                      .map(FileCollection::getFiles)
                      .flatMap(Collection::stream)
                      .filter(f -> f.getName().endsWith(".war"))
                      .collect(Collectors.toSet());
              for (File warArchive : warArchives) {
                  tool.repackageWar(warArchive);
              }
          }
      }