Do you mean I generate the source code to src/main/java directory? In this way, I add this configuration:
<sourceGenerationDirectory>src/main/java</sourceGenerationDirectory> Anders Hammar wrote: > > OK, that's probably not the way to go. Why not just generate source code > which you use in your project like if you've developed it by hand? > Or, if you absolutely have to have the xmlbeans generated code in a > separate > artifact, I suggest you move the xsd (and the plugin configuration) to a > separate Maven project. Then you project using those classes will have a > dependency to the artifact containing them (the generated classes). > > However, I don't think that configuring the plugin to generate a jar will > work (in any of the two cases above). Instead, generate source code which > will be compile by the compile-plugin (automatically if you have a jar > project) and included in the artifact (jar file) which is the output of > the > project. > > Hope it helps, > /Anders > > On Wed, Aug 26, 2009 at 12:46, youhaodeyi <[email protected]> wrote: > >> >> This is my pom file. My application should depend on the output jar, >> configuration.jar. How can I let my application depends on this jar file? >> How can I add the generated classes file on the <dependency> node? >> >> <plugin> >> <groupId>org.codehaus.mojo</groupId> >> >> <artifactId>xmlbeans-maven-plugin</artifactId> >> <version>2.3.2</version> >> <executions> >> <execution> >> <goals> >> >> <goal>xmlbeans</goal> >> </goals> >> </execution> >> </executions> >> <inherited>false</inherited> >> <configuration> >> >> <schemaDirectory>src/main/xsd</schemaDirectory> >> >> <outputJar>target/configure.jar</outputJar> >> </configuration> >> </plugin> >> >> Anders Hammar wrote: >> > >> > If we're talking about the Codehaus mojo, it should generate >> source/class >> > files as well. I suggest you first bind the plugin to the build process >> by >> > adding it to the build part of your pom. Most likely it will make >> things >> > work, but if not have a look at the configuration details: >> > http://mojo.codehaus.org/xmlbeans-maven-plugin/xmlbeans-mojo.html >> > >> > /Anders >> > >> > On Wed, Aug 26, 2009 at 11:43, youhaodeyi <[email protected]> wrote: >> > >> >> >> >> I use xmlbeans plugin in my maven project. When running "mvn >> >> xmlbeans:xmlbeans", it will generate a jar file in target directory. >> How >> >> can I let my application depend on the xmlbeans generated jar file? >> >> -- >> >> View this message in context: >> >> http://www.nabble.com/maven-xmlbeans-problem-tp25149630p25149630.html >> >> Sent from the Maven - Users mailing list archive at Nabble.com. >> >> >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: [email protected] >> >> For additional commands, e-mail: [email protected] >> >> >> >> >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/maven-xmlbeans-problem-tp25149630p25150461.html >> Sent from the Maven - Users mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > -- View this message in context: http://www.nabble.com/maven-xmlbeans-problem-tp25149630p25151109.html Sent from the Maven - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
