1

My maven build emits several INFOs like this:

[INFO] ------------------------------------------------------------------------
Downloading: http://repository.springsource.com/maven/bundles/release/com/ibm/icu/icu4j/3.4.1/icu4j-3.4.1.pom
[INFO] Unable to find resource 'com.ibm.icu:icu4j:pom:3.4.1' in repository com.springsource.repository.bundles.release (http://repository.springsource.com/maven/bundles/release)
Downloading: http://repository.springsource.com/maven/bundles/external/com/ibm/icu/icu4j/3.4.1/icu4j-3.4.1.pom
[INFO] Unable to find resource 'com.ibm.icu:icu4j:pom:3.4.1' in repository com.springsource.repository.bundles.external (http://repository.springsource.com/maven/bundles/external)
Downloading: http://repo1.maven.org/maven2/com/ibm/icu/icu4j/3.4.1/icu4j-3.4.1.pom

The build does eventually succeed, but without ever downloading icu4j. Then the next time I build is exactly the same.

I found this very related question. What I don't understand is how does the build succeed if it really can't find the resource? And if it does find it in the end, why is the resource being downloaded again?

I did find my .m2 folder contains a folder by the name of com/ibm/icu/icu4j/3.4.4/, so I'm deducing there is a conflicting dependency somewhere in my pom structure.

How do I resolve this conflict? Again, the project does compile, but it tries to download files on every build, and I'd rather have it compile cleanly.

Community
  • 1
  • 1
ripper234
  • 222,824
  • 274
  • 634
  • 905

1 Answers1

0

The build does eventually succeed, but without ever downloading icu4j

From the message it looks like maven attempts to download the 3.4.1 version of icu4j dependency first from com.springsource.repository.bundles.release, then com.springsource.repository.bundles.external and finally from central (the default).

There is no 3.4.1 version of icu4j in the repository. The project or a dependency in the project has specified this version as a dependency. Hence maven attempts to download it each time it builds.

As it turns, there is a project dependency on 3.4.4 version of icu4j, which gets successfully downloaded. Maven uses this version (as per dependency resolution rules) and hence the build succeeds.

Running mvn dependency:tree should give details of who uses which version of icu4j and make changes appropriately.

Raghuram
  • 51,854
  • 11
  • 110
  • 122
  • No, when I do N times of "mvn compile" it always prints these messages. I only deleted the repo once as an anlysis step. – ripper234 Apr 27 '11 at 06:39
  • @ripper234. I was misled into believing 3.4.1 version of icu4j gets downloaded from central repo. I guess the INFO message is incomplete. I have updated the answer in light of this. – Raghuram Apr 27 '11 at 07:15