Skip to content

Commit

Permalink
Merge pull request #16759 from protocolbuffers/cp-deprecate-mvn
Browse files Browse the repository at this point in the history
Deprecate building from source with Maven to be removed in 4.28.x.
  • Loading branch information
zhangskz committed May 6, 2024
2 parents 28ee9b8 + 51b48a4 commit 8bb298f
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,36 @@ If you are contributing code to protobuf or want to use a protobuf version
that hasn't been officially released yet, you can follow the instructions
below to build protobuf from source code.

### Build from Source

You may follow these instructions to build from source. This does not require
Maven to be installed. Note that these instructions skip running unit tests and
only describes how to install the core protobuf library (without the util
package).

1) Build the C++ code, or obtain a binary distribution of protoc (see
the toplevel [README.md](../README.md)). If you install a binary
distribution, make sure that it is the same version as this package.
If in doubt, run:

$ protoc --version

If you built the C++ code without installing, the compiler binary
should be located in ../src.

2) Invoke protoc to build DescriptorProtos.java:

$ protoc --java_out=core/src/main/java -I../src \
../src/google/protobuf/descriptor.proto

3) Compile the code in core/src/main/java using whatever means you prefer.

4) Install the classes wherever you prefer.

### Build from Source - With Maven

WARNING: Building from source with Maven is deprecated and will be removed in the 4.28.x release.

1) Install Apache Maven if you don't have it:

http://maven.apache.org/
Expand Down Expand Up @@ -109,31 +137,6 @@ The above instructions will install 2 maven artifacts:
as well as utilities to work with proto3 well-known
types.

### Build from Source - Without Maven

If you would rather not install Maven to build the library, you may
follow these instructions instead. Note that these instructions skip
running unit tests and only describes how to install the core protobuf
library (without the util package).

1) Build the C++ code, or obtain a binary distribution of protoc. If
you install a binary distribution, make sure that it is the same
version as this package. If in doubt, run:

$ protoc --version

If you built the C++ code without installing, the compiler binary
should be located in ../src.

2) Invoke protoc to build DescriptorProtos.java:

$ protoc --java_out=core/src/main/java -I../src \
../src/google/protobuf/descriptor.proto

3) Compile the code in core/src/main/java using whatever means you prefer.

4) Install the classes wherever you prefer.

## Compatibility Notice

* Protobuf minor version releases are backwards-compatible. If your code
Expand Down

0 comments on commit 8bb298f

Please sign in to comment.