Hi Christian, In the JAXB plugin, I preGoal'd java:compile to generate the additional sources, and then any projects that compile other types first manually compiled them with a javac task in a preGoal on jaxb:generate.
So I run java:compile, that first calls jaxb:generate, that first calls a custom goal to compile the types needed in JAXB. You may need to do it the other way around. However, you always want to be running java:compile at the end so that any other goals like jar:jar, test, etc end up rebuilding all that stuff as appropriate. I haven't release the JAXB plugin yet, but in the Maven distro there is an antlr plugin that does code generation that might help you. - Brett > -----Original Message----- > From: Christian Andersson [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 10 September 2003 5:34 AM > To: Maven Users List > Subject: Re: how to best find the goal needed to do the job. > > > damn, I was hoping that I did not have to start creating > goals/plugins > just yet.. need to familarise myself with this tool a bit first.. > > hmm one question though... since rmic requires that I have the > interfaces already compiled I would need to do something like this.. > > java:compile > compile all classes/interfaces that the user has > written. rmi:generate > find all classes (not interfaces) that implements the > java.rmi.Remote interface, call rmic for these. > OR somehow tell the rmi-generator/compiler which classes it > should work with. > > rmi:compile > compile the generated sources > > is there any goal that does something like this already? > > So, where do I start? > > and yes, if I do make something, it would probably make it as > a plugin > and donate it back to maven... there is no need to keep > anything liek > this for myself :-) > > > > Andy Jefferson wrote: > > > On Tuesday 09 Sep 2003 18:46, Christian Andersson wrote: > > > >>Hi there, I have a small problem that I wonder if you could help me > >>with.. I'm developing an application with my own server system (rmi > >>based at the moment) and now I need to run rmic on some of > my files to > >>generate the rmi classes, how do I do that? > > > > > > I'd guess you need to write a plugin to do the job for you > - or add a > > "goal" > > to your maven.xml (they both amount to the same but if you > write it as a > > plugin, others can benefit from it as well). I did a search > through the > > plugins and there seems nothing that uses rmic. What you > need to do is look > > at an existing plugin (e.g maven-java-plugin-1.3), split > open the JAR and you > > find a plugin.jelly. Look at the Wiki for how to create a > plugin. What you > > need is a "goal" that uses the Ant rmic step - the syntax > is the same as for > > ant, so add something like > > > > <ant:rmic ...> > > <classpath refid="maven.dependency.classpath"> > > </ant:rmic> > > > > adding the relevant Ant parameters to the "..." part to > specify your > > files to > > be used etc. > > > > > > HTH > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >
