diff --git a/tensorflow-core/tensorflow-core-api/build.sh b/tensorflow-core/tensorflow-core-api/build.sh
index 6aa129c3592..fe7cd119127 100755
--- a/tensorflow-core/tensorflow-core-api/build.sh
+++ b/tensorflow-core/tensorflow-core-api/build.sh
@@ -33,7 +33,7 @@ BUILD_FLAGS="$BUILD_FLAGS --experimental_repo_remote_exec --python_path="$PYTHON
BUILD_FLAGS="$BUILD_FLAGS --distinct_host_configuration=true"
# Build C/C++ API of TensorFlow itself including a target to generate ops for Java
-bazel build $BUILD_FLAGS $BUILD_EXTRA_FLAGS \
+bazel build $BUILD_FLAGS ${BUILD_USER_FLAGS:-} \
@org_tensorflow//tensorflow:tensorflow_cc \
@org_tensorflow//tensorflow/tools/lib_package:jnilicenses_generate \
:java_proto_gen_sources \
diff --git a/tensorflow-core/tensorflow-core-api/pom.xml b/tensorflow-core/tensorflow-core-api/pom.xml
index f3580704472..3e04e9bb1f7 100644
--- a/tensorflow-core/tensorflow-core-api/pom.xml
+++ b/tensorflow-core/tensorflow-core-api/pom.xml
@@ -260,7 +260,7 @@
${javacpp.platform.extension}
- ${native.build.flags}
+ ${native.build.flags}
${project.basedir}