Skip to content

Commit 4c8da99

Browse files
zhangskzcopybara-github
authored andcommitted
Deprecate building from source with Maven to be removed in 4.28.x.
Most users should use the *pre-built* artifacts, or should build from source with Bazel instead. PiperOrigin-RevId: 631187695
1 parent f70d90b commit 4c8da99

File tree

1 file changed

+28
-25
lines changed

1 file changed

+28
-25
lines changed

java/README.md

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,36 @@ If you are contributing code to protobuf or want to use a protobuf version
6767
that hasn't been officially released yet, you can follow the instructions
6868
below to build protobuf from source code.
6969

70+
### Build from Source
71+
72+
You may follow these instructions to build from source. This does not require
73+
Maven to be installed. Note that these instructions skip running unit tests and
74+
only describes how to install the core protobuf library (without the util
75+
package).
76+
77+
1) Build the C++ code, or obtain a binary distribution of protoc (see
78+
the toplevel [README.md](../README.md)). If you install a binary
79+
distribution, make sure that it is the same version as this package.
80+
If in doubt, run:
81+
82+
$ protoc --version
83+
84+
If you built the C++ code without installing, the compiler binary
85+
should be located in ../src.
86+
87+
2) Invoke protoc to build DescriptorProtos.java:
88+
89+
$ protoc --java_out=core/src/main/java -I../src \
90+
../src/google/protobuf/descriptor.proto
91+
92+
3) Compile the code in core/src/main/java using whatever means you prefer.
93+
94+
4) Install the classes wherever you prefer.
95+
7096
### Build from Source - With Maven
7197

98+
WARNING: Building from source with Maven is deprecated and will be removed in the 4.28.x release.
99+
72100
1) Install Apache Maven if you don't have it:
73101

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

112-
### Build from Source - Without Maven
113-
114-
If you would rather not install Maven to build the library, you may
115-
follow these instructions instead. Note that these instructions skip
116-
running unit tests and only describes how to install the core protobuf
117-
library (without the util package).
118-
119-
1) Build the C++ code, or obtain a binary distribution of protoc. If
120-
you install a binary distribution, make sure that it is the same
121-
version as this package. If in doubt, run:
122-
123-
$ protoc --version
124-
125-
If you built the C++ code without installing, the compiler binary
126-
should be located in ../src.
127-
128-
2) Invoke protoc to build DescriptorProtos.java:
129-
130-
$ protoc --java_out=core/src/main/java -I../src \
131-
../src/google/protobuf/descriptor.proto
132-
133-
3) Compile the code in core/src/main/java using whatever means you prefer.
134-
135-
4) Install the classes wherever you prefer.
136-
137140
## Compatibility Notice
138141

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

0 commit comments

Comments
 (0)