Repository navigation
Fix pom file errors caused by the extra "$" - #12177
Conversation
| <Bundle-DocURL>https://developers.google.com/protocol-buffers/</Bundle-DocURL> | ||
| <Bundle-SymbolicName>com.google.protobuf.util</Bundle-SymbolicName> | ||
| <Export-Package>com.google.protobuf.util;version=${project.version}</Export-Package> | ||
| <Export-Package>com.google.protobuf.util;version={project.version}</Export-Package> |
There was a problem hiding this comment.
since we see com.google.protobuf.util;version=${project.version} in the generated pom of 3.22.1
i am thinking this needs to use {version} instead (see line 7)
if {project.version} would be available, the generated pom would have looked like this:
com.google.protobuf.util;version=$3.22.1
There was a problem hiding this comment.
I'm trying to match https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java-util/3.21.12/protobuf-java-util-3.21.12.pom which uses pom replacements (instead of the bazel replacements) for project.version so I think the original in 22.1 was correct. I'm reverting that part of this change now.
Does that seem right to you?
There was a problem hiding this comment.
i think both variants work, the plugin configuration probably does not even need to be in the published pom
what is important is that the version can be evaluated correctly when the build is generating the bundle, so that in the jar we see the right values in the META-INF/MANIFEST.MF file (snippet from protobuf-java-util-3.21.12.jar):
...
Bundle-SymbolicName: com.google.protobuf.util
Bundle-Version: 3.21.12
Created-By: Apache Maven Bundle Plugin
Export-Package: com.google.protobuf.util;version="3.21.12";uses:="com.go
ogle.protobuf,javax.annotation"
...
this can be achieved by "hardcoding" the version during bazel replacement or by letting the bundle maven plugin evaluate ${project.version} correctly (as done in the follow-up PR where $ was added back)
Fixes #12170