• 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.55
/plugins/jreleaser/src/main/java/org/jreleaser/cli/Config.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.cli.internal.CliJReleaserModelPrinter;
21
import org.jreleaser.engine.context.ModelValidator;
22
import org.jreleaser.model.api.JReleaserCommand;
23
import org.jreleaser.model.api.JReleaserContext.Mode;
24
import org.jreleaser.model.internal.JReleaserContext;
25
import picocli.CommandLine;
26

27
import java.util.Set;
28

29
/**
30
 * @author Andres Almiray
31
 * @since 0.1.0
32
 */
33
@CommandLine.Command(name = "config")
34
public class Config extends AbstractPlatformAwareModelCommand<Main> {
1✔
35
    @CommandLine.Option(names = {"-f", "--full"})
36
    boolean full;
37

38
    @CommandLine.ArgGroup
39
    Exclusive exclusive;
40

41
    static class Exclusive {
×
42
        @CommandLine.Option(names = {"--announce"}, required = true)
43
        boolean announce;
44

45
        @CommandLine.Option(names = {"-a", "--assembly"}, required = true)
46
        boolean assembly;
47

48
        @CommandLine.Option(names = {"--changelog"}, required = true)
49
        boolean changelog;
50

51
        @CommandLine.Option(names = {"-d", "--download"}, required = true)
52
        boolean download;
53

54
        @CommandLine.Option(names = {"--deploy"}, required = true)
55
        boolean deploy;
56
    }
57

58
    @Override
59
    protected void collectCandidateDeprecatedArgs(Set<AbstractCommand.DeprecatedArg> args) {
UNCOV
60
        super.collectCandidateDeprecatedArgs(args);
×
UNCOV
61
        args.add(new DeprecatedArg("-a", "--assembly", "1.5.0"));
×
UNCOV
62
        args.add(new DeprecatedArg("-d", "--download", "1.5.0"));
×
UNCOV
63
    }
×
64

65
    @Override
66
    protected void doExecute(JReleaserContext context) {
UNCOV
67
        ModelValidator.validate(context);
×
UNCOV
68
        new CliJReleaserModelPrinter(parent().getOut()).print(context.getModel().asMap(full));
×
UNCOV
69
        context.report();
×
UNCOV
70
    }
×
71

72
    @Override
73
    protected Mode getMode() {
UNCOV
74
        if (deploy()) return Mode.DEPLOY;
×
UNCOV
75
        if (download()) return Mode.DOWNLOAD;
×
UNCOV
76
        if (assembly()) return Mode.ASSEMBLE;
×
UNCOV
77
        if (changelog()) return Mode.CHANGELOG;
×
UNCOV
78
        if (announce()) return Mode.ANNOUNCE;
×
UNCOV
79
        return Mode.CONFIG;
×
80
    }
81

82
    private boolean deploy() {
UNCOV
83
        return null != exclusive && exclusive.deploy;
×
84
    }
85

86
    private boolean download() {
UNCOV
87
        return null != exclusive && exclusive.download;
×
88
    }
89

90
    private boolean assembly() {
UNCOV
91
        return null != exclusive && exclusive.assembly;
×
92
    }
93

94
    private boolean changelog() {
UNCOV
95
        return null != exclusive && exclusive.changelog;
×
96
    }
97

98
    private boolean announce() {
UNCOV
99
        return null != exclusive && exclusive.announce;
×
100
    }
101

102
    @Override
103
    protected JReleaserCommand getCommand() {
UNCOV
104
        return JReleaserCommand.CONFIG;
×
105
    }
106
}
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