Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Ground Controller Lvl 2
Message 1 of 5

Unable to download dependency from GitHub Package Registry

Solved! Go to Solution.

I have successfully deployed my package to the GitHub Package Registry:

com.akdeniz.googleplaycrawler 1.1 

 

However, when I add the following dependency into my POM.xml file, Maven is unable to download it:

<dependency>
	<groupId>com.akdenizcom.github.adarkdividedgem</groupId>
	<artifactId>.googleplaycrawler</artifactId>
	<version>1.1</version>
</dependency>

 

A simple "mvn install" fails with the following warning:

Downloading: https://maven.pkg.github.com/ADarkDividedGem/com/github/adarkdividedgem/com.akdeniz.googleplaycrawler/1.1/com.akdeniz.googleplaycrawler-1.1.pom
[WARNING] The POM for com.github.adarkdividedgem:com.akdeniz.googleplaycrawler:jar:1.1 is missing, no dependency information available

Checking my .m2 repository folder confirms that neither the POM or JAR file was downloaded.

 

Any idea what I am doing wrong because I am using the same Maven settings.xml file that I used to upload the package which includes all the server and repositry information described in the documentation.

4 Replies
Solution
Ground Controller Lvl 2
Message 2 of 5

Re: Unable to download dependency from GitHub Package Registry

I managed to get it working by changing the dependancy to this:

 

<dependency>
	<groupId>com.akdeniz</groupId>
	<artifactId>googleplaycrawler</artifactId>
	<version>1.1</version>
</dependency>

This is different from the GroupID and ArtifactID given by the GitHub Package Registry web page.

 

Then include the repository name in the repository tag:

<profile>
      <id>github</id>
      <repositories>
        <repository>
          <id>central</id>
          <url>https://repo1.maven.org/maven2</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
        <repository>
          <id>github</id>
          <name>GitHub OWNER Apache Maven Packages</name>
          <url>https://maven.pkg.github.com/adarkdividedgem/Google-Play-API</url>
		  <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
    </profile>

In the documentation only the OWNER section was mentioned.

 

 

 

Ground Controller Lvl 1
Message 3 of 5

Re: Unable to download dependency from GitHub Package Registry

I'm also trying to add my deployed maven artfact as dependy. I also set up the GitHub CI which deployed it to the  Package Registry here:

https://github.com/TobseF/HelloMaven/packages/39042

But how to add it as dependy?

 

pom.xml

<repositories>
<repository>
<id>github</id>
<name>GitHub TobseF Apache Maven Packages</name>
<url>https://maven.pkg.github.com/TobseF/HelloMaven</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<dependency>
<groupId>github.tobsef</groupId>
<artifactId>hello-maven</artifactId>
<version>1.2.1</version>
</dependency>

 

Which did I missed? Do I also need to setup a settings.xml with credentials?

I also tried it in the project and globally in this way:

 

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

    <profiles>
        <profile>
            <id>github</id>
            <repositories>
                <repository>
                    <id>github</id>
                    <name>GitHub TobseF Apache Maven Packages</name>
                    <url>https://maven.pkg.github.com/TobseF</url>
                </repository>
            </repositories>
        </profile>
    </profiles>

    <servers>
        <server>
            <id>github</id>
            <username>TobseF</username>
            <password>123-my-auth-toke-123</password>
        </server>
    </servers>

But I had no succces. Did you set up the authetification an how?

Can you add my sample lib as dependency?

 

Best wishes,

Tobse

 

Ground Controller Lvl 1
Message 4 of 5

Re: Unable to download dependency from GitHub Package Registry

OK, I aso got it working, by removing the .m2/settings.xml in the project and suing the global username/.m2/settings.xml.

There I changed repository url from 

 

https://maven.pkg.github.com/TobseF/

to

 

https://maven.pkg.github.com/TobseF/HelloMaven

so I have:

  <profiles>
    <profile>
      <id>github</id>
      <repositories>
			<repository>
				<id>github</id>
				<name>GitHub OWNER Apache Maven Packages</name>
				<url>https://maven.pkg.github.com/TobseF/HelloMaven</url>
				<releases><enabled>true</enabled></releases>
				<snapshots><enabled>true</enabled></snapshots>
			</repository>
      </repositories>
    </profile>
  </profiles>

  <servers>
    <server>
      <id>github</id>
      <username>TobseF</username>
      <password>123-my-toke-123</password>
    </server>
  </servers>

So to add a dependency, do I really need to mention every GitHub Registry depency in my global settings.xml ?

At the end of the day I have to list there hundreds.

Or is it enough to set up my token for the id named github and hope everybody is using this name in their pom.xml -good luck?

Mission Specialist Lvl 1
Message 5 of 5

Re: Unable to download dependency from GitHub Package Registry

Still not working