You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2023/01/10 23:57:34 UTC

[maven] branch MNG-7664 updated: [MNG-7664] add parameter for unique common.vm

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch MNG-7664
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/MNG-7664 by this push:
     new 682ab0e83 [MNG-7664] add parameter for unique common.vm
682ab0e83 is described below

commit 682ab0e83f22a64ac9d36979ee381553a267263d
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Wed Jan 11 00:57:15 2023 +0100

    [MNG-7664] add parameter for unique common.vm
---
 api/maven-api-model/pom.xml                    |  1 +
 api/maven-api-model/src/main/mdo/common.vm     |  2 ++
 api/maven-api-settings/src/main/mdo/common.vm  | 16 ++++++++++++++--
 api/maven-api-toolchain/src/main/mdo/common.vm | 16 ++++++++++++++--
 maven-model/pom.xml                            |  1 +
 maven-model/src/main/mdo/common.vm             |  2 ++
 maven-plugin-api/src/main/mdo/common.vm        | 16 ++++++++++++++--
 maven-settings/src/main/mdo/common.vm          | 16 ++++++++++++++--
 maven-toolchain-model/src/main/mdo/common.vm   | 16 ++++++++++++++--
 9 files changed, 76 insertions(+), 10 deletions(-)

diff --git a/api/maven-api-model/pom.xml b/api/maven-api-model/pom.xml
index 87d80b4cb..1c896a208 100644
--- a/api/maven-api-model/pom.xml
+++ b/api/maven-api-model/pom.xml
@@ -81,6 +81,7 @@ under the License.
               </templates>
               <params>
                 <param>packageModelV4=org.apache.maven.api.model</param>
+                <param>isMavenModel=true</param>
               </params>
             </configuration>
           </execution>
diff --git a/api/maven-api-model/src/main/mdo/common.vm b/api/maven-api-model/src/main/mdo/common.vm
index e300b2289..a4c17e882 100644
--- a/api/maven-api-model/src/main/mdo/common.vm
+++ b/api/maven-api-model/src/main/mdo/common.vm
@@ -17,6 +17,7 @@
   under the License.
 *#
 #
+##if ( "${isMavenModel}" == "true" )
 ##
 ## The following loop code is required in order to change the type of the
 ## pomFile attribute to a java.nio.file.Path.  Modello does not support this
@@ -28,4 +29,5 @@
   #end
 #end
 #set ( $locationTracking = true )
+##end
 #
\ No newline at end of file
diff --git a/api/maven-api-settings/src/main/mdo/common.vm b/api/maven-api-settings/src/main/mdo/common.vm
index aa3d17a03..a4c17e882 100644
--- a/api/maven-api-settings/src/main/mdo/common.vm
+++ b/api/maven-api-settings/src/main/mdo/common.vm
@@ -16,6 +16,18 @@
   specific language governing permissions and limitations
   under the License.
 *#
+#
+##if ( "${isMavenModel}" == "true" )
 ##
-## Nothing special to do here
-##
\ No newline at end of file
+## The following loop code is required in order to change the type of the
+## pomFile attribute to a java.nio.file.Path.  Modello does not support this
+## type and loading a model with such a type would fail the Modello validation.
+##
+#foreach ( $field in $model.getClass("Model", $version).allFields )
+  #if ( $field.name == "pomFile" )
+    #set ( $dummy = $field.setType("java.nio.file.Path") )
+  #end
+#end
+#set ( $locationTracking = true )
+##end
+#
\ No newline at end of file
diff --git a/api/maven-api-toolchain/src/main/mdo/common.vm b/api/maven-api-toolchain/src/main/mdo/common.vm
index aa3d17a03..a4c17e882 100644
--- a/api/maven-api-toolchain/src/main/mdo/common.vm
+++ b/api/maven-api-toolchain/src/main/mdo/common.vm
@@ -16,6 +16,18 @@
   specific language governing permissions and limitations
   under the License.
 *#
+#
+##if ( "${isMavenModel}" == "true" )
 ##
