What is the difference between maven dependencies org.apache.commons:commons-io and commons-io:commons-io?
Asked Answered
D

3

22

Maven repositories contain these two dependencies: org.apache.commons:commons-io:1.3.2 and commons-io:commons-io:1.3.2. What is the difference and which one I should be using in my pom.xml?

In general some of the apache commons packages are located in http://repo1.maven.org/maven2/org/apache/commons/ and most of the commons-* packages are located here http://repo1.maven.org/maven2/.

Defloration answered 6/4, 2011 at 12:58 Comment(2)
I'm just fighting this confusion too. To make matter worse, on Maven repo you'll learn that for commons-io the groupId was changed from org.apache.commons to commons-io, but for commons-lang it's the other way around.Morganne
Beware that if you had an old version of org.apache.commons:commons-io (for instance, in your local maven .m2/repository) it won't have a "relocation" tag in there, so if you have both it and io-commons as dependency/transitive dependencies you may end up with two different versions of the jars in your classpath (yikes maven). To fix remove folder ~/.m2/repository/org/apache/commons/commons-io to force redownloadPalingenesis
T
7

From commons-io website. the latest release is 2.0.1. 1.3.2 is pretty old. Given this information, the repository in http://repo2.maven.org/maven2/commons-io/ holds the latest releases and is the right one to use.

This related mail thread makes interesting reading.

Tachyphylaxis answered 8/4, 2011 at 8:9 Comment(0)
S
13

The deployment of

org.apache.commons:commons-io:1.3.2

Was a mistake that was ultimately fixed by relocating:

POM of org.apache.commons:commons-io:1.3.2

To use commons-io:commons-io:1.3.2.

The mistake was likely an attempt to migrate the Commons IO library to use the current naming convention for Maven groupIds.

Sumerlin answered 24/5, 2016 at 19:0 Comment(0)
T
7

From commons-io website. the latest release is 2.0.1. 1.3.2 is pretty old. Given this information, the repository in http://repo2.maven.org/maven2/commons-io/ holds the latest releases and is the right one to use.

This related mail thread makes interesting reading.

Tachyphylaxis answered 8/4, 2011 at 8:9 Comment(0)
F
1

The two dependencies look the same. I would prefer to use commons-io:commons-io, cause the pom of org.apache.commons:commons-io:1.3.2 is wrong (wrong groupId!)

The artifacts located at this position: http://repo1.maven.org/maven2/org/apache/commons/ are newer in date than the others.

Francisfrancisca answered 6/4, 2011 at 16:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.