Skip to main content

ArtifactListeners

ArtifactListeners allow you to attach logic that runs each time a file is expanded.

Add a DataResource file to your expansion-resource:

<dataResource type="expansionControl::ArtifactListener">
<artifactListener name="MyListener">
<attachTo name="before-write"/> <!-- before-write or after-write -->
<implementation>net.demo.MyListener</implementation>
<!-- Next are some optional attributes to filter when to run the listener -->
<layerType name="LOGIC_LAYER"/> <!-- optional, filters logic layer artifacts -->
<technology name="EJB3"/> <!-- optional, filters Ejb3 artifacts -->
<fileExtensions>java, kt</fileExtensions> <!-- optional, filters .java or .kt files -->
</artifactListener>
</dataResource>