Re-add `licenses()` - internal license checker still requires it :/ (#506)

And take the opportunity to fix default_applicable_licenses in the gazelle plugin
diff --git a/BUILD b/BUILD
index 505d249..fdccf79 100644
--- a/BUILD
+++ b/BUILD
@@ -12,6 +12,8 @@
     license_kinds = ["@rules_license//licenses/spdx:Apache-2.0"],
 )
 
+licenses(["notice"])
+
 # buildifier: disable=skylark-comment
 # gazelle:exclude skylark_library.bzl
 
diff --git a/distribution/BUILD b/distribution/BUILD
index 92f121b..95ec9af 100644
--- a/distribution/BUILD
+++ b/distribution/BUILD
@@ -8,6 +8,8 @@
     default_visibility = ["//visibility:private"],
 )
 
+licenses(["notice"])
+
 remove_internal_only(
     name = "distro_workspace",
     src = "//:WORKSPACE",
diff --git a/docs/BUILD b/docs/BUILD
index 7cef661..8569278 100644
--- a/docs/BUILD
+++ b/docs/BUILD
@@ -2,6 +2,8 @@
 
 package(default_applicable_licenses = ["//:license"])
 
+licenses(["notice"])
+
 stardoc_with_diff_test(
     name = "analysis_test",
     bzl_library_target = "//rules:analysis_test",
diff --git a/docs/private/BUILD b/docs/private/BUILD
index 2064516..00b4e36 100644
--- a/docs/private/BUILD
+++ b/docs/private/BUILD
@@ -1,3 +1,5 @@
 # This package only contains source targets
 
 package(default_applicable_licenses = ["//:license"])
+
+licenses(["notice"])
diff --git a/gazelle/BUILD b/gazelle/BUILD
index 2e5f191..8f1636f 100644
--- a/gazelle/BUILD
+++ b/gazelle/BUILD
@@ -1,7 +1,7 @@
 load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
 load("@rules_license//rules:license.bzl", "license")
 
-package(default_applicable_licenses = ["@bazel_skylib//:license"])
+package(default_applicable_licenses = ["//:license"])
 
 license(
     name = "license",
@@ -9,6 +9,8 @@
     license_kinds = ["@rules_license//licenses/spdx:Apache-2.0"],
 )
 
+licenses(["notice"])
+
 exports_files(["WORKSPACE.bzlmod"])
 
 bzl_library(
diff --git a/lib/BUILD b/lib/BUILD
index 08c00a8..cff8065 100644
--- a/lib/BUILD
+++ b/lib/BUILD
@@ -5,6 +5,8 @@
     default_visibility = ["//visibility:public"],
 )
 
+licenses(["notice"])
+
 # export bzl files for the documentation
 exports_files(
     glob(["*.bzl"]),
diff --git a/rules/BUILD b/rules/BUILD
index 6de7b2c..11706e4 100644
--- a/rules/BUILD
+++ b/rules/BUILD
@@ -5,6 +5,8 @@
     default_visibility = ["//visibility:public"],
 )
 
+licenses(["notice"])
+
 bzl_library(
     name = "analysis_test",
     srcs = ["analysis_test.bzl"],
diff --git a/rules/private/BUILD b/rules/private/BUILD
index 429e6cb..b6a935d 100644
--- a/rules/private/BUILD
+++ b/rules/private/BUILD
@@ -2,6 +2,8 @@
 
 package(default_applicable_licenses = ["//:license"])
 
+licenses(["notice"])
+
 bzl_library(
     name = "copy_common",
     srcs = ["copy_common.bzl"],
diff --git a/tests/BUILD b/tests/BUILD
index f0b2a1f..7d978cb 100644
--- a/tests/BUILD
+++ b/tests/BUILD
@@ -20,6 +20,8 @@
     default_testonly = 1,
 )
 
+licenses(["notice"])
+
 exports_files(
     ["unittest.bash"],
     visibility = ["//tests:__subpackages__"],
diff --git a/tests/bzl_library/BUILD b/tests/bzl_library/BUILD
index e6a8cda..0ed2e5a 100644
--- a/tests/bzl_library/BUILD
+++ b/tests/bzl_library/BUILD
@@ -6,6 +6,8 @@
     default_testonly = 1,
 )
 
+licenses(["notice"])
+
 filegroup(
     name = "a",
     srcs = ["testdata/a.bzl"],
diff --git a/tests/common_settings/BUILD b/tests/common_settings/BUILD
index f21ba50..ef70746 100644
--- a/tests/common_settings/BUILD
+++ b/tests/common_settings/BUILD
@@ -5,6 +5,8 @@
     default_testonly = 1,
 )
 
+licenses(["notice"])
+
 int_flag(
     name = "my_int_flag",
     build_setting_default = 42,
diff --git a/tests/copy_directory/BUILD.bazel b/tests/copy_directory/BUILD.bazel
index c706561..bd4fa8f 100644
--- a/tests/copy_directory/BUILD.bazel
+++ b/tests/copy_directory/BUILD.bazel
@@ -8,6 +8,8 @@
     default_testonly = 1,
 )
 
+licenses(["notice"])
+
 # Copy of directory containing files a and b, and a subdir containing c
 copy_directory(
     name = "copy_of_dir_with_subdir",
diff --git a/tests/copy_file/BUILD b/tests/copy_file/BUILD
index f9cb94c..873f966 100644
--- a/tests/copy_file/BUILD
+++ b/tests/copy_file/BUILD
@@ -38,6 +38,8 @@
     default_testonly = 1,
 )
 
+licenses(["notice"])
+
 sh_test(
     name = "copy_file_tests",
     srcs = ["copy_file_tests.sh"],
diff --git a/tests/diff_test/BUILD b/tests/diff_test/BUILD
index 475f156..0aec12b 100644
--- a/tests/diff_test/BUILD
+++ b/tests/diff_test/BUILD
@@ -7,6 +7,8 @@
     default_testonly = 1,
 )
 
+licenses(["notice"])
+
 sh_test(
     name = "diff_test_tests",
     srcs = ["diff_test_tests.sh"],
diff --git a/tests/select_file/BUILD b/tests/select_file/BUILD
index 6f1e8f7..be844e2 100644
--- a/tests/select_file/BUILD
+++ b/tests/select_file/BUILD
@@ -6,6 +6,8 @@
     default_testonly = 1,
 )
 
+licenses(["notice"])
+
 filegroup(
     name = "fg",
     srcs = [
diff --git a/tests/write_file/BUILD b/tests/write_file/BUILD
index faae93d..513af20 100644
--- a/tests/write_file/BUILD
+++ b/tests/write_file/BUILD
@@ -40,6 +40,8 @@
     default_testonly = 1,
 )
 
+licenses(["notice"])
+
 sh_test(
     name = "write_file_tests",
     srcs = ["write_file_tests.sh"],
diff --git a/toolchains/unittest/BUILD b/toolchains/unittest/BUILD
index cf50c3f..275ddfc 100644
--- a/toolchains/unittest/BUILD
+++ b/toolchains/unittest/BUILD
@@ -2,6 +2,8 @@
 
 package(default_applicable_licenses = ["//:license"])
 
+licenses(["notice"])
+
 toolchain_type(
     name = "toolchain_type",
     visibility = ["//visibility:public"],