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-archetypes.git
The following commit(s) were added to refs/heads/master by this push:
new 01369b5 Use project.artifactId for the site name in site, site-simple
and plugin-site
01369b5 is described below
commit 01369b5af068b2f97b19dc2289d94b2a42a80669
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Sat Oct 31 17:28:05 2026 +0000
Use project.artifactId for the site name in site, site-simple and
plugin-site
---
.../src/main/resources/archetype-resources/src/site/site.xml | 4 ++--
.../src/test/resources/projects/it-basic/verify.groovy | 3 +++
.../src/main/resources/archetype-resources/src/site/site.xml | 4 ++--
.../test/resources/projects/it-basic/reference/src/site/site.xml | 4 ++--
.../src/test/resources/projects/it-basic/verify.groovy | 3 +++
.../src/main/resources/archetype-resources/src/site/site.xml | 4 ++--
.../src/main/resources/archetype-resources/src/site/site_fr.xml | 4 ++--
.../src/test/resources/projects/it-basic/verify.groovy | 7 ++++++-
8 files changed, 22 insertions(+), 11 deletions(-)
diff --git
a/maven-archetype-plugin-site/src/main/resources/archetype-resources/src/site/site.xml
b/maven-archetype-plugin-site/src/main/resources/archetype-resources/src/site/site.xml
index a2f1199..bfb5910 100644
---
a/maven-archetype-plugin-site/src/main/resources/archetype-resources/src/site/site.xml
+++
b/maven-archetype-plugin-site/src/main/resources/archetype-resources/src/site/site.xml
@@ -18,10 +18,10 @@
*/
-->
-<site name="${artifactId}" xmlns="http://maven.apache.org/SITE/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<site name="${project.artifactId}" xmlns="http://maven.apache.org/SITE/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SITE/2.1.0
https://maven.apache.org/xsd/site-2.1.0.xsd">
<bannerLeft href="https://www.apache.org/">
- <image src="https://maven.apache.org/images/apache-maven-project.png"
alt="${artifactId}"/>
+ <image src="https://maven.apache.org/images/apache-maven-project.png"
alt="${project.artifactId}"/>
</bannerLeft>
<bannerRight href="https://maven.apache.org/">
diff --git
a/maven-archetype-plugin-site/src/test/resources/projects/it-basic/verify.groovy
b/maven-archetype-plugin-site/src/test/resources/projects/it-basic/verify.groovy
index 626555c..ac4d107 100644
---
a/maven-archetype-plugin-site/src/test/resources/projects/it-basic/verify.groovy
+++
b/maven-archetype-plugin-site/src/test/resources/projects/it-basic/verify.groovy
@@ -2,3 +2,6 @@ File site = new File(basedir,
'project/basic-plugin-site/target/site')
for (String page in ['index.html', 'usage.html', 'examples/example.html',
'project-info.html']) {
assert new File(site, page).isFile() : page + ' was not rendered'
}
+// the site name comes from the artifactId, not from a literal placeholder
+String title = (new File(site, 'index.html').text =~
/<title>([^<]*)<\/title>/)[0][1]
+assert title.endsWith('basic-plugin-site') : 'index.html has title "' + title
+ '"'
diff --git
a/maven-archetype-site-simple/src/main/resources/archetype-resources/src/site/site.xml
b/maven-archetype-site-simple/src/main/resources/archetype-resources/src/site/site.xml
index ebfaa94..3091ca5 100644
---
a/maven-archetype-site-simple/src/main/resources/archetype-resources/src/site/site.xml
+++
b/maven-archetype-site-simple/src/main/resources/archetype-resources/src/site/site.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<site name="${artifactId}" xmlns="http://maven.apache.org/SITE/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<site name="${project.artifactId}" xmlns="http://maven.apache.org/SITE/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SITE/2.1.0
https://maven.apache.org/xsd/site-2.1.0.xsd">
<bannerLeft href="https://www.apache.org/">
- <image src="https://maven.apache.org/images/apache-maven-project.png"
alt="${artifactId}"/>
+ <image src="https://maven.apache.org/images/apache-maven-project.png"
alt="${project.artifactId}"/>
</bannerLeft>
<bannerRight href="https://maven.apache.org/">
diff --git
a/maven-archetype-site-simple/src/test/resources/projects/it-basic/reference/src/site/site.xml
b/maven-archetype-site-simple/src/test/resources/projects/it-basic/reference/src/site/site.xml
index ebfaa94..3091ca5 100644
---
a/maven-archetype-site-simple/src/test/resources/projects/it-basic/reference/src/site/site.xml
+++
b/maven-archetype-site-simple/src/test/resources/projects/it-basic/reference/src/site/site.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<site name="${artifactId}" xmlns="http://maven.apache.org/SITE/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<site name="${project.artifactId}" xmlns="http://maven.apache.org/SITE/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SITE/2.1.0
https://maven.apache.org/xsd/site-2.1.0.xsd">
<bannerLeft href="https://www.apache.org/">
- <image src="https://maven.apache.org/images/apache-maven-project.png"
alt="${artifactId}"/>
+ <image src="https://maven.apache.org/images/apache-maven-project.png"
alt="${project.artifactId}"/>
</bannerLeft>
<bannerRight href="https://maven.apache.org/">
diff --git
a/maven-archetype-site-simple/src/test/resources/projects/it-basic/verify.groovy
b/maven-archetype-site-simple/src/test/resources/projects/it-basic/verify.groovy
index 6341590..7dfac27 100644
---
a/maven-archetype-site-simple/src/test/resources/projects/it-basic/verify.groovy
+++
b/maven-archetype-site-simple/src/test/resources/projects/it-basic/verify.groovy
@@ -5,3 +5,6 @@ for (String page in ['index.html', 'markdown.html',
'markdown-velocity.html', 'p
// Velocity reads a Markdown "##" heading as a comment, so the page only keeps
its heading when the template escapes it
String velocity = new File(site, 'markdown-velocity.html').text
assert velocity.contains('<h2>Markdown Format with Velocity works</h2>') :
'the Velocity page lost its heading'
+// the site name comes from the artifactId, not from a literal placeholder
+String title = (new File(site, 'index.html').text =~
/<title>([^<]*)<\/title>/)[0][1]
+assert title.endsWith('basic-site-simple') : 'index.html has title "' + title
+ '"'
diff --git
a/maven-archetype-site/src/main/resources/archetype-resources/src/site/site.xml
b/maven-archetype-site/src/main/resources/archetype-resources/src/site/site.xml
index e208d52..0fa7c3b 100644
---
a/maven-archetype-site/src/main/resources/archetype-resources/src/site/site.xml
+++
b/maven-archetype-site/src/main/resources/archetype-resources/src/site/site.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<site name="${artifactId}"
+<site name="${project.artifactId}"
xmlns="http://maven.apache.org/SITE/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SITE/2.1.0
https://maven.apache.org/xsd/site-2.1.0.xsd">
<bannerLeft href="https://www.apache.org/">
- <image src="https://maven.apache.org/images/apache-maven-project.png"
alt="${artifactId}"/>
+ <image src="https://maven.apache.org/images/apache-maven-project.png"
alt="${project.artifactId}"/>
</bannerLeft>
<bannerRight href="https://maven.apache.org/">
diff --git
a/maven-archetype-site/src/main/resources/archetype-resources/src/site/site_fr.xml
b/maven-archetype-site/src/main/resources/archetype-resources/src/site/site_fr.xml
index 9d2aa81..9c6ff69 100644
---
a/maven-archetype-site/src/main/resources/archetype-resources/src/site/site_fr.xml
+++
b/maven-archetype-site/src/main/resources/archetype-resources/src/site/site_fr.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<site name="${artifactId}"
+<site name="${project.artifactId}"
xmlns="http://maven.apache.org/SITE/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SITE/2.1.0
https://maven.apache.org/xsd/site-2.1.0.xsd">
<bannerLeft href="https://www.apache.org/">
- <image src="https://maven.apache.org/images/apache-maven-project.png"
alt="${artifactId}"/>
+ <image src="https://maven.apache.org/images/apache-maven-project.png"
alt="${project.artifactId}"/>
</bannerLeft>
<bannerRight href="https://maven.apache.org/">
diff --git
a/maven-archetype-site/src/test/resources/projects/it-basic/verify.groovy
b/maven-archetype-site/src/test/resources/projects/it-basic/verify.groovy
index f7b7e6b..52c9b24 100644
--- a/maven-archetype-site/src/test/resources/projects/it-basic/verify.groovy
+++ b/maven-archetype-site/src/test/resources/projects/it-basic/verify.groovy
@@ -1,4 +1,9 @@
// the default locale renders at the root of the site, the additional one
below it
assert new File(context.projectDir, 'target/site/index.html').isFile();
assert new File(context.projectDir, 'target/site/fr').isDirectory();
-assert new File(context.projectDir, 'target/site/fr/index.html').isFile();
\ No newline at end of file
+assert new File(context.projectDir, 'target/site/fr/index.html').isFile();
+// the site name comes from the artifactId, not from a literal placeholder
+for (String page in ['target/site/index.html', 'target/site/fr/index.html']) {
+ String title = (new File(context.projectDir, page).text =~
/<title>([^<]*)<\/title>/)[0][1]
+ assert title.endsWith('basic-site') : page + ' has title "' + title + '"'
+}