我应该对jar commons-lang.jar使用哪个pom依赖项 [英] Which pom dependency should I use for jar commons-lang.jar

查看:263
本文介绍了我应该对jar commons-lang.jar使用哪个pom依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何知道如果pom依赖项的版本不在jar名称中,我应该使用哪个版本.例如jar commons-lang.jar,我应该使用哪个版本的pom依赖项?

How do I know which version of a pom dependency I should use if its version is not in the jar name. For example the jar commons-lang.jar, what version of the pom dependency should I use ?

以下是其在Maven Central仓库中的搜索结果-

Here are its search results on maven central repo - http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22net.sf.staccatocommons%22%20AND%20a%3A%22commons-lang%22

推荐答案

如果您要迁移到Maven并只有一堆jar,则可以尝试检查这些jar中的META-INF/MANIFEST.MF文件.

If you are migrating to Maven and just have a bunch of jars then you can try examining their META-INF/MANIFEST.MF files inside of those jars.

我刚刚打开commons-lang.jar,并在其META-INF/MANIFEST.MF中看到了以下内容:

I've just opened commons-lang.jar and saw the following in its META-INF/MANIFEST.MF:

...
Implementation-Title: Commons Lang
Implementation-Vendor: The Apache Software Foundation
Implementation-Vendor-Id: org.apache
Implementation-Version: 2.4
...

因此您可以在pom.xml中使用Implementation-Version作为版本:

So you can use Implementation-Version as your version in pom.xml:

<dependency>
  <groupId>commons-lang</groupId>
  <artifactId>commons-lang</artifactId>
  <version>2.4</version>
</dependency>

这篇关于我应该对jar commons-lang.jar使用哪个pom依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