This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-site-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new a7d083d5 [MSITE-869] Add an IT for filtering site sources into
generatedSiteDirectory
a7d083d5 is described below
commit a7d083d5bd6e6c9b9dc12b59679563b8f0dc527b
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Wed Nov 4 08:50:39 2026 +0000
[MSITE-869] Add an IT for filtering site sources into generatedSiteDirectory
---
.../filtered-site-sources/invoker.properties | 18 +++++
src/it/projects/filtered-site-sources/pom.xml | 77 ++++++++++++++++++++++
.../src/site-filtered/markdown/filtered.md | 24 +++++++
.../src/site/markdown/index.md | 22 +++++++
.../filtered-site-sources/src/site/site.xml | 30 +++++++++
.../projects/filtered-site-sources/verify.groovy | 36 ++++++++++
6 files changed, 207 insertions(+)
diff --git a/src/it/projects/filtered-site-sources/invoker.properties
b/src/it/projects/filtered-site-sources/invoker.properties
new file mode 100644
index 00000000..5cc536a2
--- /dev/null
+++ b/src/it/projects/filtered-site-sources/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.goals = clean site
diff --git a/src/it/projects/filtered-site-sources/pom.xml
b/src/it/projects/filtered-site-sources/pom.xml
new file mode 100644
index 00000000..8452b82b
--- /dev/null
+++ b/src/it/projects/filtered-site-sources/pom.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.site.its</groupId>
+ <artifactId>filtered-site-sources</artifactId>
+ <version>1.2.3</version>
+ <packaging>jar</packaging>
+ <name>Filtered Site Sources IT</name>
+
+ <properties>
+ <property-project-version>@project.version@</property-project-version>
+ <fluidoSkinVersion>@fluidoSkinVersion@</fluidoSkinVersion>
+
<project.build.outputTimestamp>@project.build.outputTimestamp@</project.build.outputTimestamp>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ </properties>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <generateReports>false</generateReports>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>3.5.0</version>
+ <executions>
+ <execution>
+ <id>filter-site-sources</id>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <!-- the default value of generatedSiteDirectory of the Site
Plugin -->
+
<outputDirectory>${project.build.directory}/generated-site</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/site-filtered</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git
a/src/it/projects/filtered-site-sources/src/site-filtered/markdown/filtered.md
b/src/it/projects/filtered-site-sources/src/site-filtered/markdown/filtered.md
new file mode 100644
index 00000000..887beac8
--- /dev/null
+++
b/src/it/projects/filtered-site-sources/src/site-filtered/markdown/filtered.md
@@ -0,0 +1,24 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Filtered page
+
+The name of this project is ${project.name}.
+
+The version of this project is ${project.version}.
diff --git a/src/it/projects/filtered-site-sources/src/site/markdown/index.md
b/src/it/projects/filtered-site-sources/src/site/markdown/index.md
new file mode 100644
index 00000000..3b3bd5d7
--- /dev/null
+++ b/src/it/projects/filtered-site-sources/src/site/markdown/index.md
@@ -0,0 +1,22 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Index
+
+This page is not filtered: ${project.version}
diff --git a/src/it/projects/filtered-site-sources/src/site/site.xml
b/src/it/projects/filtered-site-sources/src/site/site.xml
new file mode 100644
index 00000000..03614be4
--- /dev/null
+++ b/src/it/projects/filtered-site-sources/src/site/site.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<site xmlns="http://maven.apache.org/SITE/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0
https://maven.apache.org/xsd/site-2.0.0.xsd"
+ name="${project.name}">
+ <skin>
+ <groupId>org.apache.maven.skins</groupId>
+ <artifactId>maven-fluido-skin</artifactId>
+ <version>${fluidoSkinVersion}</version>
+ </skin>
+</site>
diff --git a/src/it/projects/filtered-site-sources/verify.groovy
b/src/it/projects/filtered-site-sources/verify.groovy
new file mode 100644
index 00000000..ab997d9b
--- /dev/null
+++ b/src/it/projects/filtered-site-sources/verify.groovy
@@ -0,0 +1,36 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+def page = new File( basedir, 'target/generated-site/markdown/filtered.md' )
+assert page.exists() : "$page must have been filtered into the generated site
directory"
+
+page = new File( basedir, 'target/site/filtered.html' )
+assert page.exists() : "$page must have been generated"
+def content = page.text
+
+assert content.contains( '<h1>Filtered page</h1>' ) : 'Found invalid headline'
+assert content.contains( 'The name of this project is Filtered Site Sources
IT.' ) : 'project.name was not filtered'
+assert content.contains( 'The version of this project is 1.2.3.' ) :
'project.version was not filtered'
+assert !content.contains( '${project' ) : 'Found an unresolved placeholder'
+
+// pages in src/site are not filtered
+page = new File( basedir, 'target/site/index.html' )
+assert page.exists() : "$page must have been generated"
+assert page.text.contains( '${project.version}' ) : 'src/site must not be
filtered'