DhanaGitHub / maven-replacer-plugin

Automatically exported from code.google.com/p/maven-replacer-plugin
0 stars 0 forks source link

Use of outputFilePattern generate "Error creating directory" error #85

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a projet with a sql file in src/sql ex.: issue.sql
2. we want to replace some text and write the resulting file in a "replaced" 
directory while rename the file
3. I have configured the replacer plugin this way:
<plugin>
    <groupId>com.google.code.maven-replacer-plugin</groupId>
    <artifactId>replacer</artifactId>
    <version>1.5.2</version>
    <executions>
        <execution>
            <phase>compile</phase>
            <goals>
                <goal>replace</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <basedir>${project.build.directory}/classes</basedir>
        <filesToInclude>*.sql</filesToInclude>
        <inputFilePattern>(.*)</inputFilePattern>
        <outputFilePattern>test-$1</outputFilePattern>
        <outputDir>replaced</outputDir>
        ...
    </configuration>
</plugin>

While building, I have a "Error creating directory" error during replacement.

I tried removing the outputDirectory: same error
If I replace <outputFilePattern>test-$1</outputFilePattern> with 
<outputFilePattern>$1</outputFilePattern> replacement occurs properly (but my 
file is not renamed)

What is the expected output? What do you see instead?
I expect to generate a jar file with the original issue.sql file, and an extra 
replaced/test-issue.sql file with text replacement.

What version of the product are you using?
1.5.2

Please provide any additional information below.
It would be great to have extra information in debug mode, such as the file 
name before and after replacement.
It would also be interesting to mention which directory cannot be created.

Attached: maven test project

Original issue reported on code.google.com by jacques....@gmail.com on 15 Aug 2013 at 9:16

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by baker.st...@gmail.com on 5 Nov 2013 at 10:46

GoogleCodeExporter commented 9 years ago
Could you try this again with HEAD from trunk?
I think Issue 69 might have resolved this as well.

Original comment by baker.st...@gmail.com on 19 Feb 2014 at 1:16

GoogleCodeExporter commented 9 years ago
It seems to work properly now.
I saw that you add a debug line for the replacement

[DEBUG] Replacement run on 
C:\eclipse\workspace\maven-replacer-issue\target/classes\issue.sql and writing 
to 
C:\eclipse\workspace\maven-replacer-issue\target/classes\replaced\test-issue.sql
 with encoding (default)

Original comment by jacques....@gmail.com on 20 Feb 2014 at 6:07

GoogleCodeExporter commented 9 years ago
Thanks, I'll set this as fixed and ready for the 1.5.3 release.

Original comment by baker.st...@gmail.com on 20 Feb 2014 at 9:39

GoogleCodeExporter commented 9 years ago
Duplicate cause from Issue 69.

Original comment by baker.st...@gmail.com on 16 Apr 2014 at 9:21