• 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/Deploy.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
import static org.jreleaser.model.api.JReleaserContext.Mode.DEPLOY;
29

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

39
    @CommandLine.ArgGroup
40
    Composite composite;
41

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

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

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

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

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

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

68
    static class Include {
×
69
        @CommandLine.Option(names = {"-y", "--deployer"},
70
            paramLabel = "<deployer>")
71
        String[] includedDeployerTypes;
72

73
        @CommandLine.Option(names = {"-yn", "--deployer-name"},
74
            paramLabel = "<name>")
75
        String[] includedDeployerNames;
76
    }
77

78
    static class Exclude {
×
79
        @CommandLine.Option(names = {"-xy", "--exclude-deployer"},
80
            paramLabel = "<deployer>")
81
        String[] excludedDeployerTypes;
82

83
        @CommandLine.Option(names = {"-xyn", "--exclude-deployer-name"},
84
            paramLabel = "<name>")
85
        String[] excludedDeployerNames;
86
    }
87

88
    @Override
89
    protected void collectCandidateDeprecatedArgs(Set<AbstractCommand.DeprecatedArg> args) {
UNCOV
90
        super.collectCandidateDeprecatedArgs(args);
×
UNCOV
91
        args.add(new DeprecatedArg("-y", "--deployer", "1.5.0"));
×
UNCOV
92
        args.add(new DeprecatedArg("-yn", "--deployer-name", "1.5.0"));
×
UNCOV
93
        args.add(new DeprecatedArg("-xy", "--exclude-deployer", "1.5.0"));
×
UNCOV
94
        args.add(new DeprecatedArg("-xyn", "--exclude-deployer-name", "1.5.0"));
×
UNCOV
95
    }
×
96

97
    @Override
98
    protected void doExecute(JReleaserContext context) {
UNCOV
99
        if (null != composite) {
×
100
            context.setIncludedDeployerTypes(collectEntries(composite.includedDeployerTypes(), true));
×
101
            context.setIncludedDeployerNames(collectEntries(composite.includedDeployerNames()));
×
102
            context.setExcludedDeployerTypes(collectEntries(composite.excludedDeployerTypes(), true));
×
103
            context.setExcludedDeployerNames(collectEntries(composite.excludedDeployerNames()));
×
104
        }
UNCOV
105
        Workflows.deploy(context).execute();
×
UNCOV
106
    }
×
107

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

113
    @Override
114
    protected Mode getMode() {
UNCOV
115
        return DEPLOY;
×
116
    }
117

118
    @Override
119
    protected JReleaserCommand getCommand() {
UNCOV
120
        return JReleaserCommand.DEPLOY;
×
121
    }
122
}
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