Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The parent pom in the Maven Central Repo seems to be missing #13

Closed
chees opened this issue Aug 23, 2013 · 5 comments
Closed

The parent pom in the Maven Central Repo seems to be missing #13

chees opened this issue Aug 23, 2013 · 5 comments
Assignees

Comments

@chees
Copy link

chees commented Aug 23, 2013

Trying to use the Java lib with a dependency tool like SBT or Maven fails. There seems to be a parent pom missing or something like that.
See also:
http://stackoverflow.com/questions/18385456/how-to-use-google-api-services-datastore-protobuf-with-sbt-or-maven?noredirect=1

@ghost ghost assigned eddavisson Aug 23, 2013
@eddavisson
Copy link
Contributor

Thanks for the report. Can you provide a sample pom.xml or .sbt file and a Maven/SBT command line that reproduces the failure?

@proppy
Copy link
Contributor

proppy commented Aug 23, 2013

When trying to run mvn package for a new project including the dependencies:

<dependencies>
  <dependency>
    <groupId>com.google.apis</groupId>
    <artifactId>google-api-services-datastore-protobuf</artifactId>
    <version>v1beta1-rev2-1.0.1</version>
  </dependency>
</dependencies>

It produces the following error

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.414s
[INFO] Finished at: Fri Aug 23 18:13:47 UTC 2013
[INFO] Final Memory: 5M/14M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project adams: Could not resolve dependencies for project google-cloud-datastore-demos:adams:jar:1: Faile\
d to collect dependencies for [com.google.apis:google-api-services-datastore-protobuf:jar:v1beta1-rev2-1.0.1 (compile)]: Failed to read art\
ifact descriptor for com.google.apis:google-api-services-datastore-protobuf:jar:v1beta1-rev2-1.0.1: Failure to find com.google.apis:google-\
api-services-datastore-protobuf-parent:pom:v1beta1-rev2-1.0.1 in http://repo.maven.apache.org/maven2 was cached in the local repository, re\
solution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

@chees
Copy link
Author

chees commented Aug 24, 2013

I just looked a bit more into the underlying problem. It seems that it's indeed the parent project that's missing from Maven Central. When I installed it locally it sorta worked. See my steps below:

  1. git clone https://github.com/GoogleCloudPlatform/google-cloud-datastore.git
  2. brew install protobuf-c
  3. export JAVA_HOME=$(/usr/libexec/java_home)
  4. cd google-cloud-datastore/java
  5. mvn install

In my new Play2 Scala SBT project I used this dependency:
"com.google.apis" % "google-api-services-datastore-protobuf" % "v1beta1-rev2-1.0.1"
This lib could now actually be resolved, but now I got lots of these warnings:
[warn] Class com.google.protobuf.Parser not found - continuing with a stub.

After I also added that dependency explicitly it worked:
"com.google.protobuf" % "protobuf-java" % "2.5.0"

However, this sounds weird to me since protobuf is already a dependency:
https://github.com/GoogleCloudPlatform/google-cloud-datastore/blob/master/java/datastore/pom.xml#L11

@proppy
Copy link
Contributor

proppy commented Aug 24, 2013

It looks like the original issue is fixed (parent pom missing).

The parent pom is there now:
http://search.maven.org/#artifactdetails%7Ccom.google.apis%7Cgoogle-api-services-datastore-protobuf-parent%7Cv1beta1-rev2-1.0.1%7Cpom

Can you open another issue about the protobuf warning? Which version of proto-c did you install with brew?

@proppy proppy closed this as completed Aug 24, 2013
@chees
Copy link
Author

chees commented Aug 25, 2013

Thanks, that fixed the original problem indeed :)
Regarding the protobuf issue:

I have 2.5.0 installed but it seemed to use 2.4.1 sometimes.

To test this I made 1 empty project with Maven and 1 empty project with SBT.
Both had google-api-services-datastore-protobuf v1beta1-rev2-1.0.1 as their only dependency.

The maven project resolved the dependencies and picked protobuf-java-2.5.0 right away.

The sbt project resolved the dependencies and picked protobuf-java-2.5.0 at first since google-api-services-datastore-protobuf depends on it, but then it got to google-http-client-protobuf (which also has a dependency on protobuf-java but doesn't specify a version) at which point sbt started downloading protobuf-java-2.4.1 for some reason. I don't understand why, but that's the reason it doesn't work.
After I explicitly added "com.google.protobuf" % "protobuf-java" % "2.5.0" to my sbt project it did stick with version 2.5.0, so that's a workaround.

Anyway, it looks like the problem is in the google-http-client-protobuf pom (or maybe in the ivy resolver?) and not in this lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants