When I add a dependency to eugene-plugin that is already present in eugene-plugin, i got a linkage error [1]. I could be great to check plugin dependencies before adding the added dependencies.
[1] :
[FATAL ERROR] org.nuiton.eugene.plugin.SmartGenerateMojo#execute() caused a linkage error (java.lang.IllegalAccessError) and may be out-of-date. Check the realms:
[FATAL ERROR] Plugin realm = app0.child-container[org.nuiton.eugene:maven-eugene-plugin:2.2]
urls[0] = file:/home/couteau/.m2/repository/org/nuiton/eugene/maven-eugene-plugin/2.2/maven-eugene-plugin-2.2.jar
urls[1] = file:/home/couteau/workspace/nuiton/wikitty/trunk/wikitty-generators/target/wikitty-generators-3.0-SNAPSHOT.jar
urls[2] = file:/home/couteau/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
urls[3] = file:/home/couteau/.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar
urls[4] = file:/home/couteau/.m2/repository/org/nuiton/eugene/eugene/2.2/eugene-2.2.jar
urls[5] = file:/home/couteau/.m2/repository/org/nuiton/nuiton-utils/1.4.2/nuiton-utils-1.4.2.jar
urls[6] = file:/home/couteau/.m2/repository/commons-primitives/commons-primitives/1.0/commons-primitives-1.0.jar
urls[7] = file:/home/couteau/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar
urls[8] = file:/home/couteau/.m2/repository/commons-beanutils/commons-beanutils/1.8.2/commons-beanutils-1.8.2.jar
urls[9] = file:/home/couteau/.m2/repository/org/nuiton/i18n/nuiton-i18n/1.2.2/nuiton-i18n-1.2.2.jar
urls[10] = file:/home/couteau/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar
urls[11] = file:/home/couteau/.m2/repository/commons-digester/commons-digester/2.0/commons-digester-2.0.jar
urls[12] = file:/home/couteau/.m2/repository/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar
urls[13] = file:/home/couteau/.m2/repository/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.jar
urls[14] = file:/home/couteau/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
urls[15] = file:/home/couteau/.m2/repository/jaxen/jaxen/1.1.1/jaxen-1.1.1.jar
urls[16] = file:/home/couteau/.m2/repository/jdom/jdom/1.0/jdom-1.0.jar
urls[17] = file:/home/couteau/.m2/repository/xom/xom/1.0/xom-1.0.jar
urls[18] = file:/home/couteau/.m2/repository/xalan/xalan/2.6.0/xalan-2.6.0.jar
urls[19] = file:/home/couteau/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar
urls[20] = file:/home/couteau/.m2/repository/org/nuiton/maven-helper-plugin/1.2.7/maven-helper-plugin-1.2.7.jar
urls[21] = file:/home/couteau/.m2/repository/log4j/log4j/1.2.16/log4j-1.2.16.jar
[FATAL ERROR] Container realm = plexus.core
urls[0] = file:/usr/apps/apache-maven-2.2.1/lib/maven-2.2.1-uber.jar
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] tried to access method org.nuiton.wikitty.generator.WikittyTransformerUtil.isBusinessEntity(Lorg/nuiton/eugene/models/object/ObjectModelClass;)Z from class org.nuiton.wikitty.generator.WikittyDTOGenerator
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.IllegalAccessError: tried to access method org.nuiton.wikitty.generator.WikittyTransformerUtil.isBusinessEntity(Lorg/nuiton/eugene/models/object/ObjectModelClass;)Z from class org.nuiton.wikitty.generator.WikittyDTOGenerator
at org.nuiton.wikitty.generator.WikittyDTOGenerator.transformFromModel(WikittyDTOGenerator.java:95)
at org.nuiton.eugene.models.object.ObjectModelTransformer.transformFromElement(ObjectModelTransformer.java:118)
at org.nuiton.eugene.models.object.ObjectModelTransformer.transform(ObjectModelTransformer.java:66)
at org.nuiton.eugene.Transformer.transform(Transformer.java:195)
at org.nuiton.eugene.Transformer.applyTemplate(Transformer.java:179)
at org.nuiton.eugene.plugin.writer.ModelChainedFileWriter.generate(ModelChainedFileWriter.java:311)
at org.nuiton.eugene.writer.AbstractChainedFileWriter.generate(AbstractChainedFileWriter.java:177)
at org.nuiton.eugene.plugin.SmartGenerateMojo.doAction(SmartGenerateMojo.java:502)
at org.nuiton.plugin.AbstractPlugin.execute(AbstractPlugin.java:133)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 15 seconds
[INFO] Finished at: Tue Nov 23 09:39:25 CET 2010
[INFO] Final Memory: 73M/235M
[INFO] ------------------------------------------------------------------------
When using the new generator mode (with string concatenation), when using the line coment style on code to be generated (and so not to be in this case), the processed file does not compile
Il est possible de mettre des choses dans un fichier .properties à coté du modèle, mais il n'en est fait aucune mention dans la documentation.
exemple de chose utilisable:
org.nuiton.wikitty.WikittyGroup.class.tagvalue.version=1.0
fr.isisfish.entities.Population.class.stereotype=entity
fr.isisfish.entities.Population.class.tagvalue.persistenceType=flatfile
fr.isisfish.entities.Population.attribute.name.stereotype=...
fr.isisfish.entities.Population.attribute.name.tagvalue.pk=topiaId
fr.isisfish.entities.Population.operation.getRegion.stereotype=...
fr.isisfish.entities.Population.operation.getRegion.tagvalue.pk=...
et plus généralement:
..[name]..[tag]
ci-joint le fichier .uml généré par topcased / eclipse dernière version et un fichier .objectmodel issue de la génération.
C'est issu du project bws-webmastering-api dispo ici :
http://svn.sharengo.org/svn/wikengo/trunk/bws/webmastering/webmastering-api/
PS : le simple fait de changer le namespace "uml" du fichier .uml permet une génération correct.
xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" => xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
PS2: Merci à Guillaume Dufrêne pour avoir remonté le bug
Cette méthode permettrait d'ajouter automatiquement les getter/setter pour une propriété d'un objet java. Un flag permettrait également de générer les constantes pour le nom des propriétés ainsi qu'une gestion pour les PropertyListener (voir autre méthode addPropertyWithListener).
Cette méthode permettrait de factoriser une partie du code de génération des entités ToPIA et des beans, voir aussi l'utilisation dans Jaxx.
[ERROR] Failed to execute goal org.nuiton.eugene:maven-eugene-plugin:2.0.2:smart-generate (api-generation) on project wikitty-api: could not execute goal SmartGenerateMojo for reason : null: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.nuiton.eugene:maven-eugene-plugin:2.0.2:smart-generate (api-generation) on project wikitty-api: could not execute goal SmartGenerateMojo for reason : null
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:141)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:77)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:69)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:82)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:54)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.singleThreadedBuild(DefaultLifecycleExecutor.java:218)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:190)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:246)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:95)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:430)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:160)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: could not execute goal SmartGenerateMojo for reason : null
at org.nuiton.plugin.AbstractPlugin.execute(AbstractPlugin.java:131)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:133)
... 19 more
Caused by: java.lang.NullPointerException
at java.io.File.(File.java:305)
at org.nuiton.eugene.AbstractGenerator.getDestinationFile(AbstractGenerator.java:119)
at org.nuiton.eugene.models.object.ObjectModelGenerator.generateFromElement(ObjectModelGenerator.java:188)
at org.nuiton.eugene.models.object.ObjectModelGenerator.applyTemplate(ObjectModelGenerator.java:112)
at org.nuiton.wikitty.generator.WikittyMetaGenerator.applyTemplate(WikittyMetaGenerator.java:133)
at org.nuiton.wikitty.generator.WikittyMetaGenerator.applyTemplate(WikittyMetaGenerator.java:18)
at org.nuiton.eugene.plugin.writer.ModelChainedFileWriter.generate(ModelChainedFileWriter.java:334)
at org.nuiton.eugene.writer.AbstractChainedFileWriter.generateEntries(AbstractChainedFileWriter.java:206)
at org.nuiton.eugene.writer.AbstractChainedFileWriter.generate(AbstractChainedFileWriter.java:170)
at org.nuiton.eugene.plugin.SmartGenerateMojo.doAction(SmartGenerateMojo.java:474)
at org.nuiton.plugin.AbstractPlugin.execute(AbstractPlugin.java:128)
... 21 more
Lorsqu'une description est présente dans le model.
à la génération, est généré :
/**
* attributeName : description.
*/
Serait-il possible de supprimer "attributeName :" si la description n'est pas vide ?
Exemple:
/**
* label : Libellé (non obligatoire, à titre indicatif).
* @param label La valeur de l'attribut label à positionner.
*/
public void setLabel(String label);
Dans Argouml, il y a une option "deprecated" dans la documentation d'un objet.
Il serait intéressant de pouvoir ajouter l'annotation (en java) @Deprecated sur les methodes et les classes.
Ce serait bien d'avoir un parametre du genre true qui permet de bloquer la génération si la validation ne passe pas.
Le laisser tout de meme par defaut a false pour eviter de bloquer les applis existantes non encore entièrement validés.
actuellement, on a une dépendance transitive sur xalan (via jaxen).
S'il est possible des remplacer cette dépendance par saxon sans
que cela gêne le plugin maven (au niveau de xslt) ca serait cool.
La tache veut veut pas marcher sur xalan :(
Cela permettra de simplifier leurs usages pour la génération. Et potentiellement d'avoir une extension pour Java avec "synchronized, volatile, ..." transparent dans l'ObjectModel (cad sans methode isSynchronized, ...).
Pour éviter la regression, les methodes isStatic, isAbstract, ... seront maintenus
Nowadays, this behavior is re-implemented in every generators, it would be better to centralize this in eugene.
An option should allow user to make classes always generated
Looks for methods named "getX()" with "boolean" as the return type. The convention is to name these methods "isX()".
Add a tagValue name *doNotGenerateBooleanGetMethods* to place on classifier or model with value true to not generate those methods.
fails to find wikitty.objectmodel, with following trace during build:
[INFO] Process phase [model] for 2 entries.
[INFO] entry : C:\Tmp\refcomp\refcomp-entities\target\generated-sources\models - **/*.*model
[INFO] entry : \ - wikitty.objectmodel
[WARNING] Could not find in class-path the file C:\/wikitty.objectmodel
I want to use the importManager in JAXX, with little improvments :
* add methods to deal directly with fqn without any ObjectModelClassifier
* must accept null value
* accept generics
If set *-DdataTypes=stereotype*, the list of available stereotypes will be displayed
If set *-DdataTypes=tagvalue*, the list of available tagvalues will be displayed
As usual with this goal, you can mix it (*-DdataTypes=stereotype,tagvalues...*)
At release time, copy model xsd and dtd.
will be available here :
* http://maven-site.nuiton.org/eugene/xsd/v1/objectmodel.xsd
* http://maven-site.nuiton.org/eugene/dtd/v1/objectmodel.dtd
* http://maven-site.nuiton.org/eugene/dtd/v1/statemodel.dtd
Fix also xsl template to generate the correct namespace definition
Resolved in eugene in fact (intercept the tag value on model and push the value in the version property of model), see the class org.nuiton.eugene.models.object.ObjectModelReader
The idea is to generate (as it is done with Entity on ToPIA) a i18n key for each property of a generated bean.
For this purpose use the tagValue *i18nPrefix* (on class or for the entire model) to sepcify the i18n key prefix.
In the generated bean there will be a static block with detected i18n keys like in the example :
When loading model properties files, all properties must be scanned, the one whose could not be matched to a tag value must be displayed in warning log level.
In the model :
SampleRow --*------------*-- DCF5Code
when adding line in model properties :
fr.ifremer.wao.entity.SampleRow.attribute.DCF5Code.tagvalue.lazy=false
we find in SampleRowImpl.hbm.xml
So property has not been considered while user has not been warned. It seems that regex
in org.nuiton.eugene.models.object.ObjectModelReader::propertiesPattern misses some cases
- tag values are not copied at the classifier level
- tag values of operations are copied to ouput classifier instead of the ouput operation
- stereotypes are not copied...
- navigable state is not copied from an attribute
Can now pass some transformers (via the *setTransformerTypes*) to apply some transformers on model before applying templates.
In that way no need to use the deprecated previousTransformer usage in Template.
In the method *applyTemplate* we test if a previousTransformer is required, but this previousTransformer is initialized in the *init* method which is invoke later... This can never work.
All files that exclude the include pattern for each pattern are copied. This is not right at all (we could copy zargo files for example...).
Now, We will only take the properties file associated with the file actually reacted.
the problem is that each entry corresponding to a input root is treated by himself.
To sole the problem we must do it in a same pass :
1. Obtain all files to treate (for all entries)
2. Launch generation on all files found
Use case is i'm writing a transformer and i want to give info to next transformers, so after adding a classifier or an attribute to the output model, i should be able to do
addTagValue(ObjectModelClassifier classifier, String tag, String value)
or
addTagValue(ObjectModelAttribute attribute, String tag, String value)
etc.
it would be useful for private constructors for utility-classes and adapter that implements interface with empty bodies
this call :
setOperationBody(op, "");
generate "public void op();"
and should generate "public void op() {}"
I have tried to patch (joined) it but it seems not sufficient to solve the problem. Moreover, this modification will surely have side-effects on existing code.
I use
setOperationBody(op, "// empty body\n");
as a work-around.
Note : also visibility is not managed.
Maybe refactor modifiers using ObjectModelModifier enum will be a good idea to easily manage all case depends on ObjectModelElement type (Class, Interface, Enum, Operation...)
This method will be used to copy the signature of an operation to a destination classifier.
ObjectModelOperation cloneOperationSignature(ObjectModelOperation source, ObjectModelClassifier destination, ObjectModelModifier... modifiers);
In ArgoUML 0.30.1 the Exception can be create directly in package and not Signal anymore. Signal can only be created directly on method.
The parse is different from 0.28 where ArgoUML create Exception on method and Signal directly in package...