• 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

3.03
/plugins/jreleaser/src/main/java/org/jreleaser/cli/Upload.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.internal.JReleaserContext;
22
import org.jreleaser.workflow.Workflows;
23
import picocli.CommandLine;
24

25
import java.util.Set;
26

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

36
    @CommandLine.ArgGroup
37
    Composite composite;
38

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

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

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

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

56
        String[] includedDistributions() {
57
            return null != include ? include.includedDistributions : null;
×
58
        }
59

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

64
        String[] excludedUploaderNames() {
65
            return null != exclude ? exclude.excludedUploaderNames : null;
×
66
        }
67

68
        String[] excludedDistributions() {
69
            return null != exclude ? exclude.excludedDistributions : null;
×
70
        }
71

72
        String[] includedCatalogers() {
73
            return null != include ? include.includedCatalogers : null;
×
74
        }
75

76
        String[] excludedCatalogers() {
77
            return null != exclude ? exclude.excludedCatalogers : null;
×
78
        }
79
    }
80

81
    static class Include {
×
82
        @CommandLine.Option(names = {"-u", "--uploader"},
83
            paramLabel = "<uploader>")
84
        String[] includedUploaderTypes;
85

86
        @CommandLine.Option(names = {"-un", "--uploader-name"},
87
            paramLabel = "<name>")
88
        String[] includedUploaderNames;
89

90
        @CommandLine.Option(names = {"-d", "--distribution"},
91
            paramLabel = "<distribution>")
92
        String[] includedDistributions;
93
        @CommandLine.Option(names = {"--cataloger"},
94
            paramLabel = "<cataloger>")
95
        String[] includedCatalogers;
96
    }
97

98
    static class Exclude {
×
99
        @CommandLine.Option(names = {"-xu", "--exclude-uploader"},
100
            paramLabel = "<uploader>")
101
        String[] excludedUploaderTypes;
102

103
        @CommandLine.Option(names = {"-xun", "--exclude-uploader-name"},
104
            paramLabel = "<name>")
105
        String[] excludedUploaderNames;
106

107
        @CommandLine.Option(names = {"-xd", "--exclude-distribution"},
108
            paramLabel = "<distribution>")
109
        String[] excludedDistributions;
110
        @CommandLine.Option(names = {"--exclude-cataloger"},
111
            paramLabel = "<cataloger>")
112
        String[] excludedCatalogers;
113
    }
114

115
    @Override
116
    protected void collectCandidateDeprecatedArgs(Set<AbstractCommand.DeprecatedArg> args) {
UNCOV
117
        super.collectCandidateDeprecatedArgs(args);
×
UNCOV
118
        args.add(new DeprecatedArg("-d", "--distribution", "1.5.0"));
×
UNCOV
119
        args.add(new DeprecatedArg("-xd", "--exclude-distribution", "1.5.0"));
×
UNCOV
120
        args.add(new DeprecatedArg("-u", "--uploader", "1.5.0"));
×
UNCOV
121
        args.add(new DeprecatedArg("-un", "--uploader-name", "1.5.0"));
×
UNCOV
122
        args.add(new DeprecatedArg("-xu", "--exclude-uploader", "1.5.0"));
×
UNCOV
123
        args.add(new DeprecatedArg("-xun", "--exclude-uploader-name", "1.5.0"));
×
UNCOV
124
    }
×
125

126
    @Override
127
    protected void doExecute(JReleaserContext context) {
UNCOV
128
        if (null != composite) {
×
129
            context.setIncludedUploaderTypes(collectEntries(composite.includedUploaderTypes(), true));
×
130
            context.setIncludedUploaderNames(collectEntries(composite.includedUploaderNames()));
×
131
            context.setIncludedDistributions(collectEntries(composite.includedDistributions()));
×
132
            context.setIncludedCatalogers(collectEntries(composite.includedCatalogers(), true));
×
133
            context.setExcludedUploaderTypes(collectEntries(composite.excludedUploaderTypes(), true));
×
134
            context.setExcludedUploaderNames(collectEntries(composite.excludedUploaderNames()));
×
135
            context.setExcludedDistributions(collectEntries(composite.excludedDistributions()));
×
136
            context.setExcludedCatalogers(collectEntries(composite.excludedCatalogers(), true));
×
137
        }
UNCOV
138
        Workflows.upload(context).execute();
×
UNCOV
139
    }
×
140

141
    @Override
142
    protected Boolean dryrun() {
UNCOV
143
        return dryrun;
×
144
    }
145

146
    @Override
147
    protected JReleaserCommand getCommand() {
UNCOV
148
        return JReleaserCommand.UPLOAD;
×
149
    }
150
}
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