[MNG-7602] Move back model version from 5.0 to 4.2 and reactivate modello site generation (#843)

This commit is contained in:
Guillaume Nodet 2022-11-22 23:11:30 +01:00 committed by GitHub
parent 19c897de6f
commit 5da32ae7f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 73 additions and 18 deletions

View File

@ -66,7 +66,7 @@ under the License.
<groupId>org.apache.maven</groupId>
<artifactId>modello-plugin-velocity</artifactId>
<configuration>
<version>5.0.0</version>
<version>4.2.0</version>
<models>
<model>src/main/mdo/maven.mdo</model>
</models>

View File

@ -80,7 +80,7 @@
<field xml.transient="true">
<name>pomFile</name>
<version>5.0.0+</version>
<version>4.2.0+</version>
<required>false</required>
<description>Originating POM file</description>
<type>DOM</type> <!-- This is transformed to a File/Path in the template -->
@ -434,7 +434,7 @@
</code>
</codeSegment>
<codeSegment>
<version>5.0.0+</version>
<version>4.2.0+</version>
<code>
<![CDATA[
/**
@ -580,6 +580,16 @@
<multiplicity>*</multiplicity>
</association>
</field>
<field xdoc.separator="blank">
<name>reports</name>
<version>4.0.0</version>
<description>
<![CDATA[
<b>Deprecated</b>. Now ignored by Maven.
]]>
</description>
<type>DOM</type>
</field>
<field>
<name>reporting</name>
<version>4.0.0+</version>
@ -2232,6 +2242,16 @@
<multiplicity>*</multiplicity>
</association>
</field>
<field>
<name>goals</name>
<version>4.0.0</version>
<description>
<![CDATA[
<b>Deprecated</b>. Unused by Maven.
]]>
</description>
<type>DOM</type>
</field>
<field>
<name>dependencies</name>
<description>Additional dependencies that this project needs to introduce to the plugin's
@ -2598,7 +2618,7 @@
</code>
</codeSegment>
<codeSegment>
<version>5.0.0+</version>
<version>4.2.0+</version>
<code>
<![CDATA[
public static final String SOURCE_POM = "pom";

View File

@ -77,18 +77,38 @@ under the License.
<artifactId>modello-plugin-velocity</artifactId>
<executions>
<execution>
<id>velocity</id>
<id>velocity-v3</id>
<goals>
<goal>velocity</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<version>4.0.0</version>
<version>4.1.0</version>
<models>
<model>target/mdo/maven.mdo</model>
</models>
<templates>
<template>src/main/mdo/model-v3.vm</template>
</templates>
<params>
<param>packageModelV3=org.apache.maven.model</param>
<param>packageModelV4=org.apache.maven.api.model</param>
<param>packageToolV4=org.apache.maven.model.v4</param>
</params>
</configuration>
</execution>
<execution>
<id>velocity-v4</id>
<goals>
<goal>velocity</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<version>4.2.0</version>
<models>
<model>target/mdo/maven.mdo</model>
</models>
<templates>
<template>src/main/mdo/merger.vm</template>
<template>src/main/mdo/transformer.vm</template>
<template>src/main/mdo/reader.vm</template>
@ -105,6 +125,30 @@ under the License.
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<configuration>
<version>4.0.0</version>
<models>
<model>target/mdo/maven.mdo</model>
</models>
</configuration>
<executions>
<execution>
<id>modello-site-docs</id>
<goals>
<goal>xdoc</goal>
<goal>xsd</goal>
</goals>
<phase>pre-site</phase>
</execution>
<execution>
<id>modello</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>

View File

@ -175,10 +175,7 @@ public class ${className}
#set ( $classUcapName = $Helper.capitalise( $class.name ) )
#set ( $classLcapName = $Helper.uncapitalise( $class.name ) )
#set ( $ancestors = $Helper.ancestors( $class ) )
#set ( $allFields = [] )
#foreach ( $cl in $ancestors )
#set ( $dummy = $allFields.addAll( $cl.allFields ) )
#end
#set ( $allFields = $Helper.xmlFields( $class ) )
private ${classUcapName} parse${classUcapName}( XmlPullParser parser, boolean strict, InputSource source )
throws IOException, XmlPullParserException
{

View File

@ -206,10 +206,7 @@ public class ${className}
#set ( $classUcapName = $Helper.capitalise( $class.name ) )
#set ( $classLcapName = $Helper.uncapitalise( $class.name ) )
#set ( $ancestors = $Helper.ancestors( $class ) )
#set ( $allFields = [] )
#foreach ( $cl in $ancestors )
#set ( $dummy = $allFields.addAll( $cl.allFields ) )
#end
#set ( $allFields = $Helper.xmlFields( $class ) )
private ${classUcapName} parse${classUcapName}( XmlPullParser parser, boolean strict )
throws IOException, XmlPullParserException
{

View File

@ -80,10 +80,7 @@ public class ${className}
#foreach ( $class in $model.allClasses )
#if ( $class.name != "InputSource" && $class.name != "InputLocation" )
#set ( $ancestors = $Helper.ancestors( $class ) )
#set ( $allFields = [] )
#foreach ( $cl in $ancestors )
#set ( $dummy = $allFields.addAll( $cl.allFields ) )
#end
#set ( $allFields = $Helper.xmlFields( $class ) )
protected ${class.name} transform${class.name}( ${class.name} target )
{
if ( target == null )