What pom dependency should I use for jar commons-lang.jar

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

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

+4
source share
3 answers

If you upgrade to Maven and have a bunch of cans, you can try exploring their META-INF/MANIFEST.MF files inside these banners.

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

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

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

 <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.4</version> </dependency> 
+2
source

First use one of Apache.

Secondly, you have two options: branches 2.x or 3.x; from mvnrepository.com search:

2.6

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

3.1

 <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.1</version> </dependency> 

If you are using Maven, you should not have "only jar", you should only know about POM dependencies.

(As of February 2014, it is up to 3.3.2, the 2.x series is still 2.6. Please note that you can use both applications in the same application because of their different packages.)

+7
source

While the other answers are correct, it’s a very convenient way to find an exact match for an unknown banquet where all you have is the jar itself and it doesn’t have a useful manifest to create the sha1 checksum in the bank and then do a search for the checksum amounts on http://search.maven.org in the advanced search below or on your own instance of the Nexus warehouse server that loads the Central Repository index.

And by the way, your search in the center was wrong, because it had the wrong groupId. Here is the corrected link:

http://search.maven.org/#search%7Cga%7C1%7C%22commons-lang%22

+3
source

Source: https://habr.com/ru/post/1395258/


All Articles