Maven checksum failed

后端 未结 5 1723
隐瞒了意图╮
隐瞒了意图╮ 2021-02-07 09:39

I am working on a project that uses Maven as the build tool. I am using version 2.2.1 of the tool. Recently a coworker mentioned that he couldn\'t build the project because of c

相关标签:
5条回答
  • 2021-02-07 09:51

    I manually deleted the artifacts from Archiva and used Archiva to upload them again. This solved my problem. There appeared to be duplicate POMs, JARs, etc in Archiva for the versions that were giving the checksum errors.

    0 讨论(0)
  • 2021-02-07 09:53

    While using a single thread as described bu Rondo below allowed the build complete without error, in the end I found that my work space was corrupted. Possibly due to an interrupted build. I wiped out the work space and created a clean one from the source code manager and everything worked fine again.

    0 讨论(0)
  • 2021-02-07 09:58

    The artifact resolver is (still, even in 3.0.4 apparently) not thread safe:

    http://jira.codehaus.org/browse/MNG-4742

    try building with:

    -Dmaven.artifact.threads=1

    When I build with this option in 3.0.4 in a project that displays checksum errors (for log4j), all of the checksum errors disappear.

    It should apply to 2.2.1 as well.

    (edit: file this answer under 'hiding false negatives')

    0 讨论(0)
  • 2021-02-07 10:06

    The problem appears to be in how the maven client is deploying artifacts to your central repository (Archiva). It's using HTTP and in certain situations will corrupt the checksum signature of the file.

    Try changing your local maven settings file to look something like this, which for me was located in ~/.m2/settings.xml

    <settings>
      <servers>
        <server>
          <id>my-server</id>
          <configuration>
            <httpConfiguration>
              <put>
                <params>
                  <param>
                    <name>http.authentication.preemptive</name>
                    <value>%b,true</value>
                  </param>
                </params>
              </put>
            </httpConfiguration>
          </configuration>
        </server>
      </servers>
    </settings>
    

    After you make that change, redeploy the artifacts to your central repo, then try to run mvn dependency:resolve in your local project to see if the checksum errors still happen.

    Here's a thread about this problem: http://jira.codehaus.org/browse/MNG-4301

    0 讨论(0)
  • 2021-02-07 10:09

    Did you try to change the Checksum policies in the proxy connector to 'fix' instead of 'ignore'?

    0 讨论(0)
提交回复
热议问题