When trying to "clean install" with maven2 I receive an error like this.
RoutingDataSource is not abstract and does not override method isWrapperFor(java.Lang.Class<?> in java.sql.Wrapper
But when I do a clean under Eclipse - Project the classes are compiled without any error, including this RoutingDataSource I have. Then I do a simple "install" with maven and it compiles fine. Because I never change the RoutingDataSource this is never altered and never need recompiling I could compile this once in eclipse and then just do a mvn install to get the war file. But I would like to be able to go mvn clean install.
RoutingDataSource is an implementation of Spring AbstractRoutingDataSource
java.sql.Wrapper is a new interface in Java 6. Many JDBC interfaces extend it, so these interfaces have a few new abstract methods. That means that any Java 5 code which implements (for example) javax.sql.DataSource will not compile with JDK 1.6, because those methods will go unimplemented! Isn't that special! I've had this sort of problem in the past, and it's always annoying when Sun makes a change like this.
Just to be perfectly clear: it looks like you're compiling with JDK 1.6 under Maven, and JDK 1.5 within Eclipse. If there's a Spring version for JDK 1.6 yet, then you need to get it. If not, then your choices are (1) Don't use JDK 1.6, or (2) implement the methods of java.sql.Wrapper in your concrete subclass as a workaround.
If you compile with javac from JDK 1.6, then it's going to use the 1.6 libraries, which will have this problem, even if you specify -source 1.5. The -source and -target switches don't actually check that your library usage conforms to the targeted JVM version.