Open xasx opened 8 years ago
Seems like a sane proposal. Not sure if we hacked the generated code or not. =( That might have to be factored into this.
I got a ways towards un-hacking the generated code a while back. I'll see if I can find it.
I had a look at this and the following configuration in pom.xml
generates the JAXB classes that match those in the src/main/java/com/github/sardine/model
. The differences that I spotted are:
SimplePrivilege
interface and its usagesprotected
and not private
(apparently hard to get around it without an XJC plugin according to http://stackoverflow.com/q/9377923/466738)SearchRequest
being generated as Searchrequest
Ace
, Acl
, All
, Authenticated
... etc. - 30+ of them. Can someone explain where they came from and if the XSD could be updated to incorporate these types? <plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.13.1</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemas>
<schema>
<fileset>
<directory>${basedir}</directory>
<includes>
<include>webdav.xsd</include>
</includes>
</fileset>
</schema>
</schemas>
<generatePackage>com.github.sardine.model</generatePackage>
<strict>false</strict>
</configuration>
</execution>
</executions>
</plugin>
Just a proposal:
You can make use of several maven plugins to eliminate the need of executing the
generate.sh
prior to the actual Maven build.There are several plugins out there:
maven-jaxb2-plugin:generate
- https://github.com/highsource/maven-jaxb2-plugin (corresponds to your existingxjc
invocation)jaxws:wsimport
- https://jax-ws-commons.java.net/jaxws-maven-plugin/wsimport-mojo.html (does even a bit more SOAPy stuff)After generation, you would tell Maven to respect the sources from the generated directory via the
build-helper-maven-plugin
- http://www.mojohaus.org/build-helper-maven-plugin/usage.html