From 776caedd67f4f4833d93f5272c56011f677a49c7 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Thu, 6 Aug 2026 19:44:55 +0200 Subject: [PATCH 1/2] Rename the site documents ahead of converting them A pure rename, so that git records it and `git log --follow` and `git blame` still reach the history of each page after the conversion that follows. The content is still APT at this point and the site does not build between the two commits. --- src/site/{apt/index.apt.vm => markdown/index.md.vm} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/site/{apt/index.apt.vm => markdown/index.md.vm} (100%) diff --git a/src/site/apt/index.apt.vm b/src/site/markdown/index.md.vm similarity index 100% rename from src/site/apt/index.apt.vm rename to src/site/markdown/index.md.vm From 8cff57194ab72c739d10ce1f49465ffbcc839132 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Thu, 6 Aug 2026 19:44:55 +0200 Subject: [PATCH 2/2] Port the index page from APT to Markdown Converted with doxia-converter and then cleaned up by hand: - <<>> becomes backticks, <> becomes **bold**, {{{url}text}} becomes [text](url) - the ASF license header becomes a single block HTML comment - the page keeps a Velocity reference, so it stays a .vm. Velocity reads ## as a line comment and would silently swallow every ATX heading below level one, so subsections use setext underlines and anything deeper is wrapped in #[[ ... ]]# Verified by building the site before and after: the rendered page is unchanged apart from / becoming / and quotes in prose picking up the Markdown module's typographic substitution. --- src/site/markdown/index.md.vm | 147 ++++++++++++++++------------------ 1 file changed, 68 insertions(+), 79 deletions(-) diff --git a/src/site/markdown/index.md.vm b/src/site/markdown/index.md.vm index c3d61f2..6b57eec 100644 --- a/src/site/markdown/index.md.vm +++ b/src/site/markdown/index.md.vm @@ -1,145 +1,134 @@ - ------ - Introduction - ------ - Olivier Lamy - ------ - 2013-07-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. - - ~~ NOTE: For help with the syntax of this file, see: - ~~ http://maven.apache.org/doxia/references/apt-format.html - -${project.name} - - This component provides some utilities to interpret/execute some scripts for various implementations: groovy or beanshell. - -* Dependency declaration - -+--------- + + +# ${project.name} + +This component provides some utilities to interpret/execute some scripts for various implementations: groovy or beanshell. + +Dependency declaration +---------------------- + +```unknown org.apache.maven.shared maven-script-interpreter ${project.version} -+--------- +``` - <<>> has dependency only to core interpreters library, - all specific extensions should be added in your project. +`maven-script-interpreter` has dependency only to core interpreters library, all specific extensions should be added in your project. - For example, if you want to use {{{https://docs.groovy-lang.org/latest/html/documentation/grape.html}<>}} - in a <> script, you must add a dependency to Ivy in your project or in the plugin that will invoke the script: +For example, if you want to use [**Grape**](https://docs.groovy-lang.org/latest/html/documentation/grape.html) in a **Groovy** script, you must add a dependency to Ivy in your project or in the plugin that will invoke the script: -+--------- +```unknown org.apache.ivy ivy ... -+--------- +``` -* Using ScriptRunner +Using ScriptRunner +------------------ - <<>> class will detect the script file to run based on supported extensions (<<<.bsh>>>, <<<.groovy>>>). +`ScriptRunner` class will detect the script file to run based on supported extensions (`.bsh`, `.groovy`). - This class will search in the provided directory the script with the provided fileName and the supported extensions. +This class will search in the provided directory the script with the provided fileName and the supported extensions. - See {{{./apidocs/org/apache/maven/shared/scriptinterpreter/ScriptRunner.html}javadoc}} for <<>> methods. +See [javadoc](./apidocs/org/apache/maven/shared/scriptinterpreter/ScriptRunner.html) for `run(...)` methods. -+--------- +```unknown try (ScriptRunner scriptRunner = new ScriptRunner()) { scriptRunner.run("test", new File("src/test/resources/bsh-test"), "verify", buildContext(), new FileLogger(logFile)); } -+--------- +``` -* Mirror output from script interpreter +Mirror output from script interpreter +------------------------------------- - In order to do something more with script output, eg. log by your application you must implement <<>> +In order to do something more with script output, eg. log by your application you must implement `FileLoggerMirrorHandler` -+--------- +```unknown class MyMirrorHandler implements FileLoggerMirrorHandler { void consumeOutput(String message) { // this method is invoked every time when flush occurs on the underlying stream. } } -+--------- +``` - Now use it: +Now use it: -+--------- +```unknown try (ScriptRunner scriptRunner = new ScriptRunner()) { scriptRunner.run("test", new File("src/test/resources/bsh-test"), "verify", buildContext(), new FileLogger(logFile, new MyMirrorHandler())); } -+--------- - -** Global variables - - Your scripts will have by default two global variables: +``` - * <<>>: the base directory of your script +#[[### Global variables]]# - * <<>>: the build context (see below) +Your scripts will have by default two global variables: - [] +- `basedir`: the base directory of your script +- `context`: the build context (see below) - You can add more global variables as it. +You can add more global variables as it. -+--------- +```unknown try (ScriptRunner scriptRunner = new ScriptRunner()) { scriptRunner.setGlobalVariable( name, value ); ... } -+--------- +``` -** Build context +#[[### Build context]]# - You can pass some values to your script using an execution context which have the type << context>>>: +You can pass some values to your script using an execution context which have the type `Map context`: -+--------- +```unknown private Map buildContext() { Map context = new HashMap(); context.put("foo", "bar"); return context; } -+--------- +``` - Then values are available in scripts context: +Then values are available in scripts context: -+--------- +```unknown // in your bsh script String value = context.get( "foo" ); -+--------- +``` - value will be "bar" +value will be "bar" -+--------- +```unknown // in your Groovy script context.get("foo") -+--------- +``` -** Additional classpath entries +#[[### Additional classpath entries]]# - You can add some additional classpath entries for your script execution +You can add some additional classpath entries for your script execution -+--------- +```unknown List classpathEntries = list of jar paths try (ScriptRunner scriptRunner = new ScriptRunner()) { @@ -147,4 +136,4 @@ try (ScriptRunner scriptRunner = new ScriptRunner()) { scriptRunner.run("test", new File("src/test/resources/bsh-test"), "verify", buildContext(), new FileLogger(logFile)); } -+--------- +```