Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5004

updatePolicy="never" always does 1 initial check

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.2.1
    • None
    • None
    • None
    • Windows, linux

    Description

      I'm having an issue with marking my repository as <updatePolicy>never</updatePolicy>. It seems as though even with the never parameter, the first time an artifact is referenced, an initial check to the remote repo happens. After that, the metadata.xml is created locally and further checks for updates don't occur.

      Situation:
      artifactB depends on artifactA

      Procedure:
      1) install artifactA locally
      2) build artifactB locally, with repo updatepolicy never. The hope would be that the locally installed artifactA will be used, without ever contacting the remote repository.

      Result:
      Maven goes to the remote repository to get info on artifactA ("checking for updates") If there is a newer than local version, it is downloaded. metadata.xml is created locally with name metada-<repoid>.xml

      updatePolicy=never should never check for updates if there is a local copy.

      Sample and log attached. Notice in the log this section:
      [DEBUG] Connecting to repository: 'crib-snap' with url: 'http://9.44.169.102:8888/nexus/content/repositories/crib-snap'.
      [DEBUG] Using Wagon implementation lightweight from default mapping for protocol http
      [DEBUG] repository metadata for: 'snapshot enf.test:artifactA:1.0.0-SNAPSHOT' could not be found on repository: crib-snap
      [DEBUG] Skipping disabled repository central
      [DEBUG] artifactA: using locally installed snapshot
      [DEBUG] enf.test:artifactA:jar:1.0.0-SNAPSHOT:compile (selected for compile)
      [DEBUG] artifactA: using locally installed snapshot

      It should never connect to the repository, since this artifact is local.
      A few other things:
      1) this happens for each defined repository that has never been visited.
      2) a metadata file is created in the repo for each repo after this occurs.

      Version experience:
      With maven 2.2.1 it behaves as I posted, always doing one initial check and pulling down the newer version if available.

      With maven 3.0.1 it behaves correctly and does not go to the remote repository at all.

      Attachments

        1. mvnbug.zip
          16 kB
          ed fink
        2. log.txt
          94 kB
          ed fink

        Issue Links

          Activity

            People

              bentmann Benjamin Bentmann
              finked ed fink
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: