jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Archiva
  • MRM-620

pom.xml that inherit version from parent show up in reports as "has an invalid project model"

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.0
  • Fix Version/s: 1.2-M1
  • Component/s: reporting
  • Labels:
    None

Description

Maven2 allows child modules to inherit the <version> tag from a parent. When Archiva sees an empty or nonexistent version tag in the uploaded pom.xml, it thinks that the pom.xml version does not match the artifacts filename, which is true, but is a completely valid scenario. As far as I can tell, there is no requirement to have a version tag in a child module of a parent.

Perhaps Archiva should be looking inside the artifact itself under META-INF/pom.properties to verify the artifacts file name against the version. There is always a version number inside the artifacts pom.properties, but not always in the pom.xml. Perhaps a combination of the pom.xml having a parent tag, and no version information tells Archiva to not consider this an error.

Here is an example of an error generated in reports:

File workflow-core-common-1.0.1-rc1.pom has an invalid project model [groupId:com.tomax.infrastructure.foo|artifactId:foo-core-common|version:1.0.1-SNAPSHOT|packaging:null]; The model version [1.0.1-SNAPSHOT] does not match the version portion of the filename: 1.0.1-rc1

I looked at the artifact it complained about, and the pom.xml has not version tag by design as it is inherited. I don't think this should be an error.

Perhaps Archiva should not produce this error if the version tag does not exist in the pom.xml and there is a parent tag present? As far as I can tell, not having a version tag is completely valid in maven2 as long as parent inheritence provides the version.

Issue Links

is related to

Bug - A problem which impairs or prevents the functions of the product. MRM-687 Project model cannot be added to database if it inherits groupId and/or version from parent POM

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
relates to

Bug - A problem which impairs or prevents the functions of the product. MRM-686 'Unable to find project model' when artifactId contains property placeholders e.g. ${project.parent.artifactId}

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Improvement - An improvement or enhancement to an existing feature or task. MRM-952 Patch for several issues while processing poms (effective model, expressions resolving, storing to database)

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
James MacDonald added a comment - 05/Dec/07 1:07 PM

Sorry, valid example of error in report should be:

File foo-core-common-1.0.1-rc1.pom has an invalid project model [groupId:com.foo.infrastructure.foo|artifactId:foo-core-common|version:1.0.1-SNAPSHOT|packaging:null]; The model version [1.0.1-SNAPSHOT] does not match the version portion of the filename: 1.0.1-rc1

I have no idea why it mentions [1.0.1-SNAPSHOT], the pom.xml has not reference to a snapshot whatsoever and neither does the it's parent. It's a released artifact.

Show
James MacDonald added a comment - 05/Dec/07 1:07 PM Sorry, valid example of error in report should be: File foo-core-common-1.0.1-rc1.pom has an invalid project model [groupId:com.foo.infrastructure.foo|artifactId:foo-core-common|version:1.0.1-SNAPSHOT|packaging:null]; The model version [1.0.1-SNAPSHOT] does not match the version portion of the filename: 1.0.1-rc1 I have no idea why it mentions [1.0.1-SNAPSHOT], the pom.xml has not reference to a snapshot whatsoever and neither does the it's parent. It's a released artifact.
Hide
Permalink
Dário Oliveros added a comment - 12/Feb/08 4:20 AM

That is mostly caused by an effective cache malfunctioning. Please see related issue.

Show
Dário Oliveros added a comment - 12/Feb/08 4:20 AM That is mostly caused by an effective cache malfunctioning. Please see related issue.
Hide
Permalink
Maria Odea Ching added a comment - 10/Oct/08 11:01 PM

Fixed by the patch submitted for MRM-952, which was committed in trunk -r703626.

Show
Maria Odea Ching added a comment - 10/Oct/08 11:01 PM Fixed by the patch submitted for MRM-952, which was committed in trunk -r703626.

People

  • Assignee:
    Unassigned
    Reporter:
    James MacDonald
Vote (1)
Watch (1)

Dates

  • Created:
    05/Dec/07 12:34 PM
    Updated:
    07/Nov/08 7:58 AM
    Resolved:
    10/Oct/08 11:01 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.