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 - - - - - - packageModelV4=org.apache.maven.api.model - - + org.codehaus.modello + modello-maven-plugin - modello + velocity velocity + + 4.2.0 + + src/main/mdo/maven.mdo + + + + + + 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 - - - - - - packageModelV4=org.apache.maven.api.settings - - + org.codehaus.modello + modello-maven-plugin - modello + velocity velocity + + 2.0.0 + + src/main/mdo/settings.mdo + + + + + + 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 - - - - - - packageModelV4=org.apache.maven.api.toolchain - - + org.codehaus.modello + modello-maven-plugin - modello + velocity velocity + + 1.1.0 + + src/main/mdo/toolchains.mdo + + + + + + 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 prop : parameters.entrySet()) { - context.put(prop.getKey().toString(), prop.getValue()); - } - for (Map.Entry prop : params.entrySet()) { - context.put(prop.getKey(), prop.getValue()); - } - Version version = new Version(getParameter(parameters, ModelloParameterConstants.VERSION)); - context.put("version", version); - context.put("model", model); - context.put("Helper", new Helper(version)); - - for (String templatePath : templates.split(",")) { - Template template = velocity.getTemplate(templatePath); - - try (Writer w = new RedirectingWriter(Paths.get(output))) { - template.merge(context, w); - } - } - } catch (Exception e) { - throw new ModelloException("Unable to run velocity template", e); - } - } - - static class RedirectingWriter extends Writer { - Path dir; - StringBuilder sb = new StringBuilder(); - Writer current; - - RedirectingWriter(Path dir) { - this.dir = dir; - } - - @Override - public void write(char[] cbuf, int off, int len) throws IOException { - for (int i = 0; i < len; i++) { - if (cbuf[off + i] == '\n') { - if (sb.length() > 0 && sb.charAt(sb.length() - 1) == '\r') { - sb.setLength(sb.length() - 1); - } - writeLine(sb.toString()); - sb.setLength(0); - } else { - sb.append(cbuf[off + i]); - } - } - } - - protected void writeLine(String line) throws IOException { - if (line.startsWith("#MODELLO-VELOCITY#REDIRECT ")) { - String file = line.substring("#MODELLO-VELOCITY#REDIRECT ".length()); - if (current != null) { - current.close(); - } - Path out = dir.resolve(file); - Files.createDirectories(out.getParent()); - current = new CachingWriter(out, StandardCharsets.UTF_8); - } else if (current != null) { - current.write(line); - current.write("\n"); - } - } - - @Override - public void flush() throws IOException { - if (current != null) { - current.flush(); - } - } - - @Override - public void close() throws IOException { - if (current != null) { - current.close(); - current = null; - } - } - } -} diff --git a/api/modello-plugin-velocity/src/main/resources/META-INF/plexus/components.xml b/api/modello-plugin-velocity/src/main/resources/META-INF/plexus/components.xml deleted file mode 100644 index ed745b2fc461..000000000000 --- a/api/modello-plugin-velocity/src/main/resources/META-INF/plexus/components.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - org.codehaus.modello.plugin.ModelloGenerator - velocity - org.codehaus.modello.plugin.velocity.VelocityGenerator - per-lookup - - - diff --git a/api/pom.xml b/api/pom.xml index d425fee166d0..e4076ff799fb 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -32,7 +32,6 @@ A new immutable API for Maven 4 to better manage what plugins and extensions can influence. - modello-plugin-velocity maven-api-meta maven-api-xml maven-api-model @@ -45,6 +44,27 @@ api + + + + + org.codehaus.modello + modello-maven-plugin + + + modello-site-docs + + xdoc + xsd + + none + + + + + + + reporting diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml index c983778c9849..3e29cd07e4b1 100644 --- a/maven-compat/pom.xml +++ b/maven-compat/pom.xml @@ -144,6 +144,16 @@ under the License. src/main/mdo/paramdoc.mdo + + + modello + + java + xpp3-reader + xpp3-writer + + + diff --git a/maven-compat/src/main/mdo/profiles.mdo b/maven-compat/src/main/mdo/profiles.mdo index e3e102991fa2..2843e806e1f6 100644 --- a/maven-compat/src/main/mdo/profiles.mdo +++ b/maven-compat/src/main/mdo/profiles.mdo @@ -24,8 +24,8 @@ under the License. profiles Profiles Deprecated in Maven 2 Project-local overrides to the build process based on detected or user-provided environmental parameters. + This is the model specification for ${basedir}/profiles.xml. ]]> diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index a6aaee43efa3..1a768672a783 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -186,6 +186,16 @@ under the License. src/main/mdo/core-extensions.mdo + + + modello + + java + xpp3-reader + xpp3-writer + + + diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 7b7bf1379163..8fbd8317be57 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -49,10 +49,9 @@ under the License. org.apache.maven.plugins maven-dependency-plugin - 3.2.0 - copy-model + copy-maven.mdo copy @@ -73,41 +72,49 @@ under the License. - org.apache.maven - modello-plugin-velocity + org.codehaus.modello + modello-maven-plugin + + 4.0.0 + + target/mdo/maven.mdo + + + packageModelV3=org.apache.maven.model + packageModelV4=org.apache.maven.api.model + packageToolV4=org.apache.maven.model.v4 + + - velocity-v3 + modello-site-docs + + xdoc + xsd + + pre-site + + + model-v3 velocity generate-sources 4.1.0 - - target/mdo/maven.mdo - - - packageModelV3=org.apache.maven.model - packageModelV4=org.apache.maven.api.model - packageToolV4=org.apache.maven.model.v4 - - velocity-v4 + model-v4 velocity generate-sources 4.2.0 - - target/mdo/maven.mdo - @@ -116,39 +123,10 @@ under the License. - - packageModelV3=org.apache.maven.model - packageModelV4=org.apache.maven.api.model - packageToolV4=org.apache.maven.model.v4 - - - org.codehaus.modello - modello-maven-plugin - - 4.0.0 - - target/mdo/maven.mdo - - - - - modello-site-docs - - xdoc - xsd - - pre-site - - - modello - none - - - org.apache.maven.plugins maven-compiler-plugin diff --git a/maven-model/src/main/mdo/merger.vm b/maven-model/src/main/mdo/merger.vm index 1394323f2a5f..34e555145f72 100644 --- a/maven-model/src/main/mdo/merger.vm +++ b/maven-model/src/main/mdo/merger.vm @@ -23,9 +23,9 @@ # #set ( $root = $model.getClass( $model.getRoot($version), $version ) ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-model/src/main/mdo/model-v3.vm b/maven-model/src/main/mdo/model-v3.vm index e91bddbbe6c5..6ded8683b5c2 100644 --- a/maven-model/src/main/mdo/model-v3.vm +++ b/maven-model/src/main/mdo/model-v3.vm @@ -33,7 +33,7 @@ #set ( $dummy = $allFields.addAll( $cl.allFields ) ) #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() ) @@ -83,7 +83,7 @@ #end #end // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-model/src/main/mdo/reader-ex.vm b/maven-model/src/main/mdo/reader-ex.vm index af64eb727d25..3d7d3e16fe45 100644 --- a/maven-model/src/main/mdo/reader-ex.vm +++ b/maven-model/src/main/mdo/reader-ex.vm @@ -27,9 +27,9 @@ #set ( $rootUcapName = $Helper.capitalise( $root.name ) ) #set ( $rootLcapName = $Helper.uncapitalise( $root.name ) ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-model/src/main/mdo/reader.vm b/maven-model/src/main/mdo/reader.vm index 00069cf61fbe..b1a65566a669 100644 --- a/maven-model/src/main/mdo/reader.vm +++ b/maven-model/src/main/mdo/reader.vm @@ -27,9 +27,9 @@ #set ( $rootUcapName = $Helper.capitalise( $root.name ) ) #set ( $rootLcapName = $Helper.uncapitalise( $root.name ) ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-model/src/main/mdo/transformer.vm b/maven-model/src/main/mdo/transformer.vm index 0326818643f4..fbb64b906d73 100644 --- a/maven-model/src/main/mdo/transformer.vm +++ b/maven-model/src/main/mdo/transformer.vm @@ -21,9 +21,9 @@ #set ( $package = "${packageToolV4}" ) #set ( $className = "${model.name}Transformer" ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-model/src/main/mdo/writer-ex.vm b/maven-model/src/main/mdo/writer-ex.vm index 1943287ddfba..087091c0d503 100644 --- a/maven-model/src/main/mdo/writer-ex.vm +++ b/maven-model/src/main/mdo/writer-ex.vm @@ -27,9 +27,9 @@ #set ( $rootUcapName = $Helper.capitalise( $root.name ) ) #set ( $rootLcapName = $Helper.uncapitalise( $root.name ) ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-model/src/main/mdo/writer.vm b/maven-model/src/main/mdo/writer.vm index 75dfe0c58a63..fa9905aa5fbb 100644 --- a/maven-model/src/main/mdo/writer.vm +++ b/maven-model/src/main/mdo/writer.vm @@ -27,9 +27,9 @@ #set ( $rootUcapName = $Helper.capitalise( $root.name ) ) #set ( $rootLcapName = $Helper.uncapitalise( $root.name ) ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-model/src/site/apt/index.apt b/maven-model/src/site/apt/index.apt index f4fa8023665b..680358f0e0fe 100644 --- a/maven-model/src/site/apt/index.apt +++ b/maven-model/src/site/apt/index.apt @@ -28,7 +28,7 @@ Maven Model This is strictly the model for Maven POM (Project Object Model) in <<>> package, - delegating content to {{{../maven-api/maven-api-model/index.html}Maven 4 API immutable model}}. All the effective model + delegating content to {{{../api/maven-api-model/index.html}Maven 4 API immutable model}}. All the effective model building logic from multiple POMs and building context is done in {{{../maven-model-builder/}Maven Model Builder}}. The following are generated from this model: diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml index 3735068b8676..1294bcb7c7e1 100644 --- a/maven-plugin-api/pom.xml +++ b/maven-plugin-api/pom.xml @@ -59,33 +59,12 @@ under the License. org.codehaus.modello modello-maven-plugin - 2.0.0 src/main/mdo/lifecycle.mdo 1.0.0 - - - modello - none - - - modello-site-docs - pre-site - - - src/main/mdo/plugin.mdo - - 1.1.0 - - - - - - org.apache.maven - modello-plugin-velocity velocity @@ -94,10 +73,6 @@ under the License. generate-sources - 1.0.0 - - src/main/mdo/lifecycle.mdo - @@ -110,6 +85,19 @@ under the License. + + modello-site-docs2 + + xdoc + + pre-site + + + src/main/mdo/plugin.mdo + + 1.1.0 + + diff --git a/maven-plugin-api/src/main/mdo/merger.vm b/maven-plugin-api/src/main/mdo/merger.vm index e81c3baab302..f302247f4031 100644 --- a/maven-plugin-api/src/main/mdo/merger.vm +++ b/maven-plugin-api/src/main/mdo/merger.vm @@ -23,9 +23,9 @@ # #set ( $root = $model.getClass( $model.getRoot($version), $version ) ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-plugin-api/src/main/mdo/model.vm b/maven-plugin-api/src/main/mdo/model.vm index e995fa6e9478..783d4eafa186 100644 --- a/maven-plugin-api/src/main/mdo/model.vm +++ b/maven-plugin-api/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() ) @@ -81,7 +81,7 @@ #end #end // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-plugin-api/src/main/mdo/reader.vm b/maven-plugin-api/src/main/mdo/reader.vm index a575b6534b94..7c4229b560b6 100644 --- a/maven-plugin-api/src/main/mdo/reader.vm +++ b/maven-plugin-api/src/main/mdo/reader.vm @@ -27,9 +27,9 @@ #set ( $rootUcapName = $Helper.capitalise( $root.name ) ) #set ( $rootLcapName = $Helper.uncapitalise( $root.name ) ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-plugin-api/src/main/mdo/writer.vm b/maven-plugin-api/src/main/mdo/writer.vm index b1bc5edde7c0..05cd813d6e83 100644 --- a/maven-plugin-api/src/main/mdo/writer.vm +++ b/maven-plugin-api/src/main/mdo/writer.vm @@ -27,9 +27,9 @@ #set ( $rootUcapName = $Helper.capitalise( $root.name ) ) #set ( $rootLcapName = $Helper.uncapitalise( $root.name ) ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml index 8ebec9710e24..26d7749cb41b 100644 --- a/maven-repository-metadata/pom.xml +++ b/maven-repository-metadata/pom.xml @@ -54,6 +54,16 @@ under the License. src/main/mdo/metadata.mdo + + + modello + + java + xpp3-reader + xpp3-writer + + + diff --git a/maven-repository-metadata/src/site/site.xml b/maven-repository-metadata/src/site/site.xml index be08a3317f30..8ffe43d07c30 100644 --- a/maven-repository-metadata/src/site/site.xml +++ b/maven-repository-metadata/src/site/site.xml @@ -28,7 +28,7 @@ under the License. - + diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml index 8b77d69b7c08..ee70516934cc 100644 --- a/maven-settings/pom.xml +++ b/maven-settings/pom.xml @@ -53,10 +53,9 @@ under the License. org.apache.maven.plugins maven-dependency-plugin - 3.2.0 - copy-model + copy-settings.mdo copy @@ -77,8 +76,14 @@ under the License. - org.apache.maven - modello-plugin-velocity + org.codehaus.modello + modello-maven-plugin + + 2.0.0 + + target/mdo/settings.mdo + + velocity @@ -87,10 +92,6 @@ under the License. generate-sources - 4.0.0 - - target/mdo/settings.mdo - diff --git a/maven-settings/src/main/mdo/merger.vm b/maven-settings/src/main/mdo/merger.vm index 407ca863843a..6b76051849dd 100644 --- a/maven-settings/src/main/mdo/merger.vm +++ b/maven-settings/src/main/mdo/merger.vm @@ -23,9 +23,9 @@ # #set ( $root = $model.getClass( $model.getRoot($version), $version ) ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-settings/src/main/mdo/model-v3.vm b/maven-settings/src/main/mdo/model-v3.vm index 0271ae33bc17..9e06cff9ba59 100644 --- a/maven-settings/src/main/mdo/model-v3.vm +++ b/maven-settings/src/main/mdo/model-v3.vm @@ -33,7 +33,7 @@ #set ( $dummy = $allFields.addAll( $cl.allFields ) ) #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() ) @@ -82,7 +82,7 @@ #end #end // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-settings/src/main/mdo/reader.vm b/maven-settings/src/main/mdo/reader.vm index 91c17e584a64..feae630a9da5 100644 --- a/maven-settings/src/main/mdo/reader.vm +++ b/maven-settings/src/main/mdo/reader.vm @@ -27,9 +27,9 @@ #set ( $rootUcapName = $Helper.capitalise( $root.name ) ) #set ( $rootLcapName = $Helper.uncapitalise( $root.name ) ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-settings/src/main/mdo/writer.vm b/maven-settings/src/main/mdo/writer.vm index 75dfe0c58a63..fa9905aa5fbb 100644 --- a/maven-settings/src/main/mdo/writer.vm +++ b/maven-settings/src/main/mdo/writer.vm @@ -27,9 +27,9 @@ #set ( $rootUcapName = $Helper.capitalise( $root.name ) ) #set ( $rootLcapName = $Helper.uncapitalise( $root.name ) ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-settings/src/site/apt/index.apt b/maven-settings/src/site/apt/index.apt index bcedeedd2350..95193e910abf 100644 --- a/maven-settings/src/site/apt/index.apt +++ b/maven-settings/src/site/apt/index.apt @@ -26,7 +26,7 @@ Maven Settings Model This is the model for Maven settings in <<>> package, - delegating content to {{{../maven-api/maven-api-settings/index.html}Maven 4 API immutable settings}}. All the effective model + delegating content to {{{../api/maven-api-settings/index.html}Maven 4 API immutable settings}}. All the effective model building logic from multiple settings files is done in {{{../maven-settings-builder/}Maven Settings Builder}}. The following are generated from this model: diff --git a/maven-toolchain-model/pom.xml b/maven-toolchain-model/pom.xml index 9a72225a1743..01ecb03cb058 100644 --- a/maven-toolchain-model/pom.xml +++ b/maven-toolchain-model/pom.xml @@ -52,10 +52,9 @@ under the License. org.apache.maven.plugins maven-dependency-plugin - 3.2.0 - copy-model + copy-toolchains.mdo copy @@ -76,8 +75,14 @@ under the License. - org.apache.maven - modello-plugin-velocity + org.codehaus.modello + modello-maven-plugin + + 1.1.0 + + target/mdo/toolchains.mdo + + velocity @@ -86,10 +91,6 @@ under the License. generate-sources - 4.0.0 - - target/mdo/toolchains.mdo - diff --git a/maven-toolchain-model/src/main/mdo/merger.vm b/maven-toolchain-model/src/main/mdo/merger.vm index 407ca863843a..6b76051849dd 100644 --- a/maven-toolchain-model/src/main/mdo/merger.vm +++ b/maven-toolchain-model/src/main/mdo/merger.vm @@ -23,9 +23,9 @@ # #set ( $root = $model.getClass( $model.getRoot($version), $version ) ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-toolchain-model/src/main/mdo/model-v3.vm b/maven-toolchain-model/src/main/mdo/model-v3.vm index 0271ae33bc17..9e06cff9ba59 100644 --- a/maven-toolchain-model/src/main/mdo/model-v3.vm +++ b/maven-toolchain-model/src/main/mdo/model-v3.vm @@ -33,7 +33,7 @@ #set ( $dummy = $allFields.addAll( $cl.allFields ) ) #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() ) @@ -82,7 +82,7 @@ #end #end // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-toolchain-model/src/main/mdo/reader.vm b/maven-toolchain-model/src/main/mdo/reader.vm index 91c17e584a64..feae630a9da5 100644 --- a/maven-toolchain-model/src/main/mdo/reader.vm +++ b/maven-toolchain-model/src/main/mdo/reader.vm @@ -27,9 +27,9 @@ #set ( $rootUcapName = $Helper.capitalise( $root.name ) ) #set ( $rootLcapName = $Helper.uncapitalise( $root.name ) ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-toolchain-model/src/main/mdo/writer.vm b/maven-toolchain-model/src/main/mdo/writer.vm index 75dfe0c58a63..fa9905aa5fbb 100644 --- a/maven-toolchain-model/src/main/mdo/writer.vm +++ b/maven-toolchain-model/src/main/mdo/writer.vm @@ -27,9 +27,9 @@ #set ( $rootUcapName = $Helper.capitalise( $root.name ) ) #set ( $rootLcapName = $Helper.uncapitalise( $root.name ) ) # -#MODELLO-VELOCITY#REDIRECT ${package.replace('.','/')}/${className}.java +#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java // =================== DO NOT EDIT THIS FILE ==================== -// Generated by Maven, any modifications will be overwritten. +// ${generatedBy} // ============================================================== package ${package}; diff --git a/maven-toolchain-model/src/site/apt/index.apt b/maven-toolchain-model/src/site/apt/index.apt new file mode 100644 index 000000000000..81e22f7ce451 --- /dev/null +++ b/maven-toolchain-model/src/site/apt/index.apt @@ -0,0 +1,39 @@ +~~ 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. + + ----- + Introduction + ----- + Hervé Boutemy + ----- + 2006-11-04 + ----- + +Maven Toolchain Model + + This is the model for Maven toolchain in <<>> package, + delegating content to {{{../api/maven-api-toolchain/index.html}Maven 4 API immutable toolchain}}. All the effective model + building logic from multiple toolchains files is done in {{{../maven-toolchain-builder/}Maven Toolchain Builder}}. + + The following are generated from this model: + + * {{{./apidocs/index.html}Java sources}} with Reader and Writers for the Xpp3 XML parser, <<>> and <<>> transformers, and <<>> package + for Merger and v4 Reader and Writers for the Xpp3 XML parser, + + * A {{{./toolchains.html}Descriptor Reference}} + + * An {{{https://maven.apache.org/xsd/toolchains-1.1.0.xsd}XSD}} diff --git a/pom.xml b/pom.xml index 7a4ecbd650fe..36820f12e30f 100644 --- a/pom.xml +++ b/pom.xml @@ -492,11 +492,6 @@ under the License. - - org.apache.maven - modello-plugin-velocity - ${project.version} - org.codehaus.plexus plexus-component-metadata @@ -530,6 +525,7 @@ under the License. org.codehaus.modello modello-maven-plugin + 2.1.0 modello-site-docs @@ -539,14 +535,6 @@ under the License. pre-site - - modello - - java - xpp3-reader - xpp3-writer - -