You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (JIRA)" <ji...@apache.org> on 2018/06/17 20:26:00 UTC
[jira] [Closed] (MNG-6259) Maven Resources Plugin copy error when
filtering is true on a Mac
[ https://issues.apache.org/jira/browse/MNG-6259?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Osipov closed MNG-6259.
-------------------------------
Resolution: Incomplete
No sample project provided within a year.
> Maven Resources Plugin copy error when filtering is true on a Mac
> -----------------------------------------------------------------
>
> Key: MNG-6259
> URL: https://issues.apache.org/jira/browse/MNG-6259
> Project: Maven
> Issue Type: Bug
> Components: Errors
> Affects Versions: 3.2.5
> Reporter: Fahd Siddiqui
> Priority: Major
>
> This is an error consistently seen on Mac (OS X 10.11.6), but it seems to work fine on linux (our jenkins agent).
> Basically, when `filtering` is set to true in the resources plugin, the resource file contents are copied incorrectly converting \${something} to ${something}. Note the missing back-slash, and also that "something" is not a maven variable. The expected behavior is to keep it unchanged. Here is a unit test that shows the issue:
> 1. First, create a resource text file "new.test" with just the string {code}\${something }{code}
> 2. Make sure that resource plugin has filtering set to "true":
> {code}
> <testResources>
> <testResource>
> <directory>src/test/resources</directory>
> <filtering>true</filtering>
> </testResource>
> {code}
> 3. Create the unit test below:
> {code}
> @Test
> public void test() throws IOException {
> URL url = Resources.getResource("conf/new.test");
> String text = Resources.toString(url, Charsets.UTF_8);
> String expectedText = "\\${something }" ;
> System.out.println("actual: " + text);
> System.out.println("expected: " + expectedText);
> assertEquals(expectedText, text);
> }
> {code}
> 3. Note that when you run the above test from the IDE directly, it passes.
> 4. Run `mvn clean install` from command line and verify the following error:
> {code}
> actual: ${something }
> expected: \${something }
> org.junit.ComparisonFailure:
> Expected :\${something }
> Actual :${something } ---> Note the back-slash has gone missing.
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)