[shrinkwrap-issues] [JBoss JIRA] (SHRINKWRAP-453) Paths in webarchives are not calculated correctly

Stefan Hösel (JIRA) jira-events at lists.jboss.org
Fri Apr 12 07:05:56 EDT 2013


     [ https://issues.jboss.org/browse/SHRINKWRAP-453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Hösel updated SHRINKWRAP-453:
------------------------------------

    Description: 
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.{color:gray}*class*{color}, resultingWarFileNameAsString)}}
  {{.as(ExplodedImporter.{color:gray}*class*{color}).importDirectory(absolutePathToExplodedWarDirectoryAsFile)}}
  {{.as(WebArchive.{color:gray}*class*{color});}}

  was:
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.


    
> Paths in webarchives are not calculated correctly
> -------------------------------------------------
>
>                 Key: SHRINKWRAP-453
>                 URL: https://issues.jboss.org/browse/SHRINKWRAP-453
>             Project: ShrinkWrap
>          Issue Type: Bug
>          Components: api
>    Affects Versions: 1.1.2
>         Environment: Win7x64, JDK1.7.0_17x32, JBOSS 7.1.3.Final, Arquillian 1.0.3Final, JUnit 4.11
>            Reporter: Stefan Hösel
>
> 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.{color:gray}*class*{color}, resultingWarFileNameAsString)}}
>   {{.as(ExplodedImporter.{color:gray}*class*{color}).importDirectory(absolutePathToExplodedWarDirectoryAsFile)}}
>   {{.as(WebArchive.{color:gray}*class*{color});}}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the shrinkwrap-issues mailing list