Insert licence in Maven dependency

青春壹個敷衍的年華 提交于 2020-01-06 14:26:33

问题


I've made some tests using JxBrowser and intend to add it to my academic project.

However, it is a Maven project, which I develop using the Netbeans IDE, and although I added the TeamDev JxBrowser repository, the JxBrowser dependency in the pom.xml file and tried to manually insert the licence.jar that I acquire, it is failing to execute properly.

Maybe the issue is the fact that I am downloading the library by its repository and the license is a separated file.

I also upload an attachment that illustrates my problem and the message displayed when I execute the method that uses JxBrowser; it says that I don't have a valid license, although I manually inserted my licence.jar as a local dependency.

Could you please help me through this? What should I do? I really have high hopes about using JxBrowser in my project.


回答1:


Extract the licence.jar (it's just a zip file), you will get META-INF/teamdev.licenses file Put it in

src/main/java/resources/META-INF/teamdev.licenses




回答2:


EDIT: I discovered that I wasn't referencing the proper jar file, but the one in the com.teamdev.jxbrowser repository (default trial version), not the one that I have in my local machine; in that case, after the 30 days trial expired, I am not able to use the Jxbrowser anymore, even thought I have the proper jar file. So, I still have the same problem, I am uploading the error message in netbeans and some parts of my pom.xml file that references to the licence.jar in my computer. I also have tried manually inserted the jar again, not obtaining any success.

<repository>
   <id>mylibid</id>
   <url>file:${basedir}</url>
</repository>
<dependency>
  <groupId>mylibid</groupId>
  <artifactId>licence</artifactId>
  <version>1.0</version>
  <type>jar</type>
  <scope>provided</scope>
</dependency>

I manually inserted the licence.jar file in a new dependency, but on the artifact's <groupId> I put the com.teamdev.jxbrowser (the same on as the JxBrowser dependency on the pom.xml file); and NetBeans automatically linked the licence with the .jars in the library.

Hope it could help someone that might have some similar doubt.



来源:https://stackoverflow.com/questions/37618276/insert-licence-in-maven-dependency

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!