我应该对jar commons-lang.jar使用哪个pom依赖项 [英] Which pom dependency should I use for jar commons-lang.jar
问题描述
我如何知道如果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 ?
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屋!