Recently we started experiencing intermittent problems with the error 'multiple artifacts retrieved to same module' for artifacts that did not have multiple artifacts.
I have not been able to create a simple contrived error, though I can generally reproduce it in our complex set of environments and artifacts.
It started happening when we started using the branch attribute in our modules. Usually the problem happens when a module has a both a direct and an indirect dependency on another module. We were working around it by excluding the module from being resolved indirectly.
During debugging, I traced it to the fact that a certain identical module revision was not being handled as identical. Specifically, in line 335 of RetrieveEngine, the artifact was being added to the conflictsReports HashSet. The ArtifactDownloadReport.equals() was determining them to be equal, so I did not expect them to be inserted. But the ArtifactDownloadReport.hashCode() was coming up with different integers.
The cause of this is that one of the artifacts had an additional qualified attributed called 'merged' which was not different, even though this was the same version of the same artifact. The value of the attribute looked like:
orgA#moduleA#trunk;build1245 -> orgB#moduleB#trunk;build833
Where module Z is the module being resolved, and it has a direct dependency on module A and moduleB, and moduleB has a direct dependency on moduleA.
So because of the different qualified attribute, an artifact that represented the same file was returning a different hash code.
I'm not sure what this extra 'merged' information represents. It seems to represent something about how the artifact was resolved. There is no possible retrieve pattern that could (or should) differentiate artifacts that differ only in the 'merged' attribute, so I think this is a little too strict.
My strategy, for which I am attaching a patch that passes existing unit tests, is to use a hashCode() and equals() method that represents the minimum necessary to determine whether an artifact maps to a unique file.
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Assignee||Maarten Coene [ maartenc ]|
|Resolution||Fixed [ 1 ]|
|Affects Version/s||trunk [ 12313426 ]|
|Component/s||Core [ 12311511 ]|
|Component/s||Ant [ 12311510 ]|
|Fix Version/s||2.2.0-RC1 [ 12315013 ]|
|Fix Version/s||trunk [ 12313426 ]|
|Transition||Time In Source Status||Execution Times||Last Executer||Last Execution Date|
|4d 18h 51m||1||Maarten Coene||08/Dec/09 20:36|