Aspose Licence

Goal

These packagings tasks goal is to load Aspose licence for modules Words, Pdf, Cell, Slides.

Packaging task configuration

This packaging task was enabled by default in packaging/vdoc.xml :

<extension name="com.axemble.aspose.startup.AsposeWordLicenceLoaderExtension" runOnce="false"/>
<extension name="com.axemble.aspose.startup.AsposeSlidesLicenceLoaderExtension" runOnce="false"/>
<extension name="com.axemble.aspose.startup.AsposePDFLicenceLoaderExtension" runOnce="false"/>
<extension name="com.axemble.aspose.startup.AsposeCellsLicenceLoaderExtension" runOnce="false"/>

Extending to load more modules

If you need to load more modules you can extend com.axemble.aspose.startup.AbstractAsposeLicenceLoaderExtension like this

import com.aspose.mails.License;

import java.io.InputStream;
import java.util.Map;

public class AsposeMailsLicenceLoaderExtension extends AbstractAsposeLicenceLoaderExtension {
    @Override
    protected void execute(Map<String, String> parameters) throws Exception {
        try (InputStream inputStream = this.getLicenseStream()) {
            License license = new License();
            license.setLicense(inputStream);
        }
    }
}

and add it to your hown packaging file.

<?xml version="1.0" encoding="UTF-8"?>
<packaging>
    <startup>
        <extension name="com.axemble.aspose.startup.AsposeMailsLicenceLoaderExtension" runOnce="false"/>
    </startup>
</packaging>