I am using Maven resources plugin and want to override include pattern from CLI. Is there a way?
I tried this
<configuration>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/content/jcr_root</directory>
<filtering>false</filtering>
<includes>
<include>${include.val}</include>
</includes>
</resource>
</resources>
</configuration>
Command from CLI is : mvn clean install -Dinclude.val=/components/content/anchor/
But my use-case is I may have multiple values to include based on the input and this is dynamic. So I cannot have an XML include element for every include.
The include pattern as far as I read - does not take comma separated values. Is there any other way? Or any other plugin?
I feel not taking comma separated values is a short-coming of this plugin. And though it accepts pattern, it does not take the normal regular expressions, so i cant have a pattern added here too.
Any pointers would help.
Use case: The use case is of atomic packaging. We have multiple files in the source directory Lets assume only 2 files got modified by the developer. lets assume we get to know the exact 2 files that got modified. I want only those 2 modified files to be included in the final package post maven build. If i have a command, that can take comma separated include patterns then this can be achieved very easily.
I read about this on the internet. Found some useful resources but could not get that working https://blog.sonatype.com/2011/03/configuring-plugin-goals-in-maven-3/
Wanted to know if anyone has made this working or found any alternative