I deployed a Maven package to github according to these instructions. https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#installing-a-package
This worked.
Now I am installing a second Maven project that depends on the package that I just deployed to the github registry. I keep getting this error.
Error:
The POM for com.xxxxxxx:0.8.6 is missing, no dependency information available github packages
Failure to find com.xxxxxxx.xxxxxxx:jar:7.7 in https://repo.maven.apache.org/maven2
The install should not be searching for the dependency in repo.maven.apache.org. It should be searching in the github repository - where this dependency lives.
According to github's documentation [https://help.github.com/en/github/managing-packages-with-github-packages/using-github-packages-with-github-actions#installing-a-package-using-an-action] there is a way to install packages hosted by GitHub Packages through GitHub Actions that "requires minimal configuration or additional authentication, by using the GITHUB_TOKEN." However, that document does not explain how to achieve this. How do I need to update a github yaml workflow file to use a github package in an action?
Here is my .m2/settings.xml file...
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository />
<interactiveMode />
<usePluginRegistry />
<offline />
<pluginGroups />
<servers>
<server>
<id>github</id>
<username>myGithubUsername</username>
<password>GithubPersonalAccessToken</password>
</server>
</servers>
<mirrors />
<proxies />
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>github</id>
<name>GitHub myGithubUsername Apache Maven Packages</name>
<url>https://maven.pkg.github.com/myGithubUsername /nameOfGithubRepositoryContainingTheMavenPackageIAmIncluding</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles />
</settings>
And here is where I reference the package in the pom.xml file of the 2nd project I am attempting to install.
<dependency>
<groupId>com.the organization name</groupId>
<artifactId>the package name</artifactId>
<version>0.8.6</version>
</dependency>
Finally, here is my yaml file for the github action.
name: BuildOnWikiEdit
on:
gollum:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run a one-line script
run: echo Hello, world!
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.
- name: Build
run: mvn install