Class KbRemotePublishMojo

java.lang.Object
network.ike.plugin.KbRemotePublishMojo
All Implemented Interfaces:
org.apache.maven.api.plugin.Mojo

@Mojo(name="kb-remote-publish", projectRequired=false) public class KbRemotePublishMojo extends Object implements org.apache.maven.api.plugin.Mojo
Gives a project its remote, the executing half of the ike:kb-remote-* pair (IKE-Network/ike-issues#1370, decision 4): sets origin, replaces the file: URLs in the <scm> of pom.xml and commits that file alone, replaces the repo: of the project in its working set's workspace.yaml when it is a member of one, and pushes the branch, which then tracks origin.

Run ike:kb-remote-draft first. A push that would fail, because the remote does not answer or already has other commits on the branch, is refused before anything is changed. When the push itself fails, the remote is set and the POM committed; run the goal again to push. The remote is the project's own, not the knowledge base's.

Since:
281
  • Constructor Details

    • KbRemotePublishMojo

      public KbRemotePublishMojo()
      Creates this goal instance.
  • Method Details

    • execute

      public void execute()
      Sets the remote, commits and pushes.
      Specified by:
      execute in interface org.apache.maven.api.plugin.Mojo
      Throws:
      org.apache.maven.api.plugin.MojoException - if the project cannot be read, the plan breaks a rule, the push would fail, or git fails