28 February 2011

Maven 2.1 site command trouble

The maven site command allows you to generate project documentation, as explained in an earlier post for maven 2.0.

Running  mvn:site with Maven version 2.1, I had some problems however:

  1.  site plugin version error
    SiteToolException: ArtifactNotFoundException: The skin does not exist: Un able to determine the release version
    Apparently the skin plugin does not install automatically with a version, so force the issue, from the command line:
    $ svn checkout http://svn.apache.org/repos/asf/maven/skins/trunk/
    $ cd trunk
    $ mvn install -DupdateReleaseInfo=true
  2. doxia ArrayIndexOutOfBoundsException
    [WARNING] Deprecated API called - not org.apache.maven.doxia.sink.Sink
    instance and no SinkFactory available. Please update this plugin.
    [INFO] ------------------------------------------------------------------------
    [ERROR] FATAL ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] 1
    [INFO] ------------------------------------------------------------------------
    [DEBUG] Trace
    java.lang.ArrayIndexOutOfBoundsException: 1
            at org.apache.maven.doxia.module.xhtml.XhtmlSink.tableCell(XhtmlSink.java:791) 
    This error is caused by some maven/module version mismatches.
    To solve this second issue, add a <pluginManagement> element under the build element to set compatible versions. <pluginManagement> has a <plugins> child element. Do not confuse this with the <plugins> child of the <buid> element.
    <project>
       ...
       <build>
         <pluginManagement>
             <plugins>
               <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-site-plugin</artifactId>
                 <version>2.1.1</version>
                 <dependencies>
                   <dependency>
                    <groupId>commons-httpclient</groupId>
                    <artifactId>commons-httpclient</artifactId>
                    <version>3.1</version>
                    <exclusions>
                     <exclusion>
                       <groupId>commons-logging</groupId>
                       <artifactId>commons-logging</artifactId>
                     </exclusion>
                   </exclusions>
                 </dependency>
                </dependencies>
              </plugin>
            </plugins>
        </pluginManagement>
        ...
     </build>
      ...
    </project>
    
     This modification takes care of the exception, and your documentation generation will succeed. The [WARNING]s above, however, will remain.

17 February 2011

6 January 2011

SearchBlox is free now

SearchBlox is an easy to use search server based on Apache Lucene.
It comes as Java web application which you just deploy in your web container.
Then you configure your search definitions through the web forms in the web application.
You can integrate with the search engine using a REST based API.
We have successfully integrated it in customer web sites without any hassle.
The good news is that from now on SearchBlox is free, as in free beer. It is still closed source however.

19 December 2010

Adding JSTL/JSP EL to your web applicaton (updated)

Quite some environments do not come with JSTL: Eclipse for JEE (Galileo), Tomcat 6, Jetty 6... Follow these steps to add them:

  1. Add JSTL
    Grab the JSTL API (jstl-api.jar) and JSTL implementation (jstl-impl-1.2.jar).
    Add the jars to your Container (e.g. Tomcat) lib directory (or your webapp lib).
    Alternatively add them using maven dependencies:
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>
    
  2. Make sure the web-app root element in web.xml supports at least servlet 2.4/JSP 2.0
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
     http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
    If you use <taglib> elements in web.xml, make sure they are embedded in a <jsp-config> element.

4 December 2010

Wikileaks: free speech to the test

As much as I understand that the US wants to protect its confidential information, incidents like these are a good test for democratic values. After all there's a lot of criticism on China. But just how much better are other regimes?

  • Wikileaks got bumped from US Amazon cloud servers. A good indication of inherent risks of control one has when running cloud based services.
  • Wikileaks was also removed from French servers. Because France does not want confidential diplomatic information of other coutnries to be available. I doubt that France is applying this as a general rule to all diplomatic information from all countires.
  • Wikileaks was removed from DNS provider EveryDNS, because it breached the terms of contract. The ongoing denial of service attacks against the site were compromising the service for other clients. Instead of giving good service and protection and going after the attackers, the service provider says the customer is in error? Fun: now botnets can remove all EveryDNS customers by picking them as a DOS target.
  • Paypal (a subsidiary of US based eBay) blocks donations for WikiLeaks because they do not transfer money for criminal activities. The strange thing about these actions by US companies is that they are based on private company regulations rather than public law.