Ryan created ARCHETYPE-616:
------------------------------

             Summary: Filelist scanning does not use substitute property in 
directory name
                 Key: ARCHETYPE-616
                 URL: https://issues.apache.org/jira/browse/ARCHETYPE-616
             Project: Maven Archetype
          Issue Type: Bug
    Affects Versions: 3.2.0
            Reporter: Ryan


When creating an archetype, I would like directories to be copied based on a 
property *p*.

eg. given a directory structure

root

— a

------ pom.xml

— b

------ pom.xml

 

if the *p* property is passed as "a" Only the "a" directory is copied, "b" is 
not copied.

 

My archetype-metadata.xml looks like the following:
{quote}<archetype-descriptor>
 <fileSets>
    <fileSet filtered="true" packaged="false" encoding="UTF-8">
       <directory>__p__</directory>
       <includes>
          <include>***/***</include>
       </includes>
    </fileSet>
 </fileSets>
 <requiredProperties>
    <requiredProperty key="p">
       <defaultValue>a</defaultValue>
    </requiredProperty>
 </requiredProperties>
 </archetype-descriptor>
{quote}
And I can see in the debug logs that the directory name is being substituted 
correctly



[DEBUG] Replacing property 'applicationFramework' in file path 
'__applicationFramework__//' with value 'a'.

[DEBUG] Final interpolated file path: 'a//'

*However the file search itself is not using the substituted directory name, 
leading to it finding no files* 

[DEBUG] Processing fileset __p__ (Filtered-Flat) [**/** -- ] -> 0:

[DEBUG] Processed 0 files.

 

I am very confident this is not an issue with my archetype-metadata.xml because 
when I replace "__p__" with either "a" or "b" it searches, finds and copies the 
files in that directory successfully.

 

*Expected behaviour:*

Property is substituted in directory path and that same directory is scanned 
for files, as is stated in the docs

*Actual behaviour:*

Property is substituted, but the scan takes place in the non-substituted 
___p___ directory. This may be a feature if the directory was named "__p__" but 
both situations should be covered



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to