After 4 days of Java One I got the chance to shift gears and head over to the Scala Lift Off unconference Saturday morning. The first thing I noticed was the audience: It was small (~60) and distinguished. Martin Odersky (of course!), Bill Vernners, Frank Sommers, Dick Wall, Carl Quinn, etc.
So I've been playing around with Scala for the last few months, and I like it. Allot of the stuff I hate about Java has been 'fixed'. What would you say about Java with closures, a lazy keyword (no more double check locking), no more 'static' keyword, etc. Pretty sweet. And it all compiles to byte code and runs on the JVM. You can pull across your favorite java libs (Hibernate on Scala? no problem! Scala and Swing, sure) I wish there had been more of a beginers track at the lift off, but to be honest after 4 days of tech session it was refreshing to get away from the code and talk about things on a more macro level).
Martin did the keynote kick off. The biggest announcement was that he is freezing new features on Scala. There will be a research and academia branch of the code for people that want to add new stuff.
Discussion topics included marketing Scala, JAM/OSgi and Scala, governance, IDE plugins, Martin did a spreadsheet example from his book. mapping OR objects to Scala, and lift.
Dick Wall also announced he will kicking off a Scala users group. There will be a meta meeting this week at the Google campus.
Sunday, May 11, 2008
Tuesday, February 5, 2008
Schemagen maven plugin for jaxb
So you've annotated all those java classes and now you want to pump out an xsd. Oh wait, you gotta do this in maven. Well, you're in luck, there is a schemagen maven plugin (see here), but it's not documented very well.
Here's a working example of using the plugin in your pom file:
Here's a working example of using the plugin in your pom file:
<plugins>Here I'm dropping it into the classes directory where it will end up in my artifact (a jar file in this case), so the xsd will travel with the jaxb objects inside the jar.
.........
<plugin>
<groupId>com.sun.tools.jxc.maven2</groupId>
<artifactId>maven-jaxb-schemagen-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<destdir>${project.build.directory}/classes</destdir>
<schemas>
<schema>
<namespace>http://www.company.com/ILikeRest</namespace>
<file>api.xsd</file>
</schema>
</schemas>
<excludes>
<exclude>**/*Adapter.java</exclude>
</excludes>
<includes>
<include>**/com/company/jaxb/*</include>
</includes>
<srcdir>${project.build.sourceDirectory}</srcdir>
<verbose>true</verbose>
</configuration>
</plugin>
.........
</plugins>
Subscribe to:
Comments (Atom)