• 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.33
/plugins/jreleaser/src/main/java/org/jreleaser/cli/Catalog.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 1.5.0
30
 */
31
@CommandLine.Command(name = "catalog")
32
public class Catalog extends AbstractPlatformAwareModelCommand<Main> {
1✔
33
    @CommandLine.ArgGroup
34
    Composite composite;
35

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

41
        @CommandLine.ArgGroup(exclusive = false, order = 2,
42
            headingKey = "exclude.filter.header")
43
        Exclude exclude;
44

45
        String[] includedDistributions() {
46
            return null != include ? include.includedDistributions : null;
×
47
        }
48

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

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

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

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

65
        String[] includedDeployerNames() {
66
            return null != include ? include.includedDeployerNames : null;
×
67
        }
68

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

73
        String[] excludedDeployerNames() {
74
            return null != exclude ? exclude.excludedDeployerNames : null;
×
75
        }
76
    }
77

78
    static class Include {
×
79
        @CommandLine.Option(names = {"--distribution"},
80
            paramLabel = "<distribution>")
81
        String[] includedDistributions;
82

83
        @CommandLine.Option(names = {"--cataloger"},
84
            paramLabel = "<cataloger>")
85
        String[] includedCatalogers;
86

87
        @CommandLine.Option(names = {"-y", "--deployer"},
88
            paramLabel = "<deployer>")
89
        String[] includedDeployerTypes;
90

91
        @CommandLine.Option(names = {"-yn", "--deployer-name"},
92
            paramLabel = "<name>")
93
        String[] includedDeployerNames;
94
    }
95

96
    static class Exclude {
×
97
        @CommandLine.Option(names = {"--exclude-distribution"},
98
            paramLabel = "<distribution>")
99
        String[] excludedDistributions;
100

101
        @CommandLine.Option(names = {"--exclude-cataloger"},
102
            paramLabel = "<cataloger>")
103
        String[] excludedCatalogers;
104

105
        @CommandLine.Option(names = {"-xy", "--exclude-deployer"},
106
            paramLabel = "<deployer>")
107
        String[] excludedDeployerTypes;
108

109
        @CommandLine.Option(names = {"-xyn", "--exclude-deployer-name"},
110
            paramLabel = "<name>")
111
        String[] excludedDeployerNames;
112
    }
113

114
    @Override
115
    protected void collectCandidateDeprecatedArgs(Set<DeprecatedArg> args) {
UNCOV
116
        super.collectCandidateDeprecatedArgs(args);
×
UNCOV
117
        args.add(new DeprecatedArg("-y", "--deployer", "1.5.0"));
×
UNCOV
118
        args.add(new DeprecatedArg("-yn", "--deployer-name", "1.5.0"));
×
UNCOV
119
        args.add(new DeprecatedArg("-xy", "--exclude-deployer", "1.5.0"));
×
UNCOV
120
        args.add(new DeprecatedArg("-xyn", "--exclude-deployer-name", "1.5.0"));
×
UNCOV
121
    }
×
122

123
    @Override
124
    protected void doExecute(JReleaserContext context) {
UNCOV
125
        if (null != composite) {
×
126
            context.setIncludedDistributions(collectEntries(composite.includedDistributions()));
×
127
            context.setExcludedDistributions(collectEntries(composite.excludedDistributions()));
×
128
            context.setIncludedCatalogers(collectEntries(composite.includedCatalogers(), true));
×
129
            context.setExcludedCatalogers(collectEntries(composite.excludedCatalogers(), true));
×
130
            context.setIncludedDeployerTypes(collectEntries(composite.includedDeployerTypes(), true));
×
131
            context.setIncludedDeployerNames(collectEntries(composite.includedDeployerNames()));
×
132
            context.setExcludedDeployerTypes(collectEntries(composite.excludedDeployerTypes(), true));
×
133
            context.setExcludedDeployerNames(collectEntries(composite.excludedDeployerNames()));
×
134
        }
UNCOV
135
        Workflows.catalog(context).execute();
×
UNCOV
136
    }
×
137

138
    @Override
139
    protected JReleaserCommand getCommand() {
UNCOV
140
        return JReleaserCommand.CATALOG;
×
141
    }
142
}
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