diff --git a/api/maven-api-model/pom.xml b/api/maven-api-model/pom.xml
index e141aac08bee..87d80b4cb1fa 100644
--- a/api/maven-api-model/pom.xml
+++ b/api/maven-api-model/pom.xml
@@ -63,26 +63,26 @@ under the License.
- org.apache.maven
- modello-plugin-velocity
-
- 4.2.0
-
- src/main/mdo/maven.mdo
-
-
- src/main/mdo/model.vm
-
-
- packageModelV4=org.apache.maven.api.model
-
-
+ org.codehaus.modello
+ modello-maven-plugin
- modello
+ velocity
velocity
+
+ 4.2.0
+
+ src/main/mdo/maven.mdo
+
+
+ src/main/mdo/model.vm
+
+
+ packageModelV4=org.apache.maven.api.model
+
+
diff --git a/api/maven-api-model/src/main/mdo/model.vm b/api/maven-api-model/src/main/mdo/model.vm
index 60f013dc1f37..aca095aa6b21 100644
--- a/api/maven-api-model/src/main/mdo/model.vm
+++ b/api/maven-api-model/src/main/mdo/model.vm
@@ -31,7 +31,7 @@
#set ( $dummy = $allFields.addAll( $cl.getFields($version) ) )
#end
#set ( $className = "${class.name}" )
-#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java
+#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java
#if ( $class.name != "InputLocation" && $class.name != "InputSource" )
#set ( $types = { } )
#set ( $imports = $class.getClass().forName("java.util.TreeSet").newInstance() )
@@ -85,7 +85,7 @@
#end
#end
// =================== DO NOT EDIT THIS FILE ====================
-// Generated by Maven, any modifications will be overwritten.
+// ${generatedBy}
// ==============================================================
package ${package};
diff --git a/api/maven-api-settings/pom.xml b/api/maven-api-settings/pom.xml
index 843274f0edee..ae75044a5dd1 100644
--- a/api/maven-api-settings/pom.xml
+++ b/api/maven-api-settings/pom.xml
@@ -63,26 +63,26 @@ under the License.
- org.apache.maven
- modello-plugin-velocity
-
- 2.0.0
-
- src/main/mdo/settings.mdo
-
-
- src/main/mdo/model.vm
-
-
- packageModelV4=org.apache.maven.api.settings
-
-
+ org.codehaus.modello
+ modello-maven-plugin
- modello
+ velocity
velocity
+
+ 2.0.0
+
+ src/main/mdo/settings.mdo
+
+
+ src/main/mdo/model.vm
+
+
+ packageModelV4=org.apache.maven.api.settings
+
+
diff --git a/api/maven-api-settings/src/main/mdo/model.vm b/api/maven-api-settings/src/main/mdo/model.vm
index 60f013dc1f37..aca095aa6b21 100644
--- a/api/maven-api-settings/src/main/mdo/model.vm
+++ b/api/maven-api-settings/src/main/mdo/model.vm
@@ -31,7 +31,7 @@
#set ( $dummy = $allFields.addAll( $cl.getFields($version) ) )
#end
#set ( $className = "${class.name}" )
-#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java
+#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java
#if ( $class.name != "InputLocation" && $class.name != "InputSource" )
#set ( $types = { } )
#set ( $imports = $class.getClass().forName("java.util.TreeSet").newInstance() )
@@ -85,7 +85,7 @@
#end
#end
// =================== DO NOT EDIT THIS FILE ====================
-// Generated by Maven, any modifications will be overwritten.
+// ${generatedBy}
// ==============================================================
package ${package};
diff --git a/api/maven-api-toolchain/pom.xml b/api/maven-api-toolchain/pom.xml
index 20024cb8a43b..ea734f5dc1ca 100644
--- a/api/maven-api-toolchain/pom.xml
+++ b/api/maven-api-toolchain/pom.xml
@@ -62,26 +62,26 @@ under the License.
- org.apache.maven
- modello-plugin-velocity
-
- 1.1.0
-
- src/main/mdo/toolchains.mdo
-
-
- src/main/mdo/model.vm
-
-
- packageModelV4=org.apache.maven.api.toolchain
-
-
+ org.codehaus.modello
+ modello-maven-plugin
- modello
+ velocity
velocity
+
+ 1.1.0
+
+ src/main/mdo/toolchains.mdo
+
+
+ src/main/mdo/model.vm
+
+
+ packageModelV4=org.apache.maven.api.toolchain
+
+
diff --git a/api/maven-api-toolchain/src/main/mdo/model.vm b/api/maven-api-toolchain/src/main/mdo/model.vm
index 60f013dc1f37..aca095aa6b21 100644
--- a/api/maven-api-toolchain/src/main/mdo/model.vm
+++ b/api/maven-api-toolchain/src/main/mdo/model.vm
@@ -31,7 +31,7 @@
#set ( $dummy = $allFields.addAll( $cl.getFields($version) ) )
#end
#set ( $className = "${class.name}" )
-#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java
+#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java
#if ( $class.name != "InputLocation" && $class.name != "InputSource" )
#set ( $types = { } )
#set ( $imports = $class.getClass().forName("java.util.TreeSet").newInstance() )
@@ -85,7 +85,7 @@
#end
#end
// =================== DO NOT EDIT THIS FILE ====================
-// Generated by Maven, any modifications will be overwritten.
+// ${generatedBy}
// ==============================================================
package ${package};
diff --git a/api/modello-plugin-velocity/pom.xml b/api/modello-plugin-velocity/pom.xml
deleted file mode 100644
index d363ee1e4b70..000000000000
--- a/api/modello-plugin-velocity/pom.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
- 4.0.0
-
-
- org.apache.maven
- maven-api
- 4.0.0-alpha-4-SNAPSHOT
-
-
- modello-plugin-velocity
- maven-plugin
- Modello Velocity Plugin
- Modello Velocity Plugin generates custom templates.
-
-
-
- org.codehaus.plexus
- plexus-utils
- 3.4.2
-
-
- org.apache.maven.plugin-tools
- maven-plugin-annotations
- 3.6.4
- provided
-
-
- org.apache.maven
- maven-plugin-api
- 3.8.6
- provided
-
-
- *
- *
-
-
-
-
- org.apache.maven
- maven-core
- 3.8.6
- provided
-
-
- *
- *
-
-
-
-
- org.codehaus.modello
- modello-maven-plugin
- 2.0.0
-
-
- org.apache.velocity
- velocity-engine-core
- 2.3
-
-
- org.codehaus.modello
- modello-core
- 2.0.0
-
-
- org.codehaus.modello
- modello-plugin-xml
- 2.0.0
-
-
-
-
diff --git a/api/modello-plugin-velocity/src/main/java/org/codehaus/modello/plugin/velocity/Helper.java b/api/modello-plugin-velocity/src/main/java/org/codehaus/modello/plugin/velocity/Helper.java
deleted file mode 100644
index 39e04e59b903..000000000000
--- a/api/modello-plugin-velocity/src/main/java/org/codehaus/modello/plugin/velocity/Helper.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * 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.
- */
-package org.codehaus.modello.plugin.velocity;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.codehaus.modello.ModelloRuntimeException;
-import org.codehaus.modello.model.ModelAssociation;
-import org.codehaus.modello.model.ModelClass;
-import org.codehaus.modello.model.ModelField;
-import org.codehaus.modello.model.Version;
-import org.codehaus.modello.plugin.AbstractModelloGenerator;
-import org.codehaus.modello.plugins.xml.metadata.XmlAssociationMetadata;
-import org.codehaus.modello.plugins.xml.metadata.XmlClassMetadata;
-import org.codehaus.modello.plugins.xml.metadata.XmlFieldMetadata;
-import org.codehaus.plexus.util.StringUtils;
-
-@SuppressWarnings("unused")
-public class Helper {
- private final Version version;
-
- public Helper(Version version) {
- this.version = version;
- }
-
- public String capitalise(String str) {
- return StringUtils.isEmpty(str) ? str : Character.toTitleCase(str.charAt(0)) + str.substring(1);
- }
-
- public String uncapitalise(String str) {
- return StringUtils.isEmpty(str) ? str : Character.toLowerCase(str.charAt(0)) + str.substring(1);
- }
-
- public String singular(String str) {
- return AbstractModelloGenerator.singular(str);
- }
-
- public List ancestors(ModelClass clazz) {
- List ancestors = new ArrayList<>();
- for (ModelClass cl = clazz;
- cl != null;
- cl = cl.getSuperClass() != null ? cl.getModel().getClass(cl.getSuperClass(), version) : null) {
- ancestors.add(0, cl);
- }
- return ancestors;
- }
-
- public XmlClassMetadata xmlClassMetadata(ModelClass clazz) {
- return (XmlClassMetadata) clazz.getMetadata(XmlClassMetadata.ID);
- }
-
- public XmlFieldMetadata xmlFieldMetadata(ModelField field) {
- return (XmlFieldMetadata) field.getMetadata(XmlFieldMetadata.ID);
- }
-
- public XmlAssociationMetadata xmAssociationMetadata(ModelField field) {
- return (XmlAssociationMetadata) ((ModelAssociation) field).getAssociationMetadata(XmlAssociationMetadata.ID);
- }
-
- public boolean isFlatItems(ModelField field) {
- return field instanceof ModelAssociation && xmAssociationMetadata(field).isFlatItems();
- }
-
- public List xmlFields(ModelClass modelClass) {
- List classes = new ArrayList<>();
- // get the full inheritance
- while (modelClass != null) {
- classes.add(modelClass);
- String superClass = modelClass.getSuperClass();
- if (superClass != null) {
- // superClass can be located outside (not generated by modello)
- modelClass = modelClass.getModel().getClass(superClass, version, true);
- } else {
- modelClass = null;
- }
- }
- List fields = new ArrayList<>();
- for (int i = classes.size() - 1; i >= 0; i--) {
- modelClass = classes.get(i);
- Iterator parentIter = fields.iterator();
- fields = new ArrayList<>();
- for (ModelField field : modelClass.getFields(version)) {
- XmlFieldMetadata xmlFieldMetadata = (XmlFieldMetadata) field.getMetadata(XmlFieldMetadata.ID);
- if (xmlFieldMetadata.isTransient()) {
- // just ignore xml.transient fields
- continue;
- }
- if (xmlFieldMetadata.getInsertParentFieldsUpTo() != null) {
- // insert fields from parent up to the specified field
- boolean found = false;
- while (!found && parentIter.hasNext()) {
- ModelField parentField = parentIter.next();
- fields.add(parentField);
- found = parentField.getName().equals(xmlFieldMetadata.getInsertParentFieldsUpTo());
- }
- if (!found) {
- // interParentFieldsUpTo not found
- throw new ModelloRuntimeException("parent field not found: class "
- + modelClass.getName() + " xml.insertParentFieldUpTo='"
- + xmlFieldMetadata.getInsertParentFieldsUpTo() + "'");
- }
- }
- fields.add(field);
- }
- // add every remaining fields from parent class
- while (parentIter.hasNext()) {
- fields.add(parentIter.next());
- }
- }
- return fields;
- }
-}
diff --git a/api/modello-plugin-velocity/src/main/java/org/codehaus/modello/plugin/velocity/ModelloVelocityMojo.java b/api/modello-plugin-velocity/src/main/java/org/codehaus/modello/plugin/velocity/ModelloVelocityMojo.java
deleted file mode 100644
index 2298252fe32a..000000000000
--- a/api/modello-plugin-velocity/src/main/java/org/codehaus/modello/plugin/velocity/ModelloVelocityMojo.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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.
- */
-package org.codehaus.modello.plugin.velocity;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Properties;
-import java.util.stream.Collectors;
-
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-import org.codehaus.modello.maven.AbstractModelloGeneratorMojo;
-
-/**
- * Creates an XML schema from the model.
- *
- * @author Brett Porter
- */
-@Mojo(name = "velocity", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true)
-public class ModelloVelocityMojo extends AbstractModelloGeneratorMojo {
- /**
- * The output directory of the generated XML Schema.
- */
- @Parameter(defaultValue = "${project.build.directory}/generated-sources/modello", required = true)
- private File outputDirectory;
-
- @Parameter
- private List templates;
-
- @Parameter
- private List params;
-
- protected String getGeneratorType() {
- return "velocity";
- }
-
- protected void customizeParameters(Properties parameters) {
- super.customizeParameters(parameters);
- Map params = this.params != null
- ? this.params.stream()
- .collect(Collectors.toMap(
- s -> s.substring(0, s.indexOf('=')), s -> s.substring(s.indexOf('=') + 1)))
- : Collections.emptyMap();
- parameters.put("basedir", Objects.requireNonNull(getBasedir(), "basedir is null"));
- parameters.put(VelocityGenerator.VELOCITY_TEMPLATES, String.join(",", templates));
- parameters.put(VelocityGenerator.VELOCITY_PARAMETERS, params);
- }
-
- protected boolean producesCompilableResult() {
- return true;
- }
-
- public File getOutputDirectory() {
- return outputDirectory;
- }
-
- public void setOutputDirectory(File outputDirectory) {
- this.outputDirectory = outputDirectory;
- }
-}
diff --git a/api/modello-plugin-velocity/src/main/java/org/codehaus/modello/plugin/velocity/VelocityGenerator.java b/api/modello-plugin-velocity/src/main/java/org/codehaus/modello/plugin/velocity/VelocityGenerator.java
deleted file mode 100644
index 132a77a3bac5..000000000000
--- a/api/modello-plugin-velocity/src/main/java/org/codehaus/modello/plugin/velocity/VelocityGenerator.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * 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.
- */
-package org.codehaus.modello.plugin.velocity;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Properties;
-
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.runtime.RuntimeInstance;
-import org.codehaus.modello.ModelloException;
-import org.codehaus.modello.ModelloParameterConstants;
-import org.codehaus.modello.model.Model;
-import org.codehaus.modello.model.Version;
-import org.codehaus.modello.plugin.AbstractModelloGenerator;
-import org.codehaus.plexus.util.io.CachingWriter;
-
-public class VelocityGenerator extends AbstractModelloGenerator {
- public static final String VELOCITY_TEMPLATES = "modello.velocity.template";
-
- public static final String VELOCITY_PARAMETERS = "modello.velocity.parameters";
-
- @Override
- public void generate(Model model, Properties parameters) throws ModelloException {
- try {
- Map params = (Map) Objects.requireNonNull(parameters.get(VELOCITY_PARAMETERS));
- String templates = getParameter(parameters, VELOCITY_TEMPLATES);
- String output = getParameter(parameters, ModelloParameterConstants.OUTPUT_DIRECTORY);
-
- Properties props = new Properties();
- props.put("resource.loader.file.path", getParameter(parameters, "basedir"));
- RuntimeInstance velocity = new RuntimeInstance();
- velocity.init(props);
-
- VelocityContext context = new VelocityContext();
- for (Map.Entry