This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/enforce-complete-runtime-classpath
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-cpconverter.git

commit cb72f2077c2a0bdb39ef2bca01af470da11cfa52
Author: Konrad Windszus <[email protected]>
AuthorDate: Thu Jun 9 10:11:20 2022 +0200

    SLING-11396 enforce complete runtime classpath
    
    WIP
---
 pom.xml | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/pom.xml b/pom.xml
index 5effb2e..ab656d6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -412,6 +412,45 @@
           </execution>
         </executions>
       </plugin>
+      <!-- validate that all necessary dependencies are part of the 
application -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>maven-enforcer-rules</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <id>enforce-complete-runtime-classpath</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <requireProvidedDependenciesInRuntimeClasspath
+                    
implementation="org.apache.sling.maven.enforcer.RequireProvidedDependenciesInRuntimeClasspath">
+                  <excludes>
+                    <exclude>javax.servlet:javax.servlet-api</exclude><!-- not 
used in the CLI context -->
+                    <exclude>javax.servlet:servlet-api</exclude><!-- not used 
in the CLI context -->
+                    
<exclude>org.apache.felix:org.apache.felix.scr.annotations</exclude><!-- 
annotations not used at run time -->
+                    <exclude>org.jetbrains:annotations</exclude>
+                    
<exclude>org.apache.felix:org.apache.felix.healthcheck.annotation</exclude>
+                    
<exclude>org.osgi:org.osgi.service.component.annotations</exclude>
+                    <exclude>org.osgi:org.osgi.annotation</exclude>
+                    <exclude>org.osgi:osgi.annotation</exclude>
+                    <exclude>org.osgi:org.osgi.annotation.bundle</exclude>
+                  </excludes>
+                </requireProvidedDependenciesInRuntimeClasspath>
+              </rules>
+              <fail>true</fail>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 

Reply via email to