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

jreleaser / jreleaser / #558

08 Dec 2025 02:56PM UTC coverage: 48.239% (+0.02%) from 48.215%
#558

push

github

aalmiray
feat(core): warn when a name template cannot be resolved

Closes #1960

Closes #1961

299 of 573 new or added lines in 133 files covered. (52.18%)

4 existing lines in 4 files now uncovered.

26047 of 53996 relevant lines covered (48.24%)

0.48 hits per line

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

50.82
/core/jreleaser-model-impl/src/main/java/org/jreleaser/model/internal/upload/FtpUploader.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.model.internal.upload;
19

20
import com.fasterxml.jackson.annotation.JsonIgnore;
21
import org.jreleaser.model.Active;
22
import org.jreleaser.model.internal.JReleaserContext;
23
import org.jreleaser.model.internal.common.Artifact;
24
import org.jreleaser.model.internal.common.Ftp;
25
import org.jreleaser.model.internal.common.FtpDelegate;
26
import org.jreleaser.mustache.TemplateContext;
27

28
import java.util.Map;
29

30
import static java.util.Collections.unmodifiableMap;
31
import static org.jreleaser.model.api.download.FtpDownloader.TYPE;
32
import static org.jreleaser.mustache.Templates.resolveTemplate;
33

34
/**
35
 * @author Andres Almiray
36
 * @since 1.1.0
37
 */
