我使用Documents4j将rtf文件转换为pdf文件。我的电脑上没有MS word或任何东西,所以我似乎需要使用远程转换器。详情请登录:http://documents4j.com/#/。
我的项目是用spring-boot设置的。基于GitHub上的一些问题,我使用maven-shade-plugin为maven设置了shading。但是,我不能运行Documents4j建议的命令来启动服务器:java -jar documents4j-server-standalone-shaded.jar http://localhost:9998
我明白了:Error: Unable to access jarfile documents4j-server-standalone-shaded.jar。
我的pom.xml文件引入了shade插件。
下面是我的pom.xml中的插件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
</configuration>
</execution>
</executions>
</plugin>下面是我在Documents4j方面使用的依赖项:(可能缺少一些重要的东西?)
<dependency>
<groupId>com.documents4j</groupId>
<artifactId>documents4j-api</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>com.documents4j</groupId>
<artifactId>documents4j-client</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>com.documents4j</groupId>
<artifactId>documents4j-server-standalone</artifactId>
<version>1.0.3</version>
</dependency>根据我在Documents4j页面上读到的内容,似乎该命令应该可以正常工作,因此我假定没有创建jar文件。
我好像到处都找不到那个jarfile ...因此,我无法使用路径而不仅仅是名称来运行java -jar命令。
此外,我不确定我可能需要在插件中进行什么“配置”。也许有一个技巧可以让maven shading起作用?也许我误解了Documents4j页面在说什么?也许它在Mac上的工作方式有所不同?也许Documents4j不是一个好的选择?
我非常感谢所有的帮助。
发布于 2019-01-08 06:25:39
请注意,只能在支持.NET并安装了Office的Windows Server上运行。https://github.com/documents4j/documents4j/issues/53
https://stackoverflow.com/questions/54081468
复制相似问题