This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-parent.git
The following commit(s) were added to refs/heads/master by this push:
new 6b46d29 SLING-11862 Prevent usage of annotation dependencies with
compile scope (#34)
6b46d29 is described below
commit 6b46d2962c971c1af0880fcf5fd86a0b6edcaccb
Author: Konrad Windszus <[email protected]>
AuthorDate: Mon May 8 11:55:31 2023 +0200
SLING-11862 Prevent usage of annotation dependencies with compile scope
(#34)
---
sling-bundle-parent/pom.xml | 11 +++++++++++
sling-parent/pom.xml | 21 +++++++++++++++++++++
2 files changed, 32 insertions(+)
diff --git a/sling-bundle-parent/pom.xml b/sling-bundle-parent/pom.xml
index a629fa0..6241b88 100644
--- a/sling-bundle-parent/pom.xml
+++ b/sling-bundle-parent/pom.xml
@@ -162,6 +162,17 @@ Bundle-DocURL: https://sling.apache.org
</excludes>
<message>Use the individual OSGi chapter
dependencies instead of the aggregate ones. Further infos at
http://docs.osgi.org/artifacts/#aggregate-artifacts.</message>
</bannedDependencies>
+ <bannedDependencies>
+ <searchTransitive>false</searchTransitive>
+ <excludes>
+
<exclude>org.osgi:org.osgi.annotation.versioning:*:*:compile</exclude>
+
<exclude>org.osgi:org.osgi.annotation.bundle:*:*:compile</exclude>
+
<exclude>org.osgi:org.osgi.service.component.annotations:*:*:compile</exclude>
+
<exclude>org.osgi:org.osgi.service.metatype.annotations:*:*:compile</exclude>
+
<exclude>org.apache.sling:org.apache.sling.servlets.annotations:*:*:compile</exclude>
+ </excludes>
+ <message>The annotation dependencies
should be used with scope provided to prevent transitive inheritance and to
prevent runtime inclusion</message>
+ </bannedDependencies>
</rules>
</configuration>
</execution>
diff --git a/sling-parent/pom.xml b/sling-parent/pom.xml
index 7c950dd..a8bc4b8 100644
--- a/sling-parent/pom.xml
+++ b/sling-parent/pom.xml
@@ -147,6 +147,23 @@
</rules>
</configuration>
</execution>
+ <execution>
+ <id>enforce-scope-of-annotation-deps</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <bannedDependencies>
+ <searchTransitive>false</searchTransitive>
+ <excludes>
+
<exclude>org.jetbrains:annotations:*:*:compile</exclude>
+ </excludes>
+ <message>The annotation dependencies
should be used with scope provided to prevent transitive inheritance and to
prevent runtime inclusion</message>
+ </bannedDependencies>
+ </rules>
+ </configuration>
+ </execution>
</executions>
</plugin>
@@ -262,6 +279,10 @@
<pluginManagement>
<plugins>
+ <plugin>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>3.3.0</version>
+ </plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<!-- this affects both direct invocation and execution in
the context of site building
(https://maven.apache.org/shared/maven-reporting-exec/) -->