maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Hughes <ahhug...@gmail.com>
Subject Re: jaxb2-maven-plugin : Two declarations cause a collision
Date Tue, 01 Dec 2009 13:02:57 GMT
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.Harald@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:ahhughes@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.Harald@afb.de>
> wrote:
>
> > Hi Andrew,
> >
> > try removing the packageName in the pom.xml file.
> >
> > -----Urspr√ľngliche Nachricht-----
> > Von: Andrew Hughes [mailto:ahhughes@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-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message