Github Actions: repository element was not specified in the POM inside distributionManagement


Error

Error: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project email-picker: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
Error:
Error: To see the full stack trace of the errors, re-run Maven with the -e switch.
Error: Re-run Maven using the -X switch to enable full debug logging.
Error:
Error: For more information about the errors and possible solutions, please read the following articles:
Error: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Error: Process completed with exit code 1.

Solution

# Step 1 - make sure you have following entry in pom.xml

<distributionManagement>
  <repository>
    <id>github</id>       
    <name>Releases</name>           
    <url>https://maven.pkg.github.com/org1/repo1</url> 
  </repository>
</distributionManagement>