-## Nothing special to do here
-##
\ No newline at end of file
+## The following loop code is required in order to change the type of the
+## pomFile attribute to a java.nio.file.Path.  Modello does not support this
+## type and loading a model with such a type would fail the Modello validation.
+##
+#foreach ( $field in $model.getClass("Model", $version).allFields )
+  #if ( $field.name == "pomFile" )
+    #set ( $dummy = $field.setType("java.nio.file.Path") )
+  #end
+#end
+#set ( $locationTracking = true )
+##end
+#
\ No newline at end of file
diff --git a/maven-model/pom.xml b/maven-model/pom.xml
index 8fbd8317b..a566f2133 100644
--- a/maven-model/pom.xml
+++ b/maven-model/pom.xml
@@ -83,6 +83,7 @@ under the License.
             <param>packageModelV3=org.apache.maven.model</param>
             <param>packageModelV4=org.apache.maven.api.model</param>
             <param>packageToolV4=org.apache.maven.model.v4</param>
+            <param>isMavenModel=true</param>
           </params>
         </configuration>
         <executions>
diff --git a/maven-model/src/main/mdo/common.vm b/maven-model/src/main/mdo/common.vm
index e300b2289..b8ae20968 100644
--- a/maven-model/src/main/mdo/common.vm
+++ b/maven-model/src/main/mdo/common.vm
@@ -17,6 +17,7 @@
   under the License.
 *#
 #
+#if ( "${isMavenModel}" == "true" )
 ##
 ## The following loop code is required in order to change the type of the
 ## pomFile attribute to a java.nio.file.Path.  Modello does not support this
@@ -28,4 +29,5 @@
   #end
 #end
 #set ( $locationTracking = true )
+#end
 #
\ No newline at end of file
diff --git a/maven-plugin-api/src/main/mdo/common.vm b/maven-plugin-api/src/main/mdo/common.vm
index aa3d17a03..a4c17e882 100644
--- a/maven-plugin-api/src/main/mdo/common.vm
+++ b/maven-plugin-api/src/main/mdo/common.vm
@@ -16,6 +16,18 @@
   specific language governing permissions and limitations
   under the License.
 *#
+#
+##if ( "${isMavenModel}" == "true" )
 ##
-## Nothing special to do here
-##
\ No newline at end of file
+## The following loop code is required in order to change the type of the
+## pomFile attribute to a java.nio.file.Path.  Modello does not support this
+## type and loading a model with such a type would fail the Modello validation.
+##
+#foreach ( $field in $model.getClass("Model", $version).allFields )
+  #if ( $field.name == "pomFile" )
+    #set ( $dummy = $field.setType("java.nio.file.Path") )
+  #end
+#end
+#set ( $locationTracking = true )
+##end
+#
\ No newline at end of file
diff --git a/maven-settings/src/main/mdo/common.vm b/maven-settings/src/main/mdo/common.vm
index aa3d17a03..a4c17e882 100644
--- a/maven-settings/src/main/mdo/common.vm
+++ b/maven-settings/src/main/mdo/common.vm
@@ -16,6 +16,18 @@
   specific language governing permissions and limitations
   under the License.
 *#
+#
+##if ( "${isMavenModel}" == "true" )
 ##
-## Nothing special to do here
-##
\ No newline at end of file
+## The following loop code is required in order to change the type of the
+## pomFile attribute to a java.nio.file.Path.  Modello does not support this
+## type and loading a model with such a type would fail the Modello validation.
+##
+#foreach ( $field in $model.getClass("Model", $version).allFields )
+  #if ( $field.name == "pomFile" )
+    #set ( $dummy = $field.setType("java.nio.file.Path") )
+  #end
+#end
+#set ( $locationTracking = true )
+##end
+#
\ No newline at end of file
diff --git a/maven-toolchain-model/src/main/mdo/common.vm b/maven-toolchain-model/src/main/mdo/common.vm
index aa3d17a03..a4c17e882 100644
--- a/maven-toolchain-model/src/main/mdo/common.vm
+++ b/maven-toolchain-model/src/main/mdo/common.vm
@@ -16,6 +16,18 @@
   specific language governing permissions and limitations
   under the License.
 *#
+#
+##if ( "${isMavenModel}" == "true" )
 ##
-## Nothing special to do here
-##
\ No newline at end of file
+## The following loop code is required in order to change the type of the
+## pomFile attribute to a java.nio.file.Path.  Modello does not support this
+## type and loading a model with such a type would fail the Modello validation.
+##
+#foreach ( $field in $model.getClass("Model", $version).allFields )
+  #if ( $field.name == "pomFile" )
+    #set ( $dummy = $field.setType("java.nio.file.Path") )
+  #end
+#end
+#set ( $locationTracking = true )
+##end
+#
\ No newline at end of file