Compiling Github API and OAuth

290 views
Skip to first unread message

L Waver

unread,
Jul 16, 2014, 5:26:41 PM7/16/14
to repo-d...@googlegroups.com
Since the downing of the the Google authentication I have been researching ways to compile the GitHub Authentication for Gerrit.  In following Luca's guide (http://www.packtpub.com/article/using-gerrit-with-github), I have come across the following errors:

+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   Gerrit Code Review - GitHub integration
[INFO]   Gerrit Code Review - GitHub OAuth login
[INFO]   Gerrit Code Review - GitHub plugin
[INFO] ------------------------------------------------------------------------
[INFO] Building Gerrit Code Review - GitHub integration
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [install:install {execution: default-install}]
[INFO] Installing /home/gerrit2/github/pom.xml to /root/.m2/repository/com/googlesource/gerrit/plugins/github/github-parent/2.10-SNAPSHOT/github-parent-2.10-SNAPSHO$
[INFO] ------------------------------------------------------------------------
[INFO] Building Gerrit Code Review - GitHub OAuth login
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/gerrit2/github/github-oauth/src/main/resources
[INFO] Unable to find resource 'com.google.gerrit:gerrit-plugin-api:pom:2.10-SNAPSHOT' in repository gerritforge (http://gerritforge.com/snapshot/)
[INFO] Unable to find resource 'org.kohsuke:github-api:pom:1.57-SNAPSHOT' in repository gerritforge (http://gerritforge.com/snapshot/)
[INFO] Unable to find resource 'org.kohsuke:github-api:jar:1.57-SNAPSHOT' in repository gerritforge (http://gerritforge.com/snapshot/)
[INFO] Unable to find resource 'com.google.gerrit:gerrit-plugin-api:jar:2.10-SNAPSHOT' in repository gerritforge (http://gerritforge.com/snapshot/)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) org.kohsuke:github-api:jar:1.57-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.kohsuke -DartifactId=github-api -Dversion=1.57-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.kohsuke -DartifactId=github-api -Dversion=1.57-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[$

  Path to dependency:
        1) com.googlesource.gerrit.plugins.github:github-oauth:jar:2.10-SNAPSHOT
        2) org.kohsuke:github-api:jar:1.57-SNAPSHOT

2) com.google.gerrit:gerrit-plugin-api:jar:2.10-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=com.google.gerrit -DartifactId=gerrit-plugin-api -Dversion=2.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=com.google.gerrit -DartifactId=gerrit-plugin-api -Dversion=2.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -Dr$

  Path to dependency:
        1) com.googlesource.gerrit.plugins.github:github-oauth:jar:2.10-SNAPSHOT
        2) com.google.gerrit:gerrit-plugin-api:jar:2.10-SNAPSHOT

----------
2 required artifacts are missing.

for artifact:
  com.googlesource.gerrit.plugins.github:github-oauth:jar:2.10-SNAPSHOT

from the specified remote repositories:



[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Missing:
----------
  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.kohsuke -DartifactId=github-api -Dversion=1.57-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[$

  Path to dependency:
        1) com.googlesource.gerrit.plugins.github:github-oauth:jar:2.10-SNAPSHOT
        2) org.kohsuke:github-api:jar:1.57-SNAPSHOT

2) com.google.gerrit:gerrit-plugin-api:jar:2.10-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=com.google.gerrit -DartifactId=gerrit-plugin-api -Dversion=2.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=com.google.gerrit -DartifactId=gerrit-plugin-api -Dversion=2.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -Dr$

  Path to dependency:
        1) com.googlesource.gerrit.plugins.github:github-oauth:jar:2.10-SNAPSHOT
        2) com.google.gerrit:gerrit-plugin-api:jar:2.10-SNAPSHOT

----------
2 required artifacts are missing.

for artifact:
  com.googlesource.gerrit.plugins.github:github-oauth:jar:2.10-SNAPSHOT

from the specified remote repositories:
     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:
----------
1) org.kohsuke:github-api:jar:1.57-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.kohsuke -DartifactId=github-api -Dversion=1.57-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.kohsuke -DartifactId=github-api -Dversion=1.57-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[$

  Path to dependency:
        1) com.googlesource.gerrit.plugins.github:github-oauth:jar:2.10-SNAPSHOT
        2) org.kohsuke:github-api:jar:1.57-SNAPSHOT

2) com.google.gerrit:gerrit-plugin-api:jar:2.10-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=com.google.gerrit -DartifactId=gerrit-plugin-api -Dversion=2.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=com.google.gerrit -DartifactId=gerrit-plugin-api -Dversion=2.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -Dr$

  Path to dependency:
        1) com.googlesource.gerrit.plugins.github:github-oauth:jar:2.10-SNAPSHOT
        2) com.google.gerrit:gerrit-plugin-api:jar:2.10-SNAPSHOT

----------
2 required artifacts are missing.
for artifact:
  com.googlesource.gerrit.plugins.github:github-oauth:jar:2.10-SNAPSHOT

from the specified remote repositories:


        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:360)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:304)
        at org.apache.maven.plugin.DefaultPluginManager.resolveTransitiveDependencies(DefaultPluginManager.java:1499)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:442)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        ... 17 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Wed Jul 16 23:19:01 CEST 2014
[INFO] Final Memory: 22M/956M
[INFO] ------------------------------------------------------------------------

