comma separated list of files
michaldo opened this issue · comments
Michal Domagala commented
If I want to launch a build and pass in command line 3 property files I do
mvn install -Dfile1=jboss.properties -Dfile2=db.properties -Dfile3=mq.properties
<execution>
<phase>initialize</phase>
<goals><goal>read-project-properties</goal></goals>
<configuration>
<files>
<file>${file1}</file>
<file>${file2}</file>
<file>${file3}</file>
</files>
</configuration>
</execution>
But when I want to launch another build (for selenium test in my case) and I want pass only 1 property file:
mvn install -Dfile1=jboss.properties
execution fails with null pointer exception
I would to modify my build in command line by passing 1 or many property files
mvn install -Dmy.property.files=jboss.properties,db.properties,mq.properties
<execution>
<phase>initialize</phase>
<goals><goal>read-project-properties</goal></goals>
<configuration>
<commaSeparatedFiles>${my.property.files}</commaSeparatedFiles>
</configuration>
</execution>
Slawomir Jaranowski commented
You can simply use comma-separated items for list parameter - https://maven.apache.org/guides/mini/guide-configuring-plugins.html#mapping-collections-and-arrays