All,<div><br></div><div>Adding the serial version from within Forge like Eclipse does is possible but you need the compiled version of your class to have it. (as mentioned above, the JVM computed one)</div><div><br></div><div>
I have created the feature for the deltaspike forge plugin (experimental phase), see (1)</div><div><br></div><div>The references that I used to create the feature can be found in(2), (3) and (4).</div><div><br></div><div>
Regards</div><div>Rudy</div><div><br></div><div>(1) <a href="https://github.com/rdebusscher/forge-plugin-deltaspike">https://github.com/rdebusscher/forge-plugin-deltaspike</a></div><div>(2) <a href="http://www.javadocexamples.com/java/io/ObjectStreamClass/getSerialVersionUID%28%29.html">http://www.javadocexamples.com/java/io/ObjectStreamClass/getSerialVersionUID%28%29.html</a><br>
(3) <a href="http://www.koders.com/java/fid9C000A36992600FE1843A5AED6FE613BF68B8B1E.aspx?s=199">http://www.koders.com/java/fid9C000A36992600FE1843A5AED6FE613BF68B8B1E.aspx?s=199</a></div><div>(4) <a href="http://www.javablogging.com/dynamic-in-memory-compilation/">http://www.javablogging.com/dynamic-in-memory-compilation/</a><br>
<br>-- <br>Rudy De Busscher<br><div class="gmail_quote">:) Offering my free time to OpenSource :)</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On 6 March 2012 19:31, Dan Allen <span dir="ltr">&lt;<a href="mailto:dan.j.allen@gmail.com">dan.j.allen@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, Mar 6, 2012 at 04:30, Pete Muir <span dir="ltr">&lt;<a href="mailto:pmuir@redhat.com" target="_blank">pmuir@redhat.com</a>&gt;</span> wrote:<br>
</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Maybe I said it. It&#39;s not good practice to put serialVersionUID=1L, as it&#39;s broken in reality (all versions are now the same version). If you omit it entirely, then the JVM will compute the serialVersionUID for you on the fly, from the class file. This is much better for development. Once your app has stabilised, you can then go through and generate the ids needed. Instead of adding the serialVersionUID, I would suggest adding the relevant @SuppressWarnings(&quot;serial&quot;) (IIRC, that is the one).<br>


</blockquote><div><br></div></div><div>+1 That&#39;s the best approach I&#39;ve seen yet. It says &quot;I know I need to take care of that, but it doesn&#39;t make sense to get into that level of detail until the app matures / hatches&quot; Better to have a TODO than a hack.</div>


<div><br></div><div><a href="http://stackoverflow.com/questions/146715/use-the-serialversionuid-or-suppress-warnings" target="_blank">http://stackoverflow.com/questions/146715/use-the-serialversionuid-or-suppress-warnings</a></div>
<div>
<br>
</div><div>The other thing to do is to try to educate users about it. The goal of Forge here isn&#39;t to push them in one direction or another, but to help them along the path to success.</div><div><br></div><div>I do think it would be nice if Forge could do what Eclipse does and generate a serialVersionUID for a class. You could either have this as an option flag when generating an entity or you can do it after the fact (after the fact probably better).</div>


<div><br></div><div>$forge&gt; add-serial-version-uids</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-Dan</div><div><br></div></font></span></div><span class="HOEnZb"><font color="#888888">-- <br><div>
Dan Allen</div>Principal Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br>

<br><div><a href="http://google.com/profiles/dan.j.allen" target="_blank">http://google.com/profiles/dan.j.allen</a><br><a href="http://mojavelinux.com" target="_blank">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction" target="_blank">http://mojavelinux.com/seaminaction</a><br>


</div><br>
</font></span><br>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div><br><br>
</div>