Details
-
New Feature
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
7.0.0-M1
-
None
-
None
Description
Allows to customize tomee distribution using javascript.
the property is jsCustomizers (respectively groovyCustomizers).
Note: groovy usage needs to add groovy jar as a dependency of the tomee plugin.
Sample:
<configuration> <jsCustomizers> <jsCustomizer> <![CDATA[ var File = Java.type('java.io.File'); var Files = Java.type('java.nio.file.Files'); var StandardCopyOption = Java.type('java.nio.file.StandardCopyOption'); var junit = resolver.resolve('junit', 'junit', '4.12'); Files.copy(junit.toPath(), new File(catalinaBase, 'lib/JsCustomizertest.jar').toPath(), StandardCopyOption.REPLACE_EXISTING); ]]> </jsCustomizer> </jsCustomizers> </configuration>
Default available bindings are:
- catalinaBase: the tomee base/home
- resolver: a wrapper to use maven to resolve a variable. There are 3 signatures and all returns a File:
- resolve(groupId, artifactId, version): classifier is null and type is jar
- resolve(groupId, artifactId, version, type): classifier is null
- resolve(groupId, artifactId, version, classifier, type)