Uploaded image for project: 'ShrinkWrap'
  1. ShrinkWrap
  2. SHRINKWRAP-453

Paths in webarchives are not calculated correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.2.3
    • 1.1.2
    • api
    • None

      When creating a WebArchive via ShrinkWrap from a directory that is an exploded war file, paths inside this archive (generated with "arquillian.xml/arquillian/engine/property[deploymentExportPath]->target/deployments") generated invalid in some cases.
      When investigating the sources I found "org.jboss.shrinkwrap.impl.base.importer.ExplodedImporterImpl.calculatePath(File root, File child)" uses "String.replaceFirst" to replace the occurance of rootPath in childPath to create a local war file path. My path of the directory that needs compression contains brackets, which (as well as other path elements, e.g. ".") are interpreted as regular expression tokens and therefore don't match.
      The resulting archive can not be delpoyed in AS and tests can not be performed automatically.

      The code to create the WebArchive looks like this:
      ShrinkWrap.create(WebArchive.class, resultingWarFileNameAsString)
      .as(ExplodedImporter.class).importDirectory(absolutePathToExplodedWarDirectoryAsFile)
      .as(WebArchive.class);

            Unassigned Unassigned
            shoesel Stefan Hösel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: