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

jreleaser / jreleaser / #477

04 Apr 2025 05:53PM UTC coverage: 35.124% (-5.1%) from 40.183%
#477

push

github

aalmiray
fix(deploy): Add missing Forgejo messages

Related to #1842

18210 of 51845 relevant lines covered (35.12%)

0.35 hits per line

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

64.29
/plugins/jreleaser-maven-plugin/src/main/java/org/jreleaser/maven/plugin/JReleaserConfigMojo.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.maven.plugin;
19

20
import org.apache.maven.plugin.MojoExecutionException;
21
import org.apache.maven.plugin.MojoFailureException;
22
import org.apache.maven.plugins.annotations.Mojo;
23
import org.apache.maven.plugins.annotations.Parameter;
24
import org.jreleaser.engine.context.ModelValidator;
25
import org.jreleaser.maven.plugin.internal.MavenJReleaserModelPrinter;
26
import org.jreleaser.model.api.JReleaserCommand;
27
import org.jreleaser.model.api.JReleaserContext.Mode;
28
import org.jreleaser.model.internal.JReleaserContext;
29

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

32
/**
33
 * Display current configuration.
34
 *
35
 * @author Andres Almiray
36
 * @since 0.1.0
37
 */
38
@Mojo(threadSafe = true, name = "config")
39
public class JReleaserConfigMojo extends AbstractPlatformAwareMojo {
1✔
40
    /**
41
     * Skip execution.
42
     */
43
    @Parameter(property = "jreleaser.config.skip")
44
    private boolean skip;
45
    /**
46
     * Display full configuration.
47
     */
48
    @Parameter(property = "jreleaser.config.full")
49
    private boolean full;
50
    /**
51
     * Display announce configuration.
52
     */
53
    @Parameter(property = "jreleaser.config.announce")
54
    private boolean announce;
55
    /**
56
     * Display assembly configuration.
57
     */
58
    @Parameter(property = "jreleaser.config.assembly")
59
    private boolean assembly;
60
    /**
61
     * Display changelog configuration.
62
     */
63
    @Parameter(property = "jreleaser.config.changelog")
64
    private boolean changelog;
65
    /**
66
     * Display download configuration.
67
     */
68
    @Parameter(property = "jreleaser.config.download")
69
    private boolean download;
70

71
    @Override
72
    protected void doExecute() throws MojoExecutionException, MojoFailureException {
73
        JReleaserContext context = createContext();
1✔
74
        ModelValidator.validate(context);
×
75
        new MavenJReleaserModelPrinter(newPrintWriter(System.out))
×
76
            .print(context.getModel().asMap(full));
×
77
        context.report();
×
78
    }
×
79

80
    @Override
81
    protected Mode getMode() {
82
        if (download) return Mode.DOWNLOAD;
1✔
83
        if (assembly) return Mode.ASSEMBLE;
1✔
84
        if (changelog) return Mode.CHANGELOG;
1✔
85
        if (announce) return Mode.ANNOUNCE;
1✔
86
        return Mode.CONFIG;
1✔
87
    }
88

89
    @Override
90
    protected boolean isSkip() {
91
        return skip;
1✔
92
    }
93

94
    @Override
95
    protected JReleaserCommand getCommand() {
96
        return JReleaserCommand.CONFIG;
1✔
97
    }
98
}
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