I added a simple xjb and reduced the number of collisions. Regardless of the executions or plugin selected - the work is all done underneath by xjc. Customizing the bindings externally via *.xjb files seems to be the solution.
I would really like to know what the "offical" jaxb maven plugin really is :) It's too late to continue. Thanks for reading and helping me out! On Tue, Dec 1, 2009 at 11:57 PM, Vanek Martin <va...@komix.cz> wrote: > Try to run it with standard jaxb xjc tool pointed on "master" ogckml22.xsd > https://jaxb.dev.java.net/nonav/2.2-ea/docs/xjc.html > > If even this does not work, you have to provide collision resolution > > https://jaxb.dev.java.net/guide/Dealing_with_errors.html#Two_declarations_cause_a_collision_in_the_ObjectFactory_class > > If jaxb xjc works, your problem really is in jaxb plugin and I'd recommend > official plugin https://maven-jaxb2-plugin.dev.java.net/ > > -----Original Message----- > From: Andrew Hughes [mailto:ahhug...@gmail.com] > Sent: Tuesday, December 01, 2009 2:09 PM > To: Maven Users List > Subject: Re: jaxb2-maven-plugin : Two declarations cause a collision > > > Could it possibly be that I need to use xjb's to resolve the collision and > not plugin configuration? > > > On Tue, Dec 1, 2009 at 11:32 PM, Andrew Hughes <ahhug...@gmail.com> wrote: > > > Thanks Again! > > > > You are correct, ogckml22.xsd does import atom-author-link.xsd. Initially > I > > was only running a single <execution> for ogckml22.xsd. I switched to two > > because the FAQ <http://mojo.codehaus.org/jaxb2-maven-plugin/faq.html>said > that's how to resolve the collision. > > > > I've still got no idea how to fix this, but thanks for helping so far. > > > > > > On Tue, Dec 1, 2009 at 11:16 PM, Entner Harald <entner.har...@afb.de > >wrote: > > > >> Hi Andrew, > >> > >> it looks like that ogckml22.xsd File imports the atom-author-link.xsd > >> File. So isn't it sufficient to run the jaxb plugin for ogckml22.xsd > only? > >> > >> > >> -----Ursprüngliche Nachricht----- > >> Von: Andrew Hughes [mailto:ahhug...@gmail.com] > >> Gesendet: Dienstag, 1. Dezember 2009 13:29 > >> An: Maven Users List > >> Betreff: Re: jaxb2-maven-plugin : Two declarations cause a collision > >> > >> Hi Entner - THANK YOU for the reply and suggestion. I am still > >> encountering > >> the same problem :'( I'm not sure what to do here because as far as I > can > >> tell this should work. > >> > >> I have tried this with and without the packageName (as below): > >> > >> <build> > >> <plugins> > >> <plugin> > >> <groupId>org.codehaus.mojo</groupId> > >> <artifactId>jaxb2-maven-plugin</artifactId> > >> <version>1.2</version> > >> <executions> > >> <execution> > >> <id>ogckml22</id> > >> <configuration> > >> <schemaFiles>ogckml22.xsd</schemaFiles> > >> <staleFlag> > >> ${project.build.directory}/generated-sources/jaxb/.staleFlag-ogckml22 > >> </staleFlag> > >> </configuration> > >> <goals> > >> <goal>xjc</goal> > >> </goals> > >> </execution> > >> <execution> > >> <id>atom-author-link</id> > >> <configuration> > >> <schemaFiles>atom-author-link.xsd > >> </schemaFiles> > >> <staleFlag> > >> > >> > ${project.build.directory}/generated-sources/jaxb/.staleFlag-atom-author-link > >> </staleFlag> > >> </configuration> > >> <goals> > >> <goal>xjc</goal> > >> </goals> > >> </execution> > >> </executions> > >> <configuration> > >> <packageName>java.lunch20091126xml.kml</packageName> > >> </configuration> > >> </plugin> > >> > >> > >> On Tue, Dec 1, 2009 at 10:00 PM, Entner Harald <entner.har...@afb.de> > >> wrote: > >> > >> > Hi Andrew, > >> > > >> > try removing the packageName in the pom.xml file. > >> > > >> > -----Ursprüngliche Nachricht----- > >> > Von: Andrew Hughes [mailto:ahhug...@gmail.com] > >> > Gesendet: Dienstag, 1. Dezember 2009 12:13 > >> > An: Maven Users List > >> > Betreff: jaxb2-maven-plugin : Two declarations cause a collision > >> > > >> > Hi All, > >> > > >> > I am trying to generate classes for the Google/OGC KML 2.2 XSD's with > >> > the jaxb2-maven-plugin > >> > (http://mojo.codehaus.org/jaxb2-maven-plugin/index.html). > >> > > >> > - http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd > >> > - http://schemas.opengis.net/kml/2.2.0/atom-author-link.xsd > >> > > >> > Both XSD's have an element: > >> > > >> > - > >> > > >> > <element name="name" type="string"/> > >> > > >> > > >> > Which fails giving: > >> > > >> > - "Two declarations cause a collision in the ObjectFactory class" > >> > > >> > This I am ok with, but the resolution is confusing me, this problem is > >> even > >> > in the plugin's FAQ page ( > >> > http://mojo.codehaus.org/jaxb2-maven-plugin/faq.html): > >> > > >> > *I have different schemas and want different packages for those > schemas, > >> > how > >> > do I do this?* > >> > > >> > *You want to create multiple executions in your plugin declaration. > This > >> > will allow you to have multiple configuration declarations and you can > >> > specify the schema and package to be run for that execution. In your > >> > configuation, you will need to have a different staleFile for each > >> > execution, so it will be able to determine if the xjc needs to be > >> > executed.* > >> > > >> > I have tried to add two seperate <executions> like the FAQ says, but > it > >> > still fails :'( Possibly because ogckml22.xsd includes the > >> > atom-author-link.xsd? > >> > > >> > <build> > >> > <plugins> > >> > <plugin> > >> > <groupId>org.codehaus.mojo</groupId> > >> > <artifactId>jaxb2-maven-plugin</artifactId> > >> > <version>1.2</version> > >> > <executions> > >> > <execution> > >> > <id>ogckml22</id> > >> > <configuration> > >> > <packageName>java.lunch20091126xml.binding.kml</packageName> > >> > <schemaFiles>ogckml22.xsd</schemaFiles> > >> > > >> > > >> > <staleFlag>${project.build.directory}/generated-sources/jaxb/.staleFlag-ogckml22</staleFlag> > >> > </configuration> > >> > <goals> > >> > <goal>xjc</goal> > >> > </goals> > >> > </execution> > >> > <execution> > >> > <id>atom-author-link</id> > >> > <configuration> > >> > <packageName>java.lunch20091126xml.binding.atom</packageName> > >> > <schemaFiles>atom-author-link.xsd</schemaFiles> > >> > > >> > > >> > <staleFlag>${project.build.directory}/generated-sources/jaxb/.staleFlag-atom-author-link</staleFlag> > >> > </configuration> > >> > <goals> > >> > <goal>xjc</goal> > >> > </goals> > >> > </execution> > >> > </executions> > >> > </plugin> > >> > > >> > > >> > ANY help would be absolutely fantastic!!!!! > >> > > >> > --------------------------------------------------------------------- > >> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > >> > For additional commands, e-mail: users-h...@maven.apache.org > >> > > >> > > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > >> For additional commands, e-mail: users-h...@maven.apache.org > >> > >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >