You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2024/08/16 14:44:00 UTC
[jira] [Created] (MNG-8214) Allow extension of the model classes being generated with model.vm
Konrad Windszus created MNG-8214:
------------------------------------
Summary: Allow extension of the model classes being generated with model.vm
Key: MNG-8214
URL: https://issues.apache.org/jira/browse/MNG-8214
Project: Maven
Issue Type: Improvement
Affects Versions: 4.0.0-beta-3
Reporter: Konrad Windszus
The [model.vm|https://github.com/apache/maven/blob/master/src/mdo/model.vm] being used with Maven 4 models generates immutable classes with builders.
The generated classes cannot be extended easily because
# the builder's constructor is having default access instead of being protected (https://github.com/apache/maven/blob/e335f95dfd11468bdf617421fd5e7093a727d1e1/src/mdo/model.vm#L409 and https://github.com/apache/maven/blob/e335f95dfd11468bdf617421fd5e7093a727d1e1/src/mdo/model.vm#L427
# the builder's build method doesn't rely on generics. Instead an additional constructor should be added which takes a parameterized builder object (like outlined in https://stackoverflow.com/a/17165079)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)