Minuteproject 0.6 ships a new feature Updatable Generated Code.
It means that some generated code artifacts can be altered (modified) by a developer and the next minuteproject generation will not erase those modifications.

Which artifacts

Not all the minuteproject templates benefit of this feature. So not all are updatable. This feature will gradually be extended to all generated code where fine tuning or manual extension is relevant to achieve proper customisation.
The customisation can be applied to
Tracks
Generated artifacts
JPA2
Domain object classes
REST-JEE
EJB3 DAO classes
Resource classes
WS-JEE
WebService classes
JSF-primefaces
Controller bean classes
OpenXava
i18n
JPA2 OX classes
ehCache
persistence.xml

How to customise your code

On the 'updatable generated code' there are 3 types of alterations:
  • Mark the artifact not to be part of consecutive generation
    • set the tag 'MP-MANAGED-STOP-GENERATING' at any line of the artifact within a comment.
    • The content of the file will not be touched for the next generation on.
  • Add some customisation code between MP-MANAGED-ADDED-AREA-BEGINNING and MP-MANAGED-ADDED-AREA-ENDING.
    • each area is mark by a tag: ex in java for the 'import area', specify the import package/class in this zone.
  • Alter some generated code by changing the tag MP-MANAGED-UPDATABLE-BEGINNING-DISABLE into MP-MANAGED-UPDATABLE-BEGINNING-ENABLE
    • The altered code will be kept

How to activate this feature

By default it is not activated.
To activate it:

On console

console_-_enable_updatable_areas.png

On script

Add the following target convention.
<!DOCTYPE root>
<generator-config>
    <configuration>
        <conventions>
            <target-convention type="enable-updatable-code-feature" />
        </conventions>
This activation means that the templates with updatable nature will use the updatable feature.