#StackBounty: #registry #pom.xml #github-actions #parent-pom Github Actions: build can't transfer own Github hosted parent pom, rec…

Bounty: 100

I’m at the moment building a project.
This project should use my parent.pom from the Github registry.

It works perfectly on my machine, even if I delete the parent-pom from my .m2 repository
Unfortunately, I always get an error when Github tries to run the tests after each push, because the parent-pom can’t be resolved.

[ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for io.joergi:basics:0.0.1-SNAPSHOT: Could not 
transfer artifact io.joergi:parent-jdk11-mongo:pom:2.3.0-1.RELEASE from/to github 
(https://maven.pkg.github.com/joergi/parent-jdk11-mongo): Transfer failed for 
https://maven.pkg.github.com/joergi/parent-jdk11-mongo/io/joergi/parent-jdk11-
mongo/2.3.0-1.RELEASE/parent-jdk11-mongo-2.3.0-1.RELEASE.pom 400 Bad Request and 
'parent.relativePath' points at wrong local POM @ line 5, column 10
     @ 

The parent-pom has this definition:

<groupId>io.joergi</groupId>
<artifactId>parent-jdk11-mongo</artifactId>
<version>2.3.0-1.RELEASE</version>
<packaging>pom</packaging>
<name>joergi.io parent-jdk11-mongo</name>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.3.3.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>

My new project use Github actions for automatic testing.
It integrates the parent pom like this:

<parent>
    <groupId>io.joergi</groupId>
    <artifactId>parent-jdk11-mongo</artifactId>
    <version>2.3.0-1.RELEASE</version>
</parent>

<distributionManagement>
    <repository>
        <id>github</id>
        <name>GitHub joergi Apache Maven Packages</name>
        <url>https://maven.pkg.github.com/joergi/parent-jdk11-mongo</url>
    </repository>
</distributionManagement>

I also have a settings.xml in the new project

  <activeProfiles>
    <activeProfile>github</activeProfile>
  </activeProfiles>

  <profiles>
    <profile>
      <id>github</id>
      <repositories>
        <repository>
          <id>github</id>
          <name>GitHub joergi Apache Maven Packages</name>
          <url>https://maven.pkg.github.com/joergi/parent-jdk11-mongo</url>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <servers>
    <server>
      <id>github</id>
      <username>joergi</username>
      <password>${{ secrets.PACKAGES_READ_ONLY }}</password>
    </server>
  </servers>

The secret is in my Github secrets. If I remove or change it, I’m not authorized anymore, so this works.

Can one of you give me a hint, what is wrong


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.