I'm actually surprised that *beans.xml
works.
As far as I can see, wildcards are not supported in file activation. The source code that calculates profile activation based on <file>
can be found in FileProfileActivator. The core logic goes like this:
String path = //<file><exists> ...
RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
interpolator.addValueSource(/* ${basedir} suppert */)
interpolator.addValueSource( new MapBasedValueSource( context.getProjectProperties() ) );
interpolator.addValueSource( new MapBasedValueSource( context.getUserProperties() ) );
interpolator.addValueSource( new MapBasedValueSource( context.getSystemProperties() ) );
path = interpolator.interpolate( path, "" );
path = pathTranslator.alignToBaseDirectory( path, basedir );
File f = new File( path );
if ( !f.isAbsolute() ){
return false;
}
boolean isActive = f.exists();
And neither interpolate(...)
nor alignToBaseDirectory(...)
process wildcards.
As a workaround you can try some gimick with <activation><property>
, but that would require calling the maven build with a shell script.