This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-project-archetype.git
The following commit(s) were added to refs/heads/master by this push:
new 44282d9 SLING-11946 - Project Archetype build fails with Java 17 (#11)
44282d9 is described below
commit 44282d926f8921bbaed00e8c6d9acdaeb21dff5f
Author: Robert Munteanu <[email protected]>
AuthorDate: Wed Jul 12 16:54:02 2023 +0200
SLING-11946 - Project Archetype build fails with Java 17 (#11)
* 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 | 7 ---
pom.xml | 76 +++++++++++++++++++++++---
src/main/resources/archetype-resources/pom.xml | 2 +-
3 files changed, 68 insertions(+), 17 deletions(-)
diff --git a/.sling-module.json b/.sling-module.json
deleted file mode 100644
index 7155f40..0000000
--- a/.sling-module.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "jenkins": {
- "jdks": [
- 11
- ]
- }
-}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 7aec3a9..6d68397 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,18 @@
<version>1.0.9-SNAPSHOT</version>
<packaging>maven-archetype</packaging>
+ <properties>
+ <!-- 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>
+ <slf4japi.version>1.7.25</slf4japi.version>
+
+ <!-- version of the maven archetype plugin -->
+ <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 +75,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 +134,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>