Augment recommendation in java_import_external to be consistent with maven_jar, rules_jvm_external naming style
Augment recommendation in java_import_external to be consistent with maven_jar, rules_jvm_external naming style

maven_jar recommends the following:

> Note that the maven_jar name is used as a repository name, so it is limited by the rules governing workspace names: it cannot contain dashes nor dots (see the documentation on workspace names for the exact specification). By convention, maven_jar names should match the artifact name, replacing illegal characters with underscores and leaving off the version. For example, a rule with artifact = "org.apache.commons:commons-lang3:3.4" should have name = "org_apache_commons_commons_lang3".

https://docs.bazel.build/versions/master/be/workspace.html#maven_jar_name

`rules_jvm_external` follows the same algorithm and generates the following for `com.google.guava:guava`:

```
@maven//:com_google_guava_guava

# with maven_install.generate_compat_repositories
@com_google_guava_guava//jar
@com_google_guava_guava//:com_google_guava_guava # or @com_google_guava_guava
```

This PR sets the recommendation in `java_import_external` to be aligned with `maven_jar` and `rules_jvm_external` to improve interoperability and lower migration friction.

Related: https://github.com/bazelbuild/bazel/issues/8908

Closes #8929.

PiperOrigin-RevId: 258965649

ulfjack/bazel,perezd/bazel,perezd/bazel,cushon/bazel,katre/bazel,meteorcloudy/bazel,cushon/bazel,davidzchen/bazel,dslomov/bazel,cushon/bazel,perezd/bazel,davidzchen/bazel,perezd/bazel,safarmer/bazel,twitter-forks/bazel,ButterflyNetwork/bazel,meteorcloudy/bazel,ulfjack/bazel,meteorcloudy/bazel,akira-baruah/bazel,ButterflyNetwork/bazel,dslomov/bazel-windows,bazelbuild/bazel,davidzchen/bazel,safarmer/bazel,akira-baruah/bazel,aehlig/bazel,dslomov/bazel-windows,meteorcloudy/bazel,perezd/bazel,ulfjack/bazel,safarmer/bazel,cushon/bazel,aehlig/bazel,aehlig/bazel,twitter-forks/bazel,twitter-forks/bazel,werkt/bazel,safarmer/bazel,aehlig/bazel,ulfjack/bazel,akira-baruah/bazel,werkt/bazel,bazelbuild/bazel,dslomov/bazel,aehlig/bazel,bazelbuild/bazel,meteorcloudy/bazel,twitter-forks/bazel,werkt/bazel,davidzchen/bazel,katre/bazel,bazelbuild/bazel,perezd/bazel,davidzchen/bazel,dslomov/bazel,werkt/bazel,katre/bazel,katre/bazel,katre/bazel,akira-baruah/bazel,bazelbuild/bazel,davidzchen/bazel,meteorcloudy/bazel,werkt/bazel,dslomov/bazel-windows,dslomov/bazel-windows,dslomov/bazel,davidzchen/bazel,twitter-forks/bazel,meteorcloudy/bazel,cushon/bazel,safarmer/bazel,dslomov/bazel,dslomov/bazel,ulfjack/bazel,twitter-forks/bazel,cushon/bazel,bazelbuild/bazel,akira-baruah/bazel,aehlig/bazel,twitter-forks/bazel,ulfjack/bazel,dslomov/bazel,dslomov/bazel-windows,aehlig/bazel,dslomov/bazel-windows,ButterflyNetwork/bazel,ulfjack/bazel,ButterflyNetwork/bazel,katre/bazel,perezd/bazel,ButterflyNetwork/bazel,safarmer/bazel,ButterflyNetwork/bazel,akira-baruah/bazel,werkt/bazel