Wednesday 22 October 2008

tomcat 6 + facelets + maven

After creating a project with archetype softeu-archetype-jsf to make the webapp works with tomcat 6 do the following:

In your pom add in the add the following dependencies and repository:



javax.el
el-api
1.2
compile


com.sun.el
el-ri
1.0
compile



http://download.java.net/maven/2/
maven2-repository.dev.java.net
Java.net Repository for Maven 2

Thursday 16 October 2008

Blogger Syntax highlighting

Do exactly what he said.

Maven Surefire (JUnit) specific log4j configuration

To have a log4j configuration specific to your tests, for example if your normal log4 configuration write the logs in a file on server for a webapp, do the following:

  1. create a file src/test/resources/test-log4j.properties containing the configuration of log4j for your tests e.g. :

    log4j.rootLogger=DEBUG, R
    log4j.appender.R=org.apache.log4j.ConsoleAppender
    log4j.appender.R.layout=org.apache.log4j.PatternLayout
    log4j.appender.R.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{3}:%L - %m%n

  2. Edit your pom.xml like this:



    ...



    maven-surefire-plugin
    2.3




    log4j.configuration
    test-log4j.properties




    ...




  3. Note: my normal log4j.properties is located in src/main/webapp/WEB-INF/classes/.