Archiva

Project model cannot be added to database if it inherits groupId and/or version from parent POM

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0
  • Fix Version/s: 1.0.2
  • Component/s: None
  • Labels:
    None
  • Environment:
    Linux Fedora Core 5 / Windows XP
    Java 5
  • Number of attachments :
    1

Description

Adding to database a project model (B) that contains no groupId and/or version, by assuming it inherits them from parent POM, causes an error if another artifact (A) with same artifactId but different version had been added previously.
That's because the effect cache key on this particular case is always null:<artifactId>:null making the latter (B) fetch information, such as version, from the former (A) during the artifact processing (please see processArchivaArtifact method from ProjectModelToDatabaseConsumer class for more information).

Below is an example of this particular error:

File redback-users-api-1.0-alpha-4.pom has an invalid project model [groupId:org.codehaus.plexus.redback|artifactId:redback-users-api|version:1.0-alpha-3|packaging:null]; The model version [1.0-alpha-3] does not match the version portion of the filename: 1.0-alpha-4

This issue may be related to http://jira.codehaus.org/browse/MRM-608.

Issue Links

Activity

Hide
Dário Oliveros added a comment -

I've made a change to archiva-repository-layer component and this issue seems to be fixed now.
Attached it the patch file. Please let me know any comments on it.

Dário

Show
Dário Oliveros added a comment - I've made a change to archiva-repository-layer component and this issue seems to be fixed now. Attached it the patch file. Please let me know any comments on it. Dário
Hide
Maria Odea Ching added a comment -

The patch works nicely.. thanks Dario!
I applied it in archiva-1.0.x branch -r630722.

Show
Maria Odea Ching added a comment - The patch works nicely.. thanks Dario! I applied it in archiva-1.0.x branch -r630722.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: