此处举例,使用21年的旧版本21.11版本
jar包,可以到如下地址进行下载(下载的是release无限制版本,支持使用license激活后使用全功能的版本)
https://releases.aspose.com/pdf/java/21-11/#package-explorer
Aspose.Cells 21.11 | Process Spreadsheet Formats via Java API
https://releases.aspose.com/words/java/21-11/#package-explorer
下载后,文件名称为:aspose-words-21.11-jdk17.jar,更改名称为aspose-words-21.11.jar
使用aspose-pdf 21.11,破解license方式如下
手动安装jar包到本地manve仓库,参考如下命令
mvn install:install-file -DgroupId=cn.codeforfun -DartifactId=mysql-migrate -Dversion=1.3.16 -Dpackaging=jar -Dfile=C:\jar_path\mysql-migrate-1.3.16.jar -s C:\mvn_setting_path\settings.xml
所以安装命令如下
mvn install:install-file -DgroupId=com.aspose -DartifactId=aspose-words -Dversion=21.11 -Dpackaging=jar -Dfile=C:\Users\myname\Downloads\aspose-words-21.11.jar -s C:\Users\myname\.m2\settings.xml
在idea的maven插件窗口,打开maven命令行界面,执行安装(不要用windows命令行打开执行maven命令行安装,尤其是不是使用的独立maven安装版本,使用的是idea集成内嵌自带的maven的版本的时候)
安装成功,可以看到如下输出
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< org.example:pdf-excel-aspose >--------------------
[INFO] Building pdf-excel-aspose 1.0-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- install:2.5.2:install-file (default-cli) @ pdf-excel-aspose ---
[INFO] pom.xml not found in aspose-words-21.11.jar
[INFO] Installing C:\Users\liuyouzhang\Downloads\aspose-words-21.11.jar to E:\maven_default_repository\repository\com\aspose\aspose-words\21.11\aspose-words-21.11.jar
[INFO] Installing C:\Users\LIUYOU~1\AppData\Local\Temp\mvninstall3240540123781640973.pom to E:\maven_default_repository\repository\com\aspose\aspose-words\21.11\aspose-words-21.11.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.499 s
[INFO] Finished at: 2024-12-19T14:14:36+08:00
[INFO] ------------------------------------------------------------------------
Process finished with exit code 0
安装aspose-cells
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< org.example:pdf-excel-aspose >--------------------
[INFO] Building pdf-excel-aspose 1.0-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- install:2.5.2:install-file (default-cli) @ pdf-excel-aspose ---
[INFO] pom.xml not found in aspose-cells-21.11.jar
[INFO] Installing C:\Users\liuyouzhang\Downloads\aspose-cells-21.11.jar to E:\maven_default_repository\repository\com\aspose\aspose-cells\21.11\aspose-cells-21.11.jar
[INFO] Installing C:\Users\LIUYOU~1\AppData\Local\Temp\mvninstall7150304202063608303.pom to E:\maven_default_repository\repository\com\aspose\aspose-cells\21.11\aspose-cells-21.11.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.389 s
[INFO] Finished at: 2024-12-19T14:20:40+08:00
[INFO] ------------------------------------------------------------------------
Process finished with exit code 0