Composite provisioning - Advanced
Advanced usage
If the standard features of composite scanner are not enough here are some advanced things toy can do:
Using placeholders
If you are in need to use system properties in your provision specs the the composite files you can do so by using ${property.name
}, where the property name is the name of the system property to be replaced as for example user.home
. Here is an example of such a file:
scan-bundle:file:${user.home}/my-repository/foo.jar
in this example the ${user.home
} will be replaced in my case with /Users/adreghiciu
so the actual provisioning spec will be scan-bundle:file:/Users/adreghiciu/my-repository/foo.jar
There are also two special placeholders that you can use that are easier to explain via examples:
this.relative
— If you have the following composite file:and you access the file via:bar.compositescan-bundle:${this.relative}foo.jar
scan-composite:http://www.somewhere.org/repository/bar.composite
the placeholder will be replaced withhttp://www.somewhere.org/repository
resulting inscan-bundle:http://www.somewhere.org/repository/foo.jar
scan-composite:file:/Users/adreghiciu/repository/bar.composite
the placeholder will be replaced withfile:/Users/adreghiciu/repository/
resulting inscan-bundle:/Users/adreghiciu/repository/foo.jar
this.absolute
— If you have the following composite file:and you access the file via:bar.compositescan-bundle:${this.absolute}foo.jar
scan-composite:http://www.somewhere.org/repository/bar.composite
the placeholder will be replaced withhttp://www.somewhere.org/
resulting inscan-bundle:http://www.somewhere.org/foo.jar
scan-composite:file:/Users/adreghiciu/my-repository/bar.composite
the placeholder will be replaced withfile:/
resulting inscan-bundle:/foo.jar
Relative URLs
Sometimes you do not want to hardcode absolute urls in your composite file but