checksum-maven-plugin icon indicating copy to clipboard operation
checksum-maven-plugin copied to clipboard

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project test: Failed to deploy artifacts: Could not find artifact test:test:java-source.sha256:sources:0.0.0-20190123.104420-58

Open michelpromonet opened this issue 5 years ago • 3 comments

Trying to deploy source with checksum to artifactory fails with the error:

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 8.201 s [INFO] Finished at: 2019-01-23T11:44:26+01:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project test: Failed to deploy artifacts: Could not find artifact test:test:java-source.sha256:sources:0.0.0-20190123.104420-58 in xxxxx (https://artifactoryxxxxxxxxxxx/snapshots/) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

It fails with the pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>test</groupId>
  <artifactId>test</artifactId>
  <version>0.0.0-SNAPSHOT</version>
  <name>test</name>
  <build>
    <plugins>
      <plugin>
        <groupId>net.nicoulaj.maven.plugins</groupId>
        <artifactId>checksum-maven-plugin</artifactId>
        <version>1.8</version>
        <executions>
          <execution>
            <goals>
              <goal>artifacts</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <algorithms><algorithm>SHA-256</algorithm></algorithms>
          <appendFilename>true</appendFilename>
          <attachChecksums>true</attachChecksums>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Removing the attach-sources, it deploy correctly, removing <attachChecksums>true</attachChecksums> also. But every together, it fails.

Thanks for your help, Michel.

michelpromonet avatar Jan 23 '19 10:01 michelpromonet

maven-source-plugin uses a type (=java-source) which is not equal to the extension (jar). checksum-maven-plugin incorrectly used the type for the extension. So probably duplicate of #63 and most probably fixed by #87 .

kwin avatar Jun 09 '20 11:06 kwin

Hi Konrad,

This sounds good, is there some snapshot version that I can try ?

Best Regards, Michel.

michelpromonet avatar Jun 09 '20 12:06 michelpromonet

@michelpromonet Just compile the version yourself from the PR #87 /

kwin avatar Jun 09 '20 13:06 kwin