We use a jaxb plugin to generate code in our build.
The plugin generates the code into the generated
sources folder and that source is subsequently
included in the artifact.
Here's what it looks like
<plugin>
                                <groupId>com.sun.tools.xjc.maven2</groupId>
                                <artifactId>maven-jaxb-plugin</artifactId>
                                <version>1.0</version>
                                <executions>
                                        <execution>
                                                <goals>
                                                        <goal>generate</goal>
                                                </goals>
                                        </execution>
                                </executions>
                                <configuration>
                                        <includeBindings>
                                                
<includeBinding>*.xjb</includeBinding>
                                        </includeBindings>
                                </configuration>
                        </plugin>
--- zm <[EMAIL PROTECTED]> wrote:

> 
> Hi,
> 
> I'm using Maven 2.0.7 and Eclipse to develop a Java
> app, and need some help
> on including some auto-generated java code through
> an Ant task or even a
> batch script.
> 
> I have created 2 projects, "appTest" and
> "appCommon". The main project is
> "appTest" that depends on "appCommon".
> 
> My "appTest" will use, let's say, jaxb for xml
> processing. I have created
> some xsd schemas, and manually executed jaxb to
> generate the jaxb java
> source code to process xml, and that code is
> included in the "appCommon"
> project.
> 
> Nice and easy.
> 
> Now I want to do something more ... I want that
> Maven, when executes the
> "compile" goal, pre-runs the generation of that same
> java code.
> 
> How do I do it?
> 
> And if I have an Ant task from jaxb that does the
> job, the problem is that I
> don't know where it is located, since it depends on
> the version I specify
> for maven (that it will download from central repo).
> How can I achieve a
> dynamic way of doing it?
> 
> 
> 
> Any help would be appreciated for me to learn more
> about this software.
> 
> Thank You.
> -- 
> View this message in context:
>
http://www.nabble.com/Maven-execution-running-task-script-that-generates-some-java-code-tf4436042s177.html#a12655886
> Sent from the Maven - Users mailing list archive at
> Nabble.com.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 



       
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. 
Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to