• 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

0.0
/core/jreleaser-engine/src/main/java/org/jreleaser/engine/deploy/maven/ProjectMavenDeployer.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.engine.deploy.maven;
19

20
import org.jreleaser.bundle.RB;
21
import org.jreleaser.model.internal.JReleaserContext;
22
import org.jreleaser.model.spi.deploy.DeployException;
23
import org.jreleaser.model.spi.deploy.maven.MavenDeployer;
24

25
import static java.util.Objects.requireNonNull;
26

27
/**
28
 * @author Andres Almiray
29
 * @since 1.3.0
30
 */
31
public class ProjectMavenDeployer {
32
    private final JReleaserContext context;
33
    private final org.jreleaser.model.internal.deploy.maven.MavenDeployer<?> deployer;
34

35
    private ProjectMavenDeployer(JReleaserContext context,
36
                                 org.jreleaser.model.internal.deploy.maven.MavenDeployer<?> deployer) {
×
37
        this.context = context;
×
38
        this.deployer = deployer;
×
39
    }
×
40

41
    public org.jreleaser.model.internal.deploy.maven.MavenDeployer<?> getMavenDeployer() {
42
        return deployer;
×
43
    }
44

45
    public boolean deploy() throws DeployException {
46
        if (!deployer.isEnabled()) {
×
47
            context.getLogger().debug(RB.$("deployers.skip.deploy"), deployer.getName());
×
48
            return false;
×
49
        }
50

51
        MavenDeployer<?, ?> artifactMavenDeployer = ArtifactDeployers.findMavenDeployer(context, deployer);
×
52

53
        context.getLogger().info(RB.$("deployers.deploy.to"), deployer.getName());
×
54

55
        artifactMavenDeployer.deploy(deployer.getName());
×
56
        return true;
×
57
    }
58

59
    public static ProjectMavenDeployerBuilder builder() {
60
        return new ProjectMavenDeployerBuilder();
×
61
    }
62

63
    public static class ProjectMavenDeployerBuilder {
×
64
        private JReleaserContext context;
65
        private org.jreleaser.model.internal.deploy.maven.MavenDeployer<?> deployer;
66

67
        public ProjectMavenDeployerBuilder context(JReleaserContext context) {
68
            this.context = requireNonNull(context, "'context' must not be null");
×
69
            return this;
×
70
        }
71

72
        public ProjectMavenDeployerBuilder deployer(org.jreleaser.model.internal.deploy.maven.MavenDeployer<?> deployer) {
73
            this.deployer = requireNonNull(deployer, "'deployer' must not be null");
×
74
            return this;
×
75
        }
76

77
        public ProjectMavenDeployer build() {
78
            requireNonNull(context, "'context' must not be null");
×
79
            requireNonNull(deployer, "'deployer' must not be null");
×
80
            return new ProjectMavenDeployer(context, deployer);
×
81
        }
82
    }
83
}
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