mvn 3.0.3 + java 7 Datasource fail

11 11 2011

Okay just wanted to mention that if you’ve done a custom Datasource for java 6 and try to compile it with java 7 on maven using backwards compability you get this:


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on pr
oject wallboard-cisco-drivers: Compilation failure
[ERROR] \nino\develop\eclipseworkspace\projects\internalcomponents\Applications\wallboard\trunk\wallboard-cisco-dri
vers\src\main\java\com\netdesign\dao\cisco\general\DataSourceProvider.java:[149,43] error: is not abstract and does not override abstract method getParentLogger() in
CommonDataSource
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :wallboard-cisco-drivers
C:\nino\develop\eclipseworkspace\projects\internalcomponents\Applications\wallboard\trunk>

Please notice that i’ve specified this in my pom:

<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>

Only solution are to grab an old jdk 6 and compile it with that.. I was using jdk 1.7.0.

Feel free to correct me if im wrong somehow.





Building Software Cheat Sheet

10 12 2009

Building Software with a smile

I’ve been wanting to write this article for a while now, I use all my articles as personal notes, plus giving back to the community are something that counts in my book aswell. The article are about how we manage and build our software at work and the stuff im using for my private pet projects. It’s an ever evolving process, that will probably never stop. There’s always process’s that can be simplified. It’s a short article that you can use for getting a stack together quick. Enough chatter, onto the fun stuff 🙂

Methodologies

We try to adhere under the ideas of people like Robert Martin (whom have summed up a lot of ideas of other people), go grab clean code you wont regret it. In short write code in a minimalistic readable way, remember to test it, care about your code and smile. Clean code really has summed it all up. Although there’s a lot of books on the topic’s of coding, testing etc. It’s my favorite. Oh and do not forget something like scrum.

Language

I’m not going to rant about why but we use Java, there’s several reasons but I have no deeper feelings about this topic, I havent looked enough into Ruby, Scala etc. to be a judge. Mostly that there’s so many things available for Java, however the same are the case for Grails, Rails etc. I just like static languages a bit more. However the topics in are not in depth about Java.

Building System

We are using Apache Maven 2, which has some really nice features like it’s convenience over configuration. There’s very good integration towards build servers and a huge list of plug-ins that’ll to the job for you. Just rememberer do it the maven way, and let the system work for you, do not fight it 🙂 One side of Maven are testing, for that we are using a mixture of Junit4, Jmock and JBehave that ensures us maximum freedom and productivity.

Build Server

As for build server we are using Hudson, it’s simple and straight forward. It has great integration towards maven, I guess we could just as well have used Continuum but Hudson worked on first try Continuum did not. In Hudson we have three projects per Maven project, one for continuous integration and one for making a release and one for our metrics. The CI project are notified by our version system upon changes, then grabs the source and builds. The release project awaits when we are ready for a release, and then assigned build manager “clicks” build, awaits and downloads the finished release product, simple as that! The release process of course, checks out a fresh copy tags it in scm builds and releases/package the artifacts. I’ll write a bit about the metrics project below.

Metrics

Now what goes hand in hand with a build server are a metrics analyser like Sonar which actually are a bunch of subprojects packaged nicely together and presented in style. It’s really easy to add to any Maven project just have the sonar running and run mvn sonar:sonar and voila fresh metrics. Just remember sonar will only keep one set of metrics per day AFAIK.

Before I discovered Sonar I used a lot of time configuring Maven metric plugins. However Sonar does it all and easy, plus have a lot of features/plugins, like timeline hotspots and quick wins. Very nice all in all.

Version System

For scm we use Subversion, no real arguments here it works for me and I haven’t tried out any other scm. Most annoying thing though are that we are having some trouble using branches (svn 1.5 using eclipse/tortoise etc) otherwise not much to say. I’ve peeking a bit towards git, but haven’t had the time to go further.

Ticket System & Wiki

For Tickets/Defects/issues & Wiki we use trac. Reasons are that it’s simple and materialistic. Although sometimes to minimal, theres always a plugin that will just expand trac the way you want. Only thing that are bothersome is working with multiple trac sites. I’ve been eager to try redmine out, it seems like trac but can a bit more. So heres what im missing in trac:

  • Ticket dependencies
  • Multiple site support easy

IDE

We use Eclipse, mainly because it’s the one I’ve been using longest and one of our vendors has made a specific product based on eclipse. I’ve tried both subclipse and subversive, and can’t figure out what are best. None of them seems to be working optimally with branches. Only way to get a good diff when merging a branch are in svn command line :/ One note though we are limited to Eclipse 3.2 and plugins that support that. So it might be better in newer versions.

I’ve been told a couple of times by different people that idea, are better and actually will make you more productive. And now with the free community version I might give it a try.

Links

So following above, you should be set all the software mentioned in this article are free. Now go download and start making the world a better place. There’s a lot of projects out there waiting for you, either open source or for money. And just remember it’s better to try than not, some one once said it’s by our mistakes we learn 🙂

Stuff we use:

Stuff that i’d like to investigate:

Ohh and if you have any comment’s feel free to write.





Screencast: introducing Wicketstuff Iolite

4 09 2008

So without further delay watch the screencast below:





Making a Maven Archetype

3 09 2008

So I want to create a maven archetype. My first run at this were a couple of months ago, it were pretty hard but then again I built the archetype from scratch.

I use userlist’s a lot so and though that it were very awkward how I did the previous archetype. So I wrote maven user list asking and theres actually a maven goal for it. So you can create an archetype in 6 steps:

  1. Build a project that will act as a template for the archetype
  2. run mvn archetype:create-from-project , from the project folder
  3. Edit the generated archetype ( placed in target/generated-sources/archetype ), it might not pickup on everything that needs to be substituted.
  4. From target/generated-sources/archetype of the project template run mvn install
  5. Try the archetype yourself by running mvn archetype:generate -DarchetypeCatalog=local from a fresh directory
  6. Repeat the process until satisfied

Now this also works for projects consistent of modules, a project structure like below:

Root
|-Core
|-Web

Happy Archetyping:)