Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to bundle JNLP API with Maven Project

I have a project where I need the JNLP API. I did not find an artifact for that on Maven Central, so I added an external Repository which offers that to my pom. That repository went offline this weekend. This is the second time something like this happened to me.

I know this is pretty much what Maven is not about, but really I just want that tiny jnlp-api-1.5.0.jar file to be

  1. In my SCM (I don't want to roll my own Maven repository for just one dependency).
  2. In the compile scope when the project builds.

Which knobs do I have to turn to accomplish this?

like image 587
Waldheinz Avatar asked Jan 10 '11 09:01

Waldheinz


1 Answers

As of JDK 7.0, the JNLP API is being provided by the javaws.jar file in your JRE's lib directory, i.e., ${java.home}/lib/javaws.jar. It is possible to use the maven dependency scope system.

<project>
  ...
  <dependencies>
    <dependency>
      <groupId>javax.jnlp</groupId>
      <artifactId>jnlp-api</artifactId>
      <version>7.0</version>
      <scope>system</scope>
      <systemPath>${java.home}/lib/javaws.jar</systemPath>
    </dependency>
  </dependencies>
  ...
</project>
like image 99
Jcs Avatar answered Oct 06 '22 09:10

Jcs