Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When providing multiple algorithms, checksum:artifacts fails when using summary #46

Open
patrickfav opened this issue May 26, 2017 · 3 comments
Labels

Comments

@patrickfav
Copy link

patrickfav commented May 26, 2017

When I add multiple algorithms in the pom plugin config the build fails with:

Failed to execute goal net.nicoulaj.maven.plugins:checksum-maven-plugin:1.5:artifacts (default-cli) on project uber-apk-signer: Must use only one type of hash

when using:

mvn clean install checksum:artifacts

My config is:

            <plugin>
                <groupId>net.nicoulaj.maven.plugins</groupId>
                <artifactId>checksum-maven-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>artifacts</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <algorithms>
                        <algorithm>SHA-256</algorithm>
                        <algorithm>SHA-1</algorithm>
                    </algorithms>
                    <shasumSummary>true</shasumSummary>
                    <shasumSummaryFile>checksum.txt</shasumSummaryFile>
                    <attachChecksums>false</attachChecksums>
                    <quiet>false</quiet>
                </configuration>
            </plugin>

It seems when not using summary, this works.

Full project: https://github.com/patrickfav/uber-apk-signer

btw. the doc lacks correct closing tags with <algorithm>...</algorithm> here https://checksum-maven-plugin.nicoulaj.net/artifacts-mojo.html#algorithms

@patrickfav patrickfav changed the title When providing multiple algorithms, checksum:artifacts fails When providing multiple algorithms, checksum:artifacts fails when using summary May 26, 2017
@bondolo
Copy link
Collaborator

bondolo commented May 26, 2017

The intention of the summary file is to produce a file compatible with the *nix shasum file format. This file format does not support multiple algorithms so unfortunately neither can the checksum plugin. Your solution is to use multiple executions each with a single algorithm and a different ouput file.

@patrickfav
Copy link
Author

Hi bondolo,
Thanks for the quick reply. How about generating multiple summary files then? Otherwise the algorithm config is kind of confusing.

@bondolo
Copy link
Collaborator

bondolo commented Jun 2, 2017

That is a possibility but you could do what we do which is to have multiple executions, one for each desired hash type. The per-execution configuration is just the algorithm and filename.

nicoulaj added a commit that referenced this issue Jul 6, 2017
Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
@nicoulaj nicoulaj added this to the 2.0 milestone Jul 6, 2017
@nicoulaj nicoulaj removed this from the 2.0 milestone Sep 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants