• 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

5.0
/plugins/jreleaser/src/main/java/org/jreleaser/cli/AbstractPackagerModelCommand.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.internal.JReleaserContext;
21
import picocli.CommandLine;
22

23
import java.util.Set;
24

25
/**
26
 * @author Andres Almiray
27
 * @since 1.5.0
28
 */
29
@CommandLine.Command
30
public abstract class AbstractPackagerModelCommand<C extends IO> extends AbstractPlatformAwareModelCommand<C> {
1✔
31
    @CommandLine.ArgGroup
32
    Composite composite;
33

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

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

43
        String[] includedPackagers() {
UNCOV
44
            return null != include ? include.includedPackagers : null;
×
45
        }
46

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

51
        String[] excludedPackagers() {
UNCOV
52
            return null != exclude ? exclude.excludedPackagers : null;
×
53
        }
54

55
        String[] excludedDistributions() {
UNCOV
56
            return null != exclude ? exclude.excludedDistributions : null;
×
57
        }
58
    }
59

60
    static class Include {
×
61
        @CommandLine.Option(names = {"-d", "--distribution"},
62
            paramLabel = "<distribution>")
63
        String[] includedDistributions;
64

65
        @CommandLine.Option(names = {"-p", "--packager"},
66
            paramLabel = "<packager>")
67
        String[] includedPackagers;
68
    }
69

UNCOV
70
    static class Exclude {
×
71
        @CommandLine.Option(names = {"-xd", "--exclude-distribution"},
72
            paramLabel = "<distribution>")
73
        String[] excludedDistributions;
74

75
        @CommandLine.Option(names = {"-xp", "--exclude-packager"},
76
            paramLabel = "<packager>")
77
        String[] excludedPackagers;
78
    }
79

80
    @Override
81
    protected void collectCandidateDeprecatedArgs(Set<AbstractCommand.DeprecatedArg> args) {
UNCOV
82
        super.collectCandidateDeprecatedArgs(args);
×
UNCOV
83
        args.add(new DeprecatedArg("-d", "--distribution", "1.5.0"));
×
UNCOV
84
        args.add(new DeprecatedArg("-xd", "--exclude-distribution", "1.5.0"));
×
UNCOV
85
        args.add(new DeprecatedArg("-p", "--packager", "1.5.0"));
×
UNCOV
86
        args.add(new DeprecatedArg("-xp", "--exclude-packager", "1.5.0"));
×
UNCOV
87
    }
×
88

89
    @Override
90
    protected void doExecute(JReleaserContext context) {
UNCOV
91
        if (null != composite) {
×
UNCOV
92
            context.setIncludedPackagers(collectEntries(composite.includedPackagers(), true));
×
UNCOV
93
            context.setIncludedDistributions(collectEntries(composite.includedDistributions()));
×
UNCOV
94
            context.setExcludedPackagers(collectEntries(composite.excludedPackagers(), true));
×
UNCOV
95
            context.setExcludedDistributions(collectEntries(composite.excludedDistributions()));
×
96
        }
UNCOV
97
    }
×
98
}
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