Example Configurations

This page shows some example configurations which you can use when generating your project.

Basic Configuration

This is a basic configuration example for a software product with only one edition with the name standard and no free trial period.

$ mvn archetype:generate -B \
    -DarchetypeGroupId=net.truelicense \
    -DarchetypeArtifactId=truelicense-maven-archetype \
    -DarchetypeVersion=3.2.0 \
    -DartifactId='basic' \
    -Dcompany='Company Inc.' \
    -DgroupId='com.company.product' \
    -Dpassword='test1234' \
    -Dsubject='Product 1' \
    -Dversion='1.0-SNAPSHOT'

Free Trial Period

This example adds freeTrialPeriod=30 and ftpSecretMarkerClass=sun.security.provider.Sun to the Basic Configuration example in order to configure a free trial period of thirty days. For a production project, please change the value of the property ftpSecretMarkerClass because it’s obviously not secret anymore.

$ mvn archetype:generate -B \
    -DarchetypeGroupId=net.truelicense \
    -DarchetypeArtifactId=truelicense-maven-archetype \
    -DarchetypeVersion=3.2.0 \
    -DartifactId='freeTrialPeriod' \
    -Dcompany='Company Inc.' \
    -DfreeTrialPeriod='30' \
    -DftpSecretMarkerClass='sun.security.provider.Sun' \
    -DgroupId='com.company.product' \
    -Dpassword='test1234' \
    -Dsubject='Product 1' \
    -Dversion='1.0-SNAPSHOT'

Multiple Product Editions

This example adds editions=enterprise standard to the Basic Configuration example in order to manage separate license keys for a Standard Edition and an Enterprise Edition of the software product. Note that due to the ordering of the editions, the Enterprise Edition is a superset of the Standard Edition.

$ mvn archetype:generate -B \
    -DarchetypeGroupId=net.truelicense \
    -DarchetypeArtifactId=truelicense-maven-archetype \
    -DarchetypeVersion=3.2.0 \
    -DartifactId='multipleProductEditions' \
    -Dcompany='Company Inc.' \
    -Deditions='enterprise standard' \
    -DgroupId='com.company.product' \
    -Dpassword='test1234' \
    -Dsubject='Product 1' \
    -Dversion='1.0-SNAPSHOT'

Hide Uninstall Action

This example adds hideUninstallAction=true to the Basic Configuration example in order to remove the Uninstall ${subject} license key action from the license wizard dialog.

$ mvn archetype:generate -B \
    -DarchetypeGroupId=net.truelicense \
    -DarchetypeArtifactId=truelicense-maven-archetype \
    -DarchetypeVersion=3.2.0 \
    -DartifactId='hideUninstallAction' \
    -Dcompany='Company Inc.' \
    -DgroupId='com.company.product' \
    -DhideUninstallAction='true' \
    -Dpassword='test1234' \
    -Dsubject='Product 1' \
    -Dversion='1.0-SNAPSHOT'

Disable License Wizard

This example adds disableWizard=true to the Basic Configuration example in order to completely remove the license wizard dialog from the generated code.

$ mvn archetype:generate -B \
    -DarchetypeGroupId=net.truelicense \
    -DarchetypeArtifactId=truelicense-maven-archetype \
    -DarchetypeVersion=3.2.0 \
    -DartifactId='disableWizard' \
    -Dcompany='Company Inc.' \
    -DdisableWizard='true' \
    -DgroupId='com.company.product' \
    -Dpassword='test1234' \
    -Dsubject='Product 1' \
    -Dversion='1.0-SNAPSHOT'

Custom License Management Authorization

This example adds keyGenAuthorizationClass=net.truelicense.core.TrueLicenseManagementAuthorization and keyMgrAuthorizationClass=net.truelicense.core.TrueLicenseManagementAuthorization to the Basic Configuration example in order to implement a custom license authorization.

$ mvn archetype:generate -B \
    -DarchetypeGroupId=net.truelicense \
    -DarchetypeArtifactId=truelicense-maven-archetype \
    -DarchetypeVersion=3.2.0 \
    -DartifactId='customAuthorization' \
    -Dcompany='Company Inc.' \
    -DgroupId='com.company.product' \
    -DkeyGenAuthorizationClass='net.truelicense.core.TrueLicenseManagementAuthorization' \
    -DkeyMgrAuthorizationClass='net.truelicense.core.TrueLicenseManagementAuthorization' \
    -Dpassword='test1234' \
    -Dsubject='Product 1' \
    -Dversion='1.0-SNAPSHOT'

Custom License Validation

This example adds keyGenValidationClass=com.company.product.keygen.Main$NoLicenseValidation and keyMgrValidationClass=com.company.product.keymgr.Main$NoLicenseValidation to the Basic Configuration example in order to decorate the basic license validation function in the Key Generator and Key Manager modules with the named custom class.

$ mvn archetype:generate -B \
    -DarchetypeGroupId=net.truelicense \
    -DarchetypeArtifactId=truelicense-maven-archetype \
    -DarchetypeVersion=3.2.0 \
    -DartifactId='customValidation' \
    -Dcompany='Company Inc.' \
    -DgroupId='com.company.product' \
    -DkeyGenValidationClass='com.company.product.keygen.Main$NoLicenseValidation' \
    -DkeyMgrValidationClass='com.company.product.keymgr.Main$NoLicenseValidation' \
    -Dpassword='test1234' \
    -Dsubject='Product 1' \
    -Dversion='1.0-SNAPSHOT'

Custom Clock

This example adds keyMgrClockClass=com.company.product.keymgr.CustomClock to the Basic Configuration example in order to replace the system clock with a custom implementation.

$ mvn archetype:generate -B \
    -DarchetypeGroupId=net.truelicense \
    -DarchetypeArtifactId=truelicense-maven-archetype \
    -DarchetypeVersion=3.2.0 \
    -DartifactId='customClock' \
    -Dcompany='Company Inc.' \
    -DgroupId='com.company.product' \
    -DkeyMgrClockClass='com.company.product.keymgr.Main$SystemClock' \
    -Dpassword='test1234' \
    -Dsubject='Product 1' \
    -Dversion='1.0-SNAPSHOT'

V2/XML License Key Format

This example adds licenseKeyFormat=V2/XML to the Basic Configuration example in order to use the V2/XML license key format and remove the dependency on the Jackson JSON Processor from the generated code.

$ mvn archetype:generate -B \
    -DarchetypeGroupId=net.truelicense \
    -DarchetypeArtifactId=truelicense-maven-archetype \
    -DarchetypeVersion=3.2.0 \
    -DartifactId='v2XmlLicenseKeyFormat' \
    -Dcompany='Company Inc.' \
    -DgroupId='com.company.product' \
    -DlicenseKeyFormat='V2/XML' \
    -Dpassword='test1234' \
    -Dsubject='Product 1' \
    -Dversion='1.0-SNAPSHOT'