nicoulaj/checksum-maven-plugin

`mvn install` result does not match output in /target

Closed this issue · 3 comments

I have a maven build that results in a .war file. The checksum-maven-plugin is configured as follows.

            <plugin>
              <groupId>net.ju-n.maven.plugins</groupId>
              <artifactId>checksum-maven-plugin</artifactId>
              <version>1.3</version>
              <executions>
                <execution>
                  <goals>
                    <goal>artifacts</goal>
                  </goals>
                </execution>
              </executions>
              <configuration>
                <algorithms>
                  <algorithm>SHA-256</algorithm>
                </algorithms>
                <attachChecksums>true</attachChecksums>
              </configuration>
            </plugin>

I am building version master-SNAPSHOT

Result in target

The output in target is as expected:

app.war
app.war.sha256

Result in .m2/repository/package

After mvn install the result in the Maven repository does not match:

app-master-SNAPSHOT.war
app-master-SNAPSHOT..sha256
srdo commented

We have the same issue. Our project generates a project.war, a project-classes.jar and a project-test.jar. Using attachChecksums results in the correct output in /target (3 war/jars and 3 md5 files), but it looks like the install and deploy goals drop the artifact classifier, so the md5's are uploaded as project..md5 for all 3 artifacts.

@nicoulaj Can this issue be reopened? This bug is still present.

To clarify: the double dot problem is fixed, but the classifiers are still missing.
E.g. in a build that generates 3 artifacts that differ only in classifier and/or extension:

artifact-version.ext1
artifact-version.ext2
artifact-version-c1.ext3

The checksum files will be correctly generated in /target:

artifact-version.ext1.sha256
artifact-version.ext2.sha256
artifact-version-c1.ext3.sha256

But if attachChecksums==true, when installing/deploying them, they will overwrite each other like this:

artifact-version.sha256
artifact-version.sha256
artifact-version.sha256

Which results in 1 artifact that could be any of the above 3 checksum files.