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

rombert pushed a commit to branch issue/SLING-11946
in repository https://gitbox.apache.org/repos/asf/sling-project-archetype.git

commit 0832103d4995e2c2ffdc31052f22f22258360eba
Author: Robert Munteanu <[email protected]>
AuthorDate: Wed Jul 12 01:22:10 2023 +0300

    SLING-11946 - Project Archetype build fails with Java 17
    
    - remove the restriction to only use Java 11
    - update the bundle plugin to the latest version
    - inline the archetype-parent definition and use the sling parent pom 
instead
    
    With only the Sling Project archetype seeing activity recently, maintaining 
a parent POM is a costly
    indirection and we skip it.
---
 .sling-module.json                             |  8 +--
 pom.xml                                        | 89 +++++++++++++++++++++++---
 src/main/resources/archetype-resources/pom.xml |  2 +-
 3 files changed, 82 insertions(+), 17 deletions(-)

diff --git a/.sling-module.json b/.sling-module.json
index 7155f40..8b13789 100644
--- a/.sling-module.json
+++ b/.sling-module.json
@@ -1,7 +1 @@
-{
-  "jenkins": {
-    "jdks": [
-      11
-    ]
-  }
-}
\ No newline at end of file
+
diff --git a/pom.xml b/pom.xml
index 7aec3a9..235b084 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,8 +22,8 @@
 
     <parent>
         <groupId>org.apache.sling</groupId>
-        <artifactId>sling-archetype-parent</artifactId>
-        <version>7</version>
+        <artifactId>sling</artifactId>
+        <version>50</version>
         <relativePath />
     </parent>
 
@@ -32,6 +32,31 @@
     <version>1.0.9-SNAPSHOT</version>
     <packaging>maven-archetype</packaging>
 
+    <properties>
+        <!-- plugin versions to use in generated archetypes -->
+        <bndplugin.version>5.0.1</bndplugin.version>
+        <jarplugin.version>3.2.0</jarplugin.version>
+        <compilerplugin.version>3.8.1</compilerplugin.version>
+        <slingplugin.version>2.4.2</slingplugin.version>
+        <launchpadplugin.version>2.3.2</launchpadplugin.version>
+        <jarplugin.version>3.2.0</jarplugin.version>
+        <warplugin.version>3.2.3</warplugin.version>
+        <jettyplugin.version>6.1.23</jettyplugin.version>
+
+        <!-- various properties which influence generated archetypes -->
+        <archetype.java.version>11</archetype.java.version>
+        
+        <!-- dependency versions to use in generated archetypes -->
+        <junit.version>4.12</junit.version>
+        <slingapi.version>2.22.0</slingapi.version>
+        <slf4japi.version>1.7.25</slf4japi.version>
+        <versionannotations.version>1.1.0</versionannotations.version>
+        <componentannotations.version>1.4.0</componentannotations.version>
+        <metatypeannotations.version>1.4.0</metatypeannotations.version>
+
+        <archetype.version>3.1.2</archetype.version>
+    </properties>
+
     <name>Project Archetype</name>
     <description>
         This archetype is creating a full Sling Project composed of
@@ -63,13 +88,58 @@
             </extension>
         </extensions>
 
-        <pluginManagement>
-            <plugins>
-                <plugin>
-                    <artifactId>maven-archetype-plugin</artifactId>
-                </plugin>
-            </plugins>
-        </pluginManagement>
+        <resources>
+            <resource>
+                <!-- filter pom.xml -->
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+                <includes>
+                    <include>**/pom.xml</include>
+                </includes>
+            </resource>
+            <!-- Don't filter anything else -->
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>false</filtering>
+                <excludes>
+                    <exclude>**/pom.xml</exclude>
+                </excludes>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <!-- 
+                    allow defining un-filtered resources in the pom.xml
+                    For example, the artifactId should not be escaped:
+                    
+                    <artifact>\${artifactId}</artifactId>
+                 -->
+                <configuration>
+                    <escapeString>\</escapeString>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-archetype-plugin</artifactId>
+                <version>${archetype.version}</version>
+                <extensions>true</extensions>
+                <!-- Verify archetype invocation was successful as part of the 
verify phase -->
+                <configuration>
+                    <postBuildHookScript>verify.groovy</postBuildHookScript>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        
<exclude>src/test/resources/projects/*/goal.txt</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>                
+        </plugins>
     </build>
 
     <dependencies>
@@ -77,6 +147,7 @@
             <groupId>commons-io</groupId>
             <artifactId>commons-io</artifactId>
             <version>2.6</version>
+            <scope>compile</scope>
         </dependency>
     </dependencies>
 </project>
diff --git a/src/main/resources/archetype-resources/pom.xml 
b/src/main/resources/archetype-resources/pom.xml
index bb61600..26fd114 100644
--- a/src/main/resources/archetype-resources/pom.xml
+++ b/src/main/resources/archetype-resources/pom.xml
@@ -63,7 +63,7 @@
         <jar.plugin.version>3.1.1</jar.plugin.version>
         <enforcer.plugin.version>3.0.0-M2</enforcer.plugin.version>
         <compiler.plugin.version>3.8.0</compiler.plugin.version>
-        <bundle.plugin.version>4.2.0</bundle.plugin.version>
+        <bundle.plugin.version>5.1.9</bundle.plugin.version>
         <clean.plugin.version>3.1.0</clean.plugin.version>
         <installer.plugin.version>3.0.0-M1</installer.plugin.version>
         <surfire.plugin.version>3.0.0-M3</surfire.plugin.version>

Reply via email to