38
public final class FtpUploader extends AbstractUploader<org.jreleaser.model.api.upload.FtpUploader, FtpUploader> implements Ftp {
39
    private static final long serialVersionUID = -7427075974576853678L;
40

41
    private final FtpDelegate delegate = new FtpDelegate();
1✔
42
    private String path;
43
    private String downloadUrl;
44

45
    @JsonIgnore
1✔
46
    private final org.jreleaser.model.api.upload.FtpUploader immutable = new org.jreleaser.model.api.upload.FtpUploader() {
1✔
47
        private static final long serialVersionUID = -1377876046305087409L;
48

49
        @Override
50
        public String getPath() {
51
            return path;
×
52
        }
53

54
        @Override
55
        public String getDownloadUrl() {
56
            return downloadUrl;
×
57
        }
58

59
        @Override
60
        public String getUsername() {
61
            return FtpUploader.this.getUsername();
×
62
        }
63

64
        @Override
65
        public String getPassword() {
66
            return FtpUploader.this.getPassword();
×
67
        }
68

69
        @Override
70
        public String getHost() {
71
            return FtpUploader.this.getHost();
×
72
        }
73

74
        @Override
75
        public Integer getPort() {
76
            return FtpUploader.this.getPort();
×
77
        }
78

79
        @Override
80
        public String getType() {
81
            return FtpUploader.this.getType();
×
82
        }
83

84
        @Override
85
        public String getName() {
86
            return FtpUploader.this.getName();
×
87
        }
88

89
        @Override
90
        public boolean isSnapshotSupported() {
91
            return FtpUploader.this.isSnapshotSupported();
×
92
        }
93

94
        @Override
95
        public boolean isArtifacts() {
96
            return FtpUploader.this.isArtifacts();
×
97
        }
98

99
        @Override
100
        public boolean isFiles() {
101
            return FtpUploader.this.isFiles();
×
102
        }
103

104
        @Override
105
        public boolean isSignatures() {
106
            return FtpUploader.this.isSignatures();
×
107
        }
108

109
        @Override
110
        public boolean isChecksums() {
111
            return FtpUploader.this.isChecksums();
×
112
        }
113

114
        @Override
115
        public boolean isCatalogs() {
116
            return FtpUploader.this.isCatalogs();
×
117
        }
118

119
        @Override
120
        public Active getActive() {
121
            return FtpUploader.this.getActive();
×
122
        }
123

124
        @Override
125
        public boolean isEnabled() {
126
            return FtpUploader.this.isEnabled();
×
127
        }
128

129
        @Override
130
        public Map<String, Object> asMap(boolean full) {
131
            return unmodifiableMap(FtpUploader.this.asMap(full));
×
132
        }
133

134
        @Override
135
        public String getPrefix() {
136
            return FtpUploader.this.prefix();
×
137
        }
138

139
        @Override
140
        public Map<String, Object> getExtraProperties() {
141
            return unmodifiableMap(FtpUploader.this.getExtraProperties());
×
142
        }
143

144
        @Override
145
        public Integer getConnectTimeout() {
146
            return FtpUploader.this.getConnectTimeout();
×
147
        }
148

149
        @Override
150
        public Integer getReadTimeout() {
151
            return FtpUploader.this.getReadTimeout();
×
152
        }
153
    };
154

155
    public FtpUploader() {
156
        super(TYPE);
1✔
157
    }
1✔
158

159
    @Override
160
    public org.jreleaser.model.api.upload.FtpUploader asImmutable() {
161
        return immutable;
1✔
162
    }
163

164
    @Override
165
    public void merge(FtpUploader source) {
166
        super.merge(source);
×
167
        this.delegate.merge(source.delegate);
×
168
        this.path = merge(this.path, source.path);
×
169
        this.downloadUrl = merge(this.downloadUrl, source.downloadUrl);
×
170
    }
×
171

172
    @Override
173
    public String getUsername() {
174
        return delegate.getUsername();
1✔
175
    }
176

177
    @Override
178
    public void setUsername(String username) {
179
        delegate.setUsername(username);
1✔
180
    }
1✔
181

182
    @Override
183
    public String getPassword() {
184
        return delegate.getPassword();
1✔
185
    }
186

187
    @Override
188
    public void setPassword(String password) {
189
        delegate.setPassword(password);
1✔
190
    }
1✔
191

192
    @Override
193
    public String getHost() {
194
        return delegate.getHost();
1✔
195
    }
196

197
    @Override
198
    public void setHost(String host) {
199
        delegate.setHost(host);
1✔
200
    }
1✔
201

202
    @Override
203
    public Integer getPort() {
204
        return delegate.getPort();
1✔
205
    }
206

207
    @Override
208
    public void setPort(Integer port) {
209
        delegate.setPort(port);
1✔
210
    }
1✔
211

212
    public String getPath() {
213
        return path;
1✔
214
    }
215

216
    public void setPath(String path) {
217
        this.path = path;
1✔
218
    }
1✔
219

220
    public String getDownloadUrl() {
221
        return downloadUrl;
×
222
    }
223

224
    public void setDownloadUrl(String downloadUrl) {
225
        this.downloadUrl = downloadUrl;
1✔
226
    }
1✔
227

228
    @Override
229
    protected void asMap(boolean full, Map<String, Object> props) {
230
        delegate.asMap(props);
1✔
231
        props.put("path", path);
1✔
232
        props.put("downloadUrl", downloadUrl);
1✔
233
    }
1✔
234

235
    public String getResolvedPath(JReleaserContext context, Artifact artifact) {
236
        TemplateContext p = artifactProps(context.fullProps(), artifact);
×
237
        p.setAll(resolvedExtraProperties());
×
NEW
238
        return resolveTemplate(context.getLogger(), path, p);
×
239
    }
240

241
    @Override
242
    public String getResolvedDownloadUrl(JReleaserContext context, Artifact artifact) {
243
        return getResolvedDownloadUrl(context, context.fullProps(), artifact);
1✔
244
    }
245

246
    @Override
247
    public String getResolvedDownloadUrl(JReleaserContext context, TemplateContext props, Artifact artifact) {
248
        TemplateContext p = new TemplateContext(artifactProps(props, artifact));
1✔
249
        p.setAll(resolvedExtraProperties());
1✔
250
        return resolveTemplate(context.getLogger(), downloadUrl, p);
1✔
251
    }
252
}
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