grpc-java icon indicating copy to clipboard operation
grpc-java copied to clipboard

Push Java libraries to Maven central

Open ludoch opened this issue 11 years ago • 21 comments

As the majority of Java Developer, I am using Maven and not Gradle...

After compiling my self the protoc tool for Mac, and creating the Route sample Maven project, I am still block with the fact that the import io.grpc.ServerImpl; import io.grpc.stub.StreamObserver; import io.grpc.transport.netty.NettyServerBuilder;

are nowhere in Maven...

My Current pom is like this, and the protoc generates correct code:

4.0.0 com.google.apphosting.grpc grpctest 1.0 jar dtrott http://maven.davidtrott.com/repository com.google.guava guava 18.0 jar javax.json javax.json-api 1.0 jar com.google.protobuf protobuf-java 3.0.0-alpha-2 UTF-8 1.7 1.7 org.apache.maven.plugins maven-compiler-plugin 3.2 1.5 1.5 com.google.protobuf.tools maven-protoc-plugin 0.1.10 /usr/local/bin/protoc compile testCompile

ludoch avatar Mar 05 '15 16:03 ludoch

  <pluginRepositories>
    <pluginRepository>
      <id>dtrott</id>
      <url>http://maven.davidtrott.com/repository</url>
    </pluginRepository>
  </pluginRepositories>  
  <dependencies>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>18.0</version>
      <type>jar</type>
    </dependency>
    <dependency>
      <groupId>javax.json</groupId>
      <artifactId>javax.json-api</artifactId>
      <version>1.0</version>
      <type>jar</type>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <version>3.0.0-alpha-2</version>
    </dependency>

  </dependencies>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.2</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.google.protobuf.tools</groupId>
        <artifactId>maven-protoc-plugin</artifactId>
        <version>0.1.10</version>
        <configuration>
          <protocExecutable>/usr/local/bin/protoc</protocExecutable>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

ludoch avatar Mar 05 '15 16:03 ludoch

I am working on a PR if nobody is working on this...

ludoch avatar Mar 05 '15 17:03 ludoch

FYI, there are snapshot artifacts here: https://oss.sonatype.org/content/repositories/snapshots/io/grpc/

Also, you can use gradle install do install to your local maven repository.

nmittler avatar Mar 05 '15 19:03 nmittler

This is in part blocked on getting Netty artifacts that we can use. The plan there is to swap to Netty 4.1.

ejona86 avatar Mar 11 '15 17:03 ejona86

Depends on io.netty:netty-codec-http2:4.1.0.Beta5 being released

benmccann avatar Mar 26 '15 17:03 benmccann

Yes, the next Netty 4.1 Beta release. Originally, we were going to wait until Netty 4.1, as then there would be more frequent bug fix releases (not once a year). However, it is true that now that 4.1 is getting close enough Beta5 would suffice.

ejona86 avatar Mar 26 '15 17:03 ejona86

As of yet (to my knowledge), HTTP/2 hasn't been backported to Netty 4.0. So no, not at this time.

ejona86 avatar Mar 26 '15 18:03 ejona86

@benmccann there is much work to do for backport to 4.0,so keep 4.1,any way ,there will be a 4.1 final later :P. @ejona86 release date ?

He-Pin avatar Mar 30 '15 07:03 He-Pin

FYI, Netty is leaning toward HTTP/2 support in Netty 4.1+ (https://github.com/netty/netty/issues/3515)

nmittler avatar Mar 30 '15 15:03 nmittler

Could we use Netty 4.1.0.Beta4 for the time being until 4.1.0.Beta5 is released? It looks like only a couple lines in NettyClientHandler rely on the beta 5 API.

benmccann avatar Apr 03 '15 12:04 benmccann

There were quite a large number of bug fixes and performance fixes that went in after beta4 was cut so we need to wait for 5 sadly

louiscryan avatar Apr 08 '15 21:04 louiscryan

I asked over there and it sounds like they're quite close to beta 5 or even 4.1.0 final

benmccann avatar Apr 08 '15 21:04 benmccann

Think we can do this now that Netty 4.1.0.Beta5 is released and we're grabbing it from Maven?

benmccann avatar May 14 '15 17:05 benmccann

Yes, certainly. As of today we are only waiting on the few docs-related changes in the 0.7.0 milestone. We would also like #411 to be done, but we wouldn't necessarily delay for it.

ejona86 avatar May 14 '15 18:05 ejona86

Any word on pushing here?

parsnips avatar May 21 '15 23:05 parsnips

We are still delaying for some Android-related changes. There has been a reasonable amount of investigation.

The plan is that we release 0.7.0 tomorrow, independent of the Android changes. If the Android changes don't make it, then we may release a 0.7.1 later.

ejona86 avatar May 21 '15 23:05 ejona86

So the release didn't happen today. We were ready, but lacked enough time at the end of the day to do it. The plan now is Tuesday morning.

ejona86 avatar May 23 '15 00:05 ejona86

Binaries were pushed to Maven Central on May 26th. This should be resolved.

ejona86 avatar Jun 01 '15 23:06 ejona86

Woo! Thank you!

benmccann avatar Jun 02 '15 03:06 benmccann

i just use eclipse + maven in mac to develop, first define .proto file and mvn compile ,generate gRPC code in target/generated-sources ,i manually copy this files to /src/generated,and writing a client in /main/java, but it don't work, without gradle, how to building, i looked in their readme and Java tutorial ,but also have no idea how to do this for my own client/server

zhongql avatar Jan 17 '16 11:01 zhongql