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

jreleaser / jreleaser / #512

27 Jul 2025 05:51PM UTC coverage: 45.153% (-0.7%) from 45.803%
#512

push

github

aalmiray
feat(core): Add a --deploy flag to config

Closes #1946

3 of 11 new or added lines in 4 files covered. (27.27%)

845 existing lines in 34 files now uncovered.

23625 of 52322 relevant lines covered (45.15%)

0.45 hits per line

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

88.89
/plugins/jreleaser/src/main/java/org/jreleaser/cli/Env.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.ColorizedJReleaserLoggerAdapter;
21
import org.jreleaser.engine.environment.Environment;
22
import org.jreleaser.logging.JReleaserLogger;
23
import picocli.CommandLine;
24

25
import java.io.ByteArrayOutputStream;
26
import java.io.PrintWriter;
27
import java.nio.file.Path;
28
import java.nio.file.Paths;
29

30
import static org.jreleaser.util.IoUtils.newPrintWriter;
31

32
/**
33
 * @author Andres Almiray
34
 * @since 1.5.0
35
 */
36
@CommandLine.Command(name = "env")
37
public class Env extends AbstractCommand<Main> {
1✔
38
    @CommandLine.Option(names = {"--settings-file"}, paramLabel = "<file>")
39
    Path settingsFile;
40

41
    @Override
42
    protected void execute() {
43
        Environment.display(initLogger(), resolveBasedir(), resolveSettings());
1✔
44
    }
1✔
45

46
    private Path resolveSettings() {
47
        if (null != settingsFile) {
1✔
UNCOV
48
            return resolveBasedir().resolve(settingsFile).normalize();
×
49
        }
50

51
        return null;
1✔
52
    }
53

54
    private Path resolveBasedir() {
55
        return Paths.get(".").normalize();
1✔
56
    }
57

58
    protected JReleaserLogger initLogger() {
59
        return new ColorizedJReleaserLoggerAdapter(createTracer(), parent().getOut(), ColorizedJReleaserLoggerAdapter.Level.INFO);
1✔
60
    }
61

62
    protected PrintWriter createTracer() {
63
        return newPrintWriter(new ByteArrayOutputStream());
1✔
64
    }
65
}
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