Maven 2 & 3

Transfer errors cause junk metadata in the local repo

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0.8
  • Fix Version/s: 2.0.9
  • Labels:
    None
  • Number of attachments :
    1

Description

I see this all the time and I swear there was an issue for it, but now I can't find it. Sometimes there is metadata in the repo, usually after an offline build or a build where something went wrong downloading artifacts. Maven will apparently decide based on the metadata that the file can never be found and will simply fail on a missing artifact. You can tell this has happened because no attempt has actually been made to download the artifact from a repository. Subsequent clearing of (portions) the localrepo fixes the issue. This is terribly confusing to new users...and annoying to everyone.

Issue Links

Activity

Hide
Brett Porter added a comment -

no time to test it today - but I think this patch would resolve this issue

Show
Brett Porter added a comment - no time to test it today - but I think this patch would resolve this issue
Hide
Brett Porter added a comment -

using MNG-3341's IT as a basis should make it pretty easy to reproduce (just use an invalid wagon to trigger the error). However, what really needs to be rechecked is that no other metadata operations break as a result (most particularly, you don't want to end up downloading missing metadata every time if it doesn't exist)

Show
Brett Porter added a comment - using MNG-3341's IT as a basis should make it pretty easy to reproduce (just use an invalid wagon to trigger the error). However, what really needs to be rechecked is that no other metadata operations break as a result (most particularly, you don't want to end up downloading missing metadata every time if it doesn't exist)
Hide
John Casey added a comment -

I have the fix in place on my localhost, but I'm still trying to nail down the integration tests and make them work in both 2.0.9 and 2.1. It'll be Monday before I get this sorted out.

Show
John Casey added a comment - I have the fix in place on my localhost, but I'm still trying to nail down the integration tests and make them work in both 2.0.9 and 2.1. It'll be Monday before I get this sorted out.
Hide
John Casey added a comment -

This issue is fixed. I applied Brett's patch (thanks for the heavy lifting here, Brett), and added integration tests to check writing the metadata on ResourceNotFoundException, but not on TransferFailedException.

NOTE: This integration test required a little extra functionality in the abstract parent test class, to allow conditional use of different files for the updateInterval calculation (we're making sure these files are not modified on successive builds when ResourceNotFoundException happens).

The integration test should be fairly well-documented, so have a look.

Show
John Casey added a comment - This issue is fixed. I applied Brett's patch (thanks for the heavy lifting here, Brett), and added integration tests to check writing the metadata on ResourceNotFoundException, but not on TransferFailedException. NOTE: This integration test required a little extra functionality in the abstract parent test class, to allow conditional use of different files for the updateInterval calculation (we're making sure these files are not modified on successive builds when ResourceNotFoundException happens). The integration test should be fairly well-documented, so have a look.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: