christian-schlichtherle / truelicense

An open source engine for license management on the Java Virtual Machine.
https://truelicense.namespace.global
Apache License 2.0
319 stars 66 forks source link

Upgrade guide from net.dev.java.truelicense:truelicense:1.29 to 4.0.3 #15

Closed Lyeeedar closed 3 years ago

Lyeeedar commented 3 years ago

I'm currently trying to upgrade from using net.dev.java.truelicense:truelicense:1.29 to 4.0.3, but am struggling to find any documentation on how exactly to do that on the site. All I can currently find is how to use the maven archetype, which we are not doing as far as I am aware.

Currently we decrypt the license keys by doing:

LicenseParam licenseParam = *implementation of de.schlichtherle.license.LicenseParam*
LicenseManager licenseManager = new LicenseManager(licenseParam);
licenseManager.install(new File("path_to_license_file"));
LicenseContent licenseContent = lm.verify();
Properties props = new Properties();
props.load(new StringReader(licenseContent.getInfo()));
// use props to toggle features

How would we go about doing this same code using the new global.namespace.truelicense:truelicense?

I assume I need to include the global.namespace.truelicense:truelicense-v1:4.0.3 dependency, but beyond that I can't find any documentation on what to do.

christian-schlichtherle commented 3 years ago

There is no upgrade path from TrueLicense 1.X because the API was completely redesigned for TrueLicense 2.X, so you need to reimplement your solution. For documentation on TrueLicense 4.X, please refer to https://truelicense.namespace.global . If you still have questions, please feel free to reopen this ticket.