如何将 JNLP API 与 Maven 项目捆绑在一起
我有一个项目需要 JNLP API 。我在 Maven Central 上没有找到相关的工件,因此我添加了一个外部存储库,该存储库为我的 pom.xml 提供了该功能。该存储库本周末离线。这是我第二次发生这样的事情。
我知道这几乎是 Maven 所不关心的,但实际上我只是希望那个小小的 jnlp-api-1.5.0.jar 文件位于
- 我的 SCM 中(我不想滚动我的自己的 Maven 存储库仅用于一个依赖项)。
- 在项目构建时的编译范围内。
我必须转动哪些旋钮才能完成此操作?
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
- In my SCM (I don't want to roll my own Maven repository for just one dependency).
- In the compile scope when the project builds.
Which knobs do I have to turn to accomplish this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 JDK 7.0 开始,JNLP API 由 JRE 的 lib 目录中的
javaws.jar
文件提供,即${java.home}/lib/javaws.jar
>。可以使用maven依赖范围system
。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 scopesystem
.您可以使用 install- 将 JAR 放入本地存储库中file maven-install-plugin 的目标并像平常在 POM 中一样引用它。命令为:
将此命令放入脚本中并将其签入 SCM。这样,您(以及从事该项目的其他人)就可以轻松地将其安装到本地存储库。
You can put the JAR in your local repository using the install-file goal of the maven-install-plugin and reference it as you normally would in your POM. The command would be:
Place this command in a script and check it into your SCM. That way, you (and anyone else working on this project) can install it easily to the local repo.