• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jreleaser / jreleaser / #556

22 Nov 2025 04:17PM UTC coverage: 46.213% (-2.0%) from 48.203%
#556

push

github

aalmiray
feat(jdks): Allow filtering by platform

Closes #2000

Co-authored-by: Ixchel Ruiz <ixchelruiz@yahoo.com>

0 of 42 new or added lines in 5 files covered. (0.0%)

1116 existing lines in 107 files now uncovered.

24939 of 53965 relevant lines covered (46.21%)

0.46 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

4.17
/plugins/jreleaser/src/main/java/org/jreleaser/cli/Download.java
1
/*
2
 * SPDX-License-Identifier: Apache-2.0
3
 *
4
 * Copyright 2020-2025 The JReleaser authors.
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     https://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
package org.jreleaser.cli;
19

20
import org.jreleaser.model.api.JReleaserCommand;
21
import org.jreleaser.model.api.JReleaserContext.Mode;
22
import org.jreleaser.model.internal.JReleaserContext;
23
import org.jreleaser.workflow.Workflows;
24
import picocli.CommandLine;
25

26
import java.util.Set;
27

28
/**
29
 * @author Andres Almiray
30
 * @since 1.1.0
31
 */
32
@CommandLine.Command(name = "download")
33
public class Download extends AbstractModelCommand<Main> {
1✔
34
    @CommandLine.Option(names = {"--dry-run"})
35
    Boolean dryrun;
36

37
    @CommandLine.ArgGroup
38
    Composite composite;
39

40
    static class Composite {
×
41
        @CommandLine.ArgGroup(exclusive = false, order = 1,
42
            headingKey = "include.filter.header")
43
        Include include;
44

45
        @CommandLine.ArgGroup(exclusive = false, order = 2,
46
            headingKey = "exclude.filter.header")
47
        Exclude exclude;
48

49
        String[] includedDownloaderTypes() {
50
            return null != include ? include.includedDownloaderTypes : null;
×
51
        }
52

53
        String[] includedDownloaderNames() {
54
            return null != include ? include.includedDownloaderNames : null;
×
55
        }
56

57
        String[] excludedDownloaderTypes() {
58
            return null != exclude ? exclude.excludedDownloaderTypes : null;
×
59
        }
60

61
        String[] excludedDownloaderNames() {
62
            return null != exclude ? exclude.excludedDownloaderNames : null;
×
63
        }
64
    }
65

66
    static class Include {
×
67
        @CommandLine.Option(names = {"-d", "--downloader"},
68
            paramLabel = "<downloader>")
69
        String[] includedDownloaderTypes;
70

71
        @CommandLine.Option(names = {"-dn", "--downloader-name"},
72
            paramLabel = "<name>")
73
        String[] includedDownloaderNames;
74
    }
75

76
    static class Exclude {
×
77
        @CommandLine.Option(names = {"-xd", "--exclude-downloader"},
78
            paramLabel = "<downloader>")
79
        String[] excludedDownloaderTypes;
80

81
        @CommandLine.Option(names = {"-xdn", "--exclude-downloader-name"},
82
            paramLabel = "<name>")
83
        String[] excludedDownloaderNames;
84
    }
85

86
    @Override
87
    protected void collectCandidateDeprecatedArgs(Set<AbstractCommand.DeprecatedArg> args) {
UNCOV
88
        super.collectCandidateDeprecatedArgs(args);
×
UNCOV
89
        args.add(new DeprecatedArg("-d", "--downloader", "1.5.0"));
×
UNCOV
90
        args.add(new DeprecatedArg("-dn", "--downloader-name", "1.5.0"));
×
UNCOV
91
        args.add(new DeprecatedArg("-xd", "--exclude-downloader", "1.5.0"));
×
UNCOV
92
        args.add(new DeprecatedArg("-xdn", "--exclude-downloader-name", "1.5.0"));
×
UNCOV
93
    }
×
94

95
    @Override
96
    protected void doExecute(JReleaserContext context) {
UNCOV
97
        if (null != composite) {
×
98
            context.setIncludedDownloaderTypes(collectEntries(composite.includedDownloaderTypes(), true));
×
99
            context.setIncludedDownloaderNames(collectEntries(composite.includedDownloaderNames()));
×
100
            context.setExcludedDownloaderTypes(collectEntries(composite.excludedDownloaderTypes(), true));
×
101
            context.setExcludedDownloaderNames(collectEntries(composite.excludedDownloaderNames()));
×
102
        }
UNCOV
103
        Workflows.download(context).execute();
×
UNCOV
104
    }
×
105

106
    @Override
107
    protected Boolean dryrun() {
UNCOV
108
        return dryrun;
×
109
    }
110

111
    @Override
112
    protected Mode getMode() {
UNCOV
113
        return Mode.DOWNLOAD;
×
114
    }
115

116
    @Override
117
    protected JReleaserCommand getCommand() {
UNCOV
118
        return JReleaserCommand.DOWNLOAD;
×
119
    }
120
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc