• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jreleaser / jreleaser / #510

27 Jul 2025 12:31PM UTC coverage: 45.783% (-3.6%) from 49.39%
#510

push

github

aalmiray
feat(packagers): Stage distribution publication in a fixed directory

Closes #1943

12 of 25 new or added lines in 4 files covered. (48.0%)

2208 existing lines in 190 files now uncovered.

23924 of 52255 relevant lines covered (45.78%)

0.46 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.55
/sdks/jreleaser-sdkman-java-sdk/src/main/java/org/jreleaser/sdk/sdkman/AbstractSdkmanCommand.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.sdk.sdkman;
19

20
import org.jreleaser.model.api.JReleaserContext;
21

22
import static java.util.Objects.requireNonNull;
23
import static org.jreleaser.util.StringUtils.requireNonBlank;
24

25
/**
26
 * @author Andres Almiray
27
 * @since 0.1.0
28
 */
29
abstract class AbstractSdkmanCommand implements SdkmanCommand {
30
    protected final boolean dryrun;
31
    protected final String candidate;
32
    protected final String version;
33
    protected final Sdkman sdkman;
34

35
    protected AbstractSdkmanCommand(JReleaserContext context,
36
                                    String apiHost,
37
                                    int connectTimeout,
38
                                    int readTimeout,
39
                                    String consumerKey,
40
                                    String consumerToken,
41
                                    String candidate,
42
                                    String version,
43
                                    boolean dryrun) {
1✔
44
        this.sdkman = new Sdkman(context, apiHost, connectTimeout, readTimeout, consumerKey, consumerToken, dryrun);
1✔
45
        this.candidate = candidate;
1✔
46
        this.version = version;
1✔
47
        this.dryrun = dryrun;
1✔
48
    }
1✔
49

50
    static class Builder<S extends Builder<S>> {
51
        protected final JReleaserContext context;
52
        protected boolean dryrun;
53
        protected boolean skipAnnounce;
54
        protected String consumerKey;
55
        protected String consumerToken;
56
        protected String candidate;
57
        protected String version;
58
        protected String apiHost = "https://vendors.sdkman.io";
1✔
59
        protected int connectTimeout = 20;
1✔
60
        protected int readTimeout = 60;
1✔
61

62
        protected Builder(JReleaserContext context) {
1✔
63
            this.context = requireNonNull(context, "'context' must not be null");
1✔
64
        }
1✔
65

66
        @SuppressWarnings("unchecked")
67
        protected final S self() {
68
            return (S) this;
1✔
69
        }
70

71
        public S dryrun(boolean dryrun) {
72
            this.dryrun = dryrun;
1✔
73
            return self();
1✔
74
        }
75

76
        public S skipAnnounce(boolean skipAnnounce) {
UNCOV
77
            this.skipAnnounce = skipAnnounce;
×
UNCOV
78
            return self();
×
79
        }
80

81
        /**
82
         * The SDK consumer key
83
         */
84
        public S consumerKey(String consumerKey) {
85
            this.consumerKey = requireNonBlank(consumerKey, "'consumerKey' must not be blank").trim();
1✔
86
            return self();
1✔
87
        }
88

89
        /**
90
         * The SDK consumer token
91
         */
92
        public S consumerToken(String consumerToken) {
93
            this.consumerToken = requireNonBlank(consumerToken, "'consumerToken' must not be blank").trim();
1✔
94
            return self();
1✔
95
        }
96

97
        /**
98
         * candidate identifier
99
         */
100
        public S candidate(String candidate) {
101
            this.candidate = requireNonBlank(candidate, "'candidate' must not be blank").trim();
1✔
102
            return self();
1✔
103
        }
104

105
        /**
106
         * candidate version
107
         */
108
        public S version(String version) {
109
            this.version = requireNonBlank(version, "'version' must not be blank").trim();
1✔
110
            return self();
1✔
111
        }
112

113
        /**
114
         * SDK service hostname
115
         */
116
        public S apiHost(String apiHost) {
117
            this.apiHost = requireNonBlank(apiHost, "'apiHost' must not be blank").trim();
1✔
118
            return self();
1✔
119
        }
120

121
        public S connectTimeout(int connectTimeout) {
122
            this.connectTimeout = connectTimeout;
1✔
123
            return self();
1✔
124
        }
125

126
        public S readTimeout(int readTimeout) {
127
            this.readTimeout = readTimeout;
1✔
128
            return self();
1✔
129
        }
130
    }
131
}
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