archetype and ModelGenerator

57 views
Skip to first unread message

Gary Hellman

unread,
Nov 25, 2013, 4:47:14 PM11/25/13
to extdire...@googlegroups.com
Hello

I started a mvn archetype "eds-starter-archetype" but see "error ... .entity.User"

[INFO] --- apt-maven-plugin:1.1.0:process (jpa) @ myapp ---
[INFO]
[INFO] --- apt-maven-plugin:1.1.0:process (modelgen) @ myapp ---
error: org...... entity.User etc. for all the Entity classes with @Model annotation

Does the additional JPA annotation interfere with the model generator?
Is there a way to get more descriptive error message?
I guess the error is coming from the " mysema apt-maven-plugin" and is a generic error at some point....

I suppose I could create the js models myself - but if the generator works that would be great!
Also - it looks like all the unit tests for model generator are there for the extdirect code - I will continue to look at that.

Also - I am expecting that model generator writes out "permanent" js files - correct? (not only run-time?)


Thank you for any help or suggestions

Ralph Schaer

unread,
Nov 26, 2013, 12:31:50 AM11/26/13
to extdire...@googlegroups.com
Hi

I see the exact same errors

error: com.mycompany.entity.User
error: com.mycompany.entity.AccessLog
error: com.mycompany.entity.LogEvent


I never figured out what component writes these errors. Despite these errors everything works fine. You find the generated model classes in the directory: src\main\webapp\app\model
and the generated Q-classes for querydsl in the directory: target\generated-sources\java

If you have an idea what causes these errors and how to suppress them I'm very interested to hear



--
You received this message because you are subscribed to the Google Groups "extdirectspring" group.
To unsubscribe from this group and stop receiving emails from it, send an email to extdirectspri...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Gary Hellman

unread,
Nov 26, 2013, 11:29:29 AM11/26/13
to extdire...@googlegroups.com
Thanks Ralph
In "some" cases, the model is not regenerated - it may be that I have changed something too much after starting from generated code ( via the archetype).

I see that if I use the archetype -
mvn archetype:generate -DarchetypeArtifactId=eds-starter-archetype -DarchetypeGroupId=ch.rasc -DarchetypeVersion=1.1.0 -DarchetypeRepository=http://repository.rasc.ch  -DgroupId=org.xxx.yyy -DartifactId=mytestapp -Dversion=0.0.1 -DjsAppNamespace=App

and then delete the models --
mvn generate-resources  - WILL regenerate them as expected.

But again - I must have changed something in my project that causes that to not work - I will keep trying and let you know if I find it.


Thanks again
Gary

nroo

unread,
Jan 22, 2014, 6:45:05 PM1/22/14
to extdire...@googlegroups.com
Hi,

Did any of you resolve this issue???
The errors persist and sometimes the model is generated.
I could not determine when it will generate the model and when it will not. Most of the time it won't.

Thanks.

Rgds,
nroo

Ralph Schaer

unread,
Jan 22, 2014, 10:59:46 PM1/22/14
to extdire...@googlegroups.com
Hi

Finally figured out what the problem is. The ModelGenerator needs the Model java class to be compiled.
In the eds-starter app the model generator runs during the generate-resources phase and at that time the classes might not be compiled especially when you call mvn clean first.

It looks like that changing the phase of the modelgen to compile solves the problem. 


<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>modelgen</id>
<phase>compile</phase>
<goals>
<goal>process</goal>
</goals>
....
</execution>
</executions>
<dependencies>
......
</dependencies>
</plugin>





nroo

unread,
Jan 23, 2014, 7:00:08 AM1/23/14
to extdire...@googlegroups.com
Hello,

It works for me so far.
I have yet to test it thoroughly though.
I hope I get it working across multi-module Maven projects and when Java classes are coming from an already deployed jar file (mvn deploy).
The only discusson I could find regarding extdirspring with multi-module Maven projects was this:

Thanks.
nroo
Reply all
Reply to author
Forward
0 new messages