You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/10/01 05:43:09 UTC
(maven-plugin-tools) branch agent/deprecate-plugin-tools-api-3x created (now 6ce2f20f)
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a change to branch agent/deprecate-plugin-tools-api-3x
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
at 6ce2f20f Deprecate the Maven 3 types that the plugin tools API exposes
This branch includes the following new commits:
new 6ce2f20f Deprecate the Maven 3 types that the plugin tools API exposes
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(maven-plugin-tools) 01/01: Deprecate the Maven 3 types that the plugin tools API exposes
Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch agent/deprecate-plugin-tools-api-3x
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
commit 6ce2f20ff79641269a3bb11872e7081a39f06c42
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Thu Oct 1 07:34:28 2026 +0200
Deprecate the Maven 3 types that the plugin tools API exposes
---
.../maven/plugin/plugin/HelpGeneratorMojo.java | 2 +-
.../tools/plugin/DefaultPluginToolsRequest.java | 11 +++++++++
.../maven/tools/plugin/PluginToolsRequest.java | 6 +++++
.../plugin/generator/PluginHelpGenerator.java | 27 +++++++++++++++++++---
4 files changed, 42 insertions(+), 4 deletions(-)
diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java
index 00a7f3d6..aabff11d 100644
--- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java
+++ b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java
@@ -111,7 +111,7 @@ public class HelpGeneratorMojo extends AbstractGeneratorMojo {
.setMavenProject(project)
.setHelpPackageName(getHelpPackageName())
.setGoalPrefix(goalPrefix)
- .setVelocityComponent(velocity);
+ .setVelocityEngine(velocity.getEngine());
try {
pluginHelpGenerator.execute(outputDirectory);
diff --git a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/DefaultPluginToolsRequest.java b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/DefaultPluginToolsRequest.java
index 317c354b..f31e4c8a 100644
--- a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/DefaultPluginToolsRequest.java
+++ b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/DefaultPluginToolsRequest.java
@@ -165,11 +165,22 @@ public class DefaultPluginToolsRequest implements PluginToolsRequest {
return this;
}
+ /**
+ * @deprecated There is no replacement on the Maven 3 line (the Maven 4 line uses the Maven API
+ * {@code Session}); this method is removed in the Maven 4 API line.
+ */
@Override
+ @Deprecated
public RepositorySystemSession getRepoSession() {
return repoSession;
}
+ /**
+ * @deprecated There is no replacement on the Maven 3 line (the Maven 4 line uses the Maven API
+ * {@code Session}); this method is removed in the Maven 4 API line.
+ */
+ @Override
+ @Deprecated
public void setRepoSession(RepositorySystemSession repoSession) {
this.repoSession = repoSession;
}
diff --git a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/PluginToolsRequest.java b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/PluginToolsRequest.java
index 14d517c5..7d62da8e 100644
--- a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/PluginToolsRequest.java
+++ b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/PluginToolsRequest.java
@@ -117,7 +117,10 @@ public interface PluginToolsRequest {
*
* @return a Repository Session
* @since 3.8.2
+ * @deprecated There is no replacement on the Maven 3 line (the Maven 4 line uses the Maven API
+ * {@code Session}); this method is removed in the Maven 4 API line.
*/
+ @Deprecated
RepositorySystemSession getRepoSession();
/**
@@ -125,7 +128,10 @@ public interface PluginToolsRequest {
*
* @param repoSession a Repository Session
* @since 3.8.2
+ * @deprecated There is no replacement on the Maven 3 line (the Maven 4 line uses the Maven API
+ * {@code Session}); this method is removed in the Maven 4 API line.
*/
+ @Deprecated
void setRepoSession(RepositorySystemSession repoSession);
/**
diff --git a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java
index 9dd77612..bb6664f4 100644
--- a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java
+++ b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java
@@ -28,6 +28,7 @@ import java.io.Writer;
import org.apache.maven.project.MavenProject;
import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
import org.codehaus.plexus.util.io.CachingOutputStream;
import org.codehaus.plexus.velocity.VelocityComponent;
@@ -51,7 +52,7 @@ public class PluginHelpGenerator {
private String goalPrefix;
private MavenProject mavenProject;
private boolean useMaven4Api;
- private VelocityComponent velocityComponent;
+ private VelocityEngine velocityEngine;
/**
* Default constructor
@@ -92,8 +93,28 @@ public class PluginHelpGenerator {
return this;
}
+ /**
+ * Sets the Velocity engine used to render the help class sources.
+ *
+ * @param velocityEngine the engine
+ * @return this generator
+ * @since 3.17.0
+ */
+ public PluginHelpGenerator setVelocityEngine(VelocityEngine velocityEngine) {
+ this.velocityEngine = velocityEngine;
+ return this;
+ }
+
+ /**
+ * Sets the Velocity component whose engine is used to render the help class sources.
+ *
+ * @param velocityComponent the component
+ * @return this generator
+ * @deprecated Use {@link #setVelocityEngine(VelocityEngine)}; this method is removed in the Maven 4 API line.
+ */
+ @Deprecated
public PluginHelpGenerator setVelocityComponent(VelocityComponent velocityComponent) {
- this.velocityComponent = velocityComponent;
+ this.velocityEngine = velocityComponent.getEngine();
return this;
}
@@ -131,7 +152,7 @@ public class PluginHelpGenerator {
.getResourceAsStream(useMaven4Api ? "help-class-source-v4.vm" : "help-class-source.vm"); //
InputStreamReader isReader = new InputStreamReader(is, UTF_8)) {
// isReader =
- velocityComponent.getEngine().evaluate(context, stringWriter, "", isReader);
+ velocityEngine.evaluate(context, stringWriter, "", isReader);
}
// Apply OS lineSeparator instead of template's lineSeparator to have consistent separators for
// all source files.