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

Maven shows fake network error until the next updatePolicy period

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.8
    • None
    • General
    • None

    Description

      Hi,

      The default updatePolicy is daily.

      If it has any problems in updating it marks that plugin as checked and keeping showing the same error message without trying to hit the server again.

      At my work they changed the proxy configuration making the build fail, we started to have the following message:

      The plugin 'org.apache.maven.plugins:maven-clean-plugin' does not exist or no valid version could be found.

      Even after they rollback the network configuration, maven still showing the same error.

      To solve the problem I had to put this lines
      <pluginRepository>
      <releases>
      <updatePolicy>always</updatePolicy>
      </releases>
      <snapshots>
      <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>Maven Plugin Repository</name>
      <url>http://repo1.maven.org/maven2</url>
      </pluginRepository>

      as the first pluginRepository and run for every developer just to force the update.

      This workaround works fine but until I realized that this is the behavior of maven it generated a lot problems trying setup the network configuration (it was not trying to hit the network, but it still showing the same error, so all configuration attempts were worthless).

      Show a network error that was not checked against the current configuration is a bug.

      My suggestion for an easy solution is to update timestamp of the latest hit in the repository after it has a success, if it fails does not update the timestamp and updatePolicy will make it keep trying for every execution until it finally hit with success. This way you don't need to verify any extra condition to see if the previous try resulted in an error. This way will make the debug of network problems much easier for the users that have the same problem.

      I didn't look your sources, so maybe this solution is not practical in your architecture. Feel free to use another route to solve this bug.

      Thanks for your excellent work in maven (it is first bug in years),
      Jonas Fagundes

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jonasfagundes Jonas Fagundes
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: