We're relying on johnynek/bazel-deps to manage our external JVM dependencies. They are installed in an external Bazel repository (bazel-${PROJECT}/external/org_springframework_boot_spring_boot_starter) and imported as follows from the BUILD file 3rdparty/jvm/default/org/springframework/boot/BUILD:
One would now import //3rdparty/jvm/default/org/springframework/boot:spring_boot_starter in a BUILD file.
This way of handling it has an effect on the JAR name in the sandbox, the version number is abandoned as the file is called external/org_springframework_boot_spring_boot_starter/jar/org_springframework_boot_spring_boot_starter.jar.
The script springboot/write_manifest.sh tries to extract the version number from the Spring Boot dependency from its name. This does not work in our case, as the jar file names do not contain version numbers.
What would be the best approach to fix it?
Pass the Sprint Boot version as an argument the rule?
Extract it from META-INF/MANIFEST.MF of the first Spring Boot JAR? eg.
...
if [[ $var = *"spring-boot-"* ]]; then
jar xf $var META-INF/MANIFEST.MF
SPRING_VERSION=$(grep 'Implementation-Version' META-INF/MANIFEST.MF | cut -d : -f2 | tr -d '[:space:]')
rm -rf META-INF
...
We're relying on johnynek/bazel-deps to manage our external JVM dependencies. They are installed in an external Bazel repository (bazel-${PROJECT}/external/org_springframework_boot_spring_boot_starter) and imported as follows from the
BUILD
file3rdparty/jvm/default/org/springframework/boot/BUILD
:One would now import
//3rdparty/jvm/default/org/springframework/boot:spring_boot_starter
in a BUILD file.This way of handling it has an effect on the JAR name in the sandbox, the version number is abandoned as the file is called
external/org_springframework_boot_spring_boot_starter/jar/org_springframework_boot_spring_boot_starter.jar
.The script
springboot/write_manifest.sh
tries to extract the version number from the Spring Boot dependency from its name. This does not work in our case, as the jar file names do not contain version numbers. What would be the best approach to fix it?META-INF/MANIFEST.MF
of the first Spring Boot JAR? eg.Would you have any other suggestions?