You still have to include the <dependencies> section with commons lib into the plugin.
Try also to enable debug logging mojo params, i think they might indicate what jasb-lib were taken into account. If not, i remeber there was such an option into JAXB1, i don't know whether it still exists in JAXB2. If you find a way to get the notification of any active jaxb-libs, please update the conversation with it. Regards, Kostis On Thu 20 Sep 2007 15:58:54 Abhinav Chaturvedi wrote: > Thanks a lot for the reply. > > I tried doing that as well... please look at the following pom.xml > ----------------------- > <plugins> > <plugin> > <groupId>org.jvnet.jaxb2.maven2</groupId> > <artifactId>maven-jaxb2-plugin</artifactId> > <executions> > <execution> > <goals> > <goal>generate</goal> > </goals> > </execution> > </executions> > <configuration> > <generatePackage>foo.bar</generatePackage> > <!-- The name of your generated source package --> > <schemaDirectory>./src/main/wsdl/</schemaDirectory> > <includeSchemas> > <includeSchema>Blah.xsd</includeSchema> > </includeSchemas> > <args> > <arg>-Xcommons-lang</arg> > </args> > </configuration> > </plugin> > </plugins> > ----------------------- > I get following exception > ----------------------- > Error while setting CmdLine <args> options '[-Xcommons-lang, -episode, > /foo/target/generated-sources/xj > c/META-INF/sun-jaxb.episode]'! > > Embedded error: unrecognized parameter -Xcommons-lang > [INFO] > ------------------------------------------------------------------------ > [DEBUG] Trace > org.apache.maven.lifecycle.LifecycleExecutionException: Error while setting > CmdLine <args> options '[-Xcommons-lang, -episode, > /foo/target/generated-sources/xjc/META-INF/sun-jaxb.episode]'! > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals( > DefaultLifecycleExecutor.java:564) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycl >e (DefaultLifecycleExecutor.java:480) > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal( > DefaultLifecycleExecutor.java:459) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai >lures (DefaultLifecycleExecutor.java:311) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments( > DefaultLifecycleExecutor.java:278) > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute( > DefaultLifecycleExecutor.java:143) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:280) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke( > NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java > > :315) > > at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) > at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java > > :430) > > at org.codehaus.classworlds.Launcher.main(Launcher.java:375) > Caused by: org.apache.maven.plugin.MojoExecutionException: Error while > setting CmdLine <args> options '[-Xcommons-lang, -episode, > /foo/target/generated-sources/xjc/META-INF/sun-jaxb.episode]'! > at org.jvnet.jaxb2.maven2.XJC2Mojo.setupCmdLineArgs(XJC2Mojo.java > > :810) > > at org.jvnet.jaxb2.maven2.XJC2Mojo.setupOptions(XJC2Mojo.java:785) > at org.jvnet.jaxb2.maven2.XJC2Mojo.execute(XJC2Mojo.java:602) > at org.apache.maven.plugin.DefaultPluginManager.executeMojo( > DefaultPluginManager.java:443) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals( > DefaultLifecycleExecutor.java:539) > ... 16 more > Caused by: com.sun.tools.xjc.BadCommandLineException: unrecognized > parameter -Xcommons-lang > at com.sun.tools.xjc.Options.parseArguments(Options.java:719) > at org.jvnet.jaxb2.maven2.XJC2Mojo.setupCmdLineArgs(XJC2Mojo.java > > :807) > > ... 20 more > ---------------------------- > > Thanks in advance. > Abhinav > > On 9/20/07, Kostis Anagnostopoulos <[EMAIL PROTECTED]> wrote: > > Hi Abhinav , > > > > You should use the latest plugin, hosted at java.net: > > > > groupId: org.jvnet.jaxb2.maven2 > > artifactId: maven-jaxb2-plugin > > > > > > Regards, > > Kostis > > > > On Thu 20 Sep 2007 14:49:08 Abhinav Chaturvedi wrote: > > > Hi, > > > > > > I am trying to use commons lang plugin, supplied with jaxb2-commons, > > > but > > > > I > > > > > fail to get the hashCode for the generated types. While passing the > > > parameter -Xcommons-lang I get an unrecognized parameter exception in > > > XJCMojo class. > > > > > > Also, I cannot use any other plugins (other than commons-lang) to > > > > generate > > > > > hashCode for backward compatibility. > > > > > > This is how my pom.xml looks like > > > -------------------- > > > <plugin> > > > <artifactId>jaxb2-maven-plugin </artifactId> > > > <groupId>org.codehaus.mojo</groupId> > > > <dependencies> > > > <dependency> > > > <groupId>net.java.dev.jaxb2-commons</groupId> > > > <artifactId>jaxb-commons-lang-plugin</artifactId> > > > <version>2.0.2</version> > > > </dependency> > > > </dependencies> > > > <configuration> > > > <packageName> foo.bar</packageName> > > > <!-- The name of your generated source package --> > > > <schemaDirectory>./src/main/wsdl/</schemaDirectory> > > > <schemaFiles> blah.xsd</schemaFiles> > > > <arguments>-Xcommons-lang</arguments> > > > </configuration> > > > <executions> > > > <execution> > > > <goals> > > > <goal>xjc</goal> > > > </goals> > > > </execution> > > > </executions> > > > </plugin> > > > ------------------------- > > > While compiling (mvn clean compile) I get following exception- > > > > > > [DEBUG] Trace > > > org.apache.maven.lifecycle.LifecycleExecutionException: unrecognized > > > parameter -Xcommons-lang > > > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals( > > > DefaultLifecycleExecutor.java:564) > > > at > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecy > >cl > > > > >e (DefaultLifecycleExecutor.java :480) > > > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal( > > > DefaultLifecycleExecutor.java:459) > > > at > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleF > >ai > > > > >lures (DefaultLifecycleExecutor.java :311) > > > at > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments( > > > > > DefaultLifecycleExecutor.java:278) > > > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute( > > > DefaultLifecycleExecutor.java :143) > > > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334) > > > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125) > > > at org.apache.maven.cli.MavenCli.main(MavenCli.java :280) > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke( > > > > NativeMethodAccessorImpl.java > > > > > :39) > > > > > > at sun.reflect.DelegatingMethodAccessorImpl.invoke ( > > > DelegatingMethodAccessorImpl.java:25) > > > at java.lang.reflect.Method.invoke(Method.java:585) > > > at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) > > > at org.codehaus.classworlds.Launcher.launch (Launcher.java:255) > > > at > > > org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) > > > at org.codehaus.classworlds.Launcher.main(Launcher.java:375) > > > Caused by: org.apache.maven.plugin.MojoExecutionException : > > > unrecognized parameter -Xcommons-lang > > > at org.codehaus.mojo.jaxb2.XjcMojo.execute(XjcMojo.java:352) > > > at org.apache.maven.plugin.DefaultPluginManager.executeMojo( > > > DefaultPluginManager.java:443) > > > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals( > > > DefaultLifecycleExecutor.java:539) > > > ... 16 more > > > Caused by: com.sun.tools.xjc.BadCommandLineException: unrecognized > > > parameter -Xcommons-lang > > > at com.sun.tools.xjc.Options.parseArguments(Options.java:692) > > > at com.sun.tools.xjc.Driver.run(Driver.java:209) > > > at org.codehaus.mojo.jaxb2.XjcMojo.execute(XjcMojo.java:301) > > > > > > Where am I going wrong? > > > > > > Would really appreciate any help. > > > > > > Thanks in advance. > > > > > > Abhinav > > > > --------------------------------------------------------------------- > > To unsubscribe from this list please visit: > > > > http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