-----------------------------------------------

The cut and pasting might be a bit off but this is what I am receiving for errors.  It appears it's not pulling the correct files to be able to carry on with the compile.  Is there a way that I could just download these two JAR files and add them to the correct directories so I can carry on with a working Gerrit Installation?

Thanks in advance
X

David Ostrovsky

unread,
Jul 16, 2014, 5:39:12 PM7/16/14
to repo-d...@googlegroups.com

Am Mittwoch, 16. Juli 2014 23:26:41 UTC+2 schrieb L Waver:
Since the downing of the the Google authentication I have been researching ways to compile the GitHub Authentication for Gerrit. 

Have you considered to use this change [1]?

L Waver

unread,
Jul 16, 2014, 5:43:27 PM7/16/14
to repo-d...@googlegroups.com
How would I pull that and set that up on a 2.8.5 (java 6u45) gerrit installation that already exists?

David Ostrovsky

unread,
Jul 17, 2014, 12:38:53 AM7/17/14
to repo-d...@googlegroups.com

Am Mittwoch, 16. Juli 2014 23:43:27 UTC+2 schrieb L Waver:
How would I pull that and set that up on a 2.8.5 (java 6u45) gerrit installation that already exists?


Back-ported the GH OAuth change to stable-2.8 branch [1].
So now we have native support in Gerrit core for GH OAuth
available on all active stable branches + master:

* stable-2.8: [1]
* stable-2.9: [2]
* master: [3]

Luca Milanesio

unread,
Jul 17, 2014, 2:59:07 AM7/17/14
to David Ostrovsky, repo-d...@googlegroups.com
Hi David,
well done ... will configure builds on ci.gerritforge.com in order to allow people to download the war artifacts directly.

Luca.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Ostrovsky

unread,
Jul 17, 2014, 3:03:09 AM7/17/14
to repo-d...@googlegroups.com, david.o...@gmail.com

Am Donnerstag, 17. Juli 2014 08:59:07 UTC+2 schrieb lucamilanesio:
Hi David,
well done ... will configure builds on ci.gerritforge.com in order to allow people to download the war artifacts directly.

Thanks Luca! That would be very helpful.

Luca Milanesio

unread,
Jul 17, 2014, 4:44:11 AM7/17/14
to David Ostrovsky, repo-d...@googlegroups.com
The first build on Gerrit+GitHub master is ready:

Can you do a sanity-check?

Luca.

David Ostrovsky

unread,
Jul 17, 2014, 4:50:26 AM7/17/14
to repo-d...@googlegroups.com

Am Donnerstag, 17. Juli 2014 10:44:11 UTC+2 schrieb lucamilanesio:
The first build on Gerrit+GitHub master is ready:

Can you do a sanity-check?

Yes, will test it later today, unless someone is faster than me.

Luca Milanesio

unread,
Jul 17, 2014, 4:51:28 AM7/17/14
to David Ostrovsky, repo-d...@googlegroups.com
Works for me ... but I'm obviously biased :-)

Luca.

David Ostrovsky

unread,
Jul 17, 2014, 2:28:41 PM7/17/14
to repo-d...@googlegroups.com, david.o...@gmail.com

Am Donnerstag, 17. Juli 2014 10:44:11 UTC+2 schrieb lucamilanesio:
The first build on Gerrit+GitHub master is ready:

Can you do a sanity-check?


Works as expected. During init step would it be more appropriate to call
authentication method OAuth_github instead of http_github?

Luca Milanesio

unread,
Jul 17, 2014, 2:30:15 PM7/17/14
to David Ostrovsky, repo-d...@googlegroups.com
True, as in theory as well could be generalised for other OAuth 2.0 implementations.
Will submit a patch-set for changing the name.

Luca.

L Waver

unread,
Jul 18, 2014, 5:16:30 AM7/18/14
to repo-d...@googlegroups.com
Is there a way to get the maven installer to work properly or another method to get these two required files in my possession?

I basically need the github gerrit plugin and lib on my current gerrit installation without having to upgrade java past 6u45. If I have to compile 2.8.x branch directly that would not be an issue either.

X

Luca Milanesio

unread,
Jul 18, 2014, 5:36:52 AM7/18/14
to L Waver, repo-d...@googlegroups.com
Dear Mr. X,
GitHub plugin works out of the box on Gerrit master and there is a stable-2.9 branch for Gerrit 2.9.

If you have Gerrit 2.8 ... there is no way to use the plugin.

DavidO has cherry-picked a OAuth 2.0-only patch on stable-2.8 that *will not* be merged though as it is not a bug-fix.
It is there if you want to use it, at your own risk.

Luca.

Luca Milanesio

unread,
Jul 18, 2014, 6:02:45 AM7/18/14
to L Waver, repo-d...@googlegroups.com
Apologies, in reality there should be a 2.8-compatible version of the Plugin ... I was getting confused ;-(
https://gerrit.googlesource.com/plugins%2Fgithub/+/refs%2Fheads%2Fstable-2.8

And binaries downloadable from:
http://ci.gerritforge.com/view/Plugins-stable-2.8/job/Plugin_github_stable-2.8/lastSuccessfulBuild/

Apologies again for the confusion ... it's Friday and my brain is already in weekend-mode :o)

Luca.
Reply all
Reply to author
Forward
0 new messages