I would recommend looking at the torque plugin for your problems with the code generator. the torque plugin is basically a giant code generator.
Eric > -----Original Message----- > From: Leo Sutic [mailto:[EMAIL PROTECTED] > Sent: Saturday, August 23, 2003 12:50 PM > To: [EMAIL PROTECTED] > Subject: Accessing maven.compile.src.set and maven.final.name > > > Hi all, > > I have been trying Maven for the past week, and come up > against two major > difficulties: > > > CODE GENERATOR > -------------- > I have a code-generator task written for Ant that I'm trying > to turn into > a Maven plugin. Since it is a code generator, I need to do > the following: > > 1. Run the code generator. > > 2. Compile the java source files and the files generated in step (1). > > I thought that defining a preoal for java:compile would do > the trick, and > this actually worked: > > 1. Use the maven.compile.src.set path to find source files, and feed > these to the code generator. > > 2. The code generator uses the maven.build.dir property to output a > temporary source tree to ${maven.build.dir}/generated > > 3. Add the ${maven.build.dir}/generated path to the > maven.compile.src.set > path via <maven:addPath/>. > > Then the java:compile goal will kick in and compile the original java > source files along with the newly generated ones. So far so > good, then - > but then I moved the above code into a plugin (I had had it in the > maven.xml of my project first), and suddenly I discovered the > following: > > + maven.compile.src.set no longer available. > > + Adding the ${maven.build.dir}/generated path to the > maven.compile.src.set path via <maven:addPath/> doesn't work. When > java:compile kicks in the change has been rolled back. > > So my questions are: > > 1. How can I access the maven.compile.src.set property from a plugin? > > 2. How can I modify the maven.compile.src.set property from a plugin? > > > JAR TOOL > -------- > I also have a tool that operates on the produced JAR file. So > I defined a > postGoal for jar:jar, and figured I'd use the > ${maven.build.dir}/${maven.final.name}.jar path to find the > jar that was > just produced. However, this turned out not to work in the case when > jar:jar was called from jar:snapshot. The <j:set/> done in > jar:snapshot to > set the jar's name to the snapshotSignature isn't visible from the > postGoal. > > So my questions are: > > 1. Is there an easy way to add any post-processing of the jar file > created by jar:jar? > > 2. Is there any way to find out the path of the jar created > in jar:jar? > > /LS > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
