Monday, July 5, 2010

maven site:site

maven site:site used to work fine to a certain degree - but the last run was disturbed by a little exception:
java.lang.ArrayIndexOutOfBoundsException: 1         at org.apache.maven.doxia.module.xhtml.XhtmlSink.tableCell(XhtmlSink.java:791)

It can be resolved by setting by setting the explicit version for the plugin:
     
        org.apache.maven.plugins
        maven-site-plugin
        2.1.1
       
       

     
although many warnings where produced like [WARNING] Deprecated API called - not org.apache.maven.doxia.sink.Sink instance and no SinkFactory available. Please update this plugin.
So don't panic ;)

Tuesday, May 18, 2010

maven dependency conflicts

One thing about maven can be really frustrating. And it does not have anything to do with maven itself but with the repository maintaince.
Broken poms, missing jars, unmaintained 3rd party repos etc - this can result in quite a dependency hell as in the end you will need to put everything together like you did without maven. (and manual mvn install of many deps can take quite some time ..)
One thing should actually be clear - for more sophisticated projects with many dependencies - a local custom repository with which a clear dependency structure is maintained is more than necessary. This also provides a clear separation between external and internal repositories and also allows you to easily publish custom project releases and snapshots. Artifactory for example provides exactly that functionality and is easily installed and maintained.

In the end even with dependency conflicts etc - maven still provides the tools to organize your projects in a standardized way with awesome extensibility. But it should be used with care as it is not always as easy as setting the dependencies and .. go ;)

Wednesday, February 3, 2010

maven quirks

Things that are problematic with maven:

dependency management
correctly configured maven offers to automagically handles the dependency management of your project - after defining your projects dependencies maven will fetch them from the repository (internet) and install them in your local repository.
So far so good - the dependencies themselves usually also have dependencies and maven will fetch all of them for you.
The problems start when there dependency conflicts or references to direct implementations of e.g. loggers etc. Sometimes libraries depend on a different build of dependencies - like 1.5 builds vs 1.6 builds or a nodeps build vs a build with several smaller jar files.
To resolve that I specified exclusions and specific version imports for the dependencies in question. Netbeans offers a nice dependency viewer which even offers to view and resolve conflicts with just a mouseclick.

memory
as maven usually starts quite many task directly from the same java vm (there are exceptions which fork the java vm) you may have to be careful to offer maven enough java heap space for the build.
It is the same for ant but it should be mentioned.
(This of course depends on the size of the project)

maven

I switched from ant to maven quite a while ago and after sorting out some quirks and problems it is working nicely.
One thing that's immediately evident ist - as soon as you use maven your requirements change - as there are so many possibilities - like generating project documentation, code metrics and so on.
There are also so many interesting plugins/mojos available that soon you will like and use.
The maven integration in netbeans(6.8) is also great and even superior to the ant project system in my opinion because of the higher feature set which is provided by maven out of the box.
There are definitly things to sort out when using maven - and it is far from perfect but i think it offers a nice standardized way to organize and build projects with the possibilty to add plugins easily.

Saturday, January 23, 2010

git

after doing the commit on the commandline nb still showed all changes - and a status update did use all cpu and was slow as hell - it took about 1s per file to refresh - and at one point it got stuck again.
To resolve this I cleared the netbeans cache after that everything went just fine. Commits themselves are much faster then using svn. It just seems that the plugin cannot handle huge commits as well as the svn plugin at the moment.

git

well i converted my svn repo to git - looks good.
I used the git netbeans plugin - it still is a bit shaky - and it doesn't have as many features as the svn plugin. I am especially missing the "show changes" view.
When trying to do a rather big commit in netbeans - it hung at a point.
I needed to kill the commit process - remove the git lock file. I then run the commit from the commandline and it worked just fine.
svn support for applications is still much farther than git but i hope that will improve in the future.