« home

Random Project Updates

Haven’t made any project related post since July last year, so here’s a list of little things I spent some time on: While playing around with Firefox Web Developer Extension, I found out that some Maven reports generated invalid HTML which could break the reports layout with non-default vm templates. Hence MFINDBUGS-29, MCHECKSTYLE-74, and MCHANGES-83. After integrating Kaptcha in SCode Plugin 0.5, I spent some time working on the Kaptcha project itself where most of the effort was on refactoring the original SimpleCaptcha code.…

more »

Going Java 1.5 With Maven2-Based Project

I recently made some simple updates to Wish by using Java 1.5 generics and autoboxing/unboxing. Making Java source changes was the easy part, while the time consuming part was on hunting for information on Maven-related changes. I started by changing maven-compiler-plugin source and target in pom.xml: <build> <plugins> ... <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> ... </plugins> </build> And got this error upon running mvn site Caused by: net.sourceforge.pmd.ast.ParseException: Can't use generics unless running in JDK 1.5 mode!…

more »

JSP Precompilation For Maven2 Project

You can precompile JSP as part of your Maven2 project build by using Maven2 JSPC Plugin. Follow the usage guide for copy-paste samples to add insert-fragment in web.xml file and jspc-maven-plugin + maven-war-plugin as part of build plugins in pom.xml file. Here are some problems that I encountered while adding JSP precompilation to Wish: Some of the JSPs use SiteMesh taglib and since the application only needed it as part of the war package, I originally set the dependency scope to be runtime.…

more »

My Maven2 Cheat Sheet

posted on

Here are some Maven2 command lines that I use most often: To create a new project: mvn archetype:create -DgroupId=com.mbledug.foo -DartifactId=bar To generate Eclipse project descriptor after configuring the dependencies in pom.xml: mvn eclipse:eclipse To run unit tests, obviously: mvn test Tun run a single test by test class name: mvn test -Dtest=FooBar To generate site documentation without running the tests (handy while updating the APTs): mvn -Dmaven.test.skip=true clean site To…

more »

Tagyu4J v0.3 and BlogMap4J v0.2 - More On Maven

Tagyu4J v0.3 and BlogMap4J v0.2 have been released. Included in this release: The use of Maven2. Spent some time on figuring out the equivalent of Maven1 goals in Maven2, e.g. distribution plugin in Maven1 is now assembly plugin in Maven2. Project sites (BlogMap4J, Tagyu4J) are now generated by Maven. It reminds me of the old days of using Forrest 0.6 back in 2004. Lots of code refactoring, lots of ‘Why did I do it that way?’ moments.…

more »

Corrupted Jar On Local Maven Repository

test:test: [junit] Running foo.bar.BlahTestCase java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:111) at java.util.zip.ZipFile.<init>(ZipFile.java:127) at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:870) at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:799) After staring blankly on why the test failed with Maven but it was ok as a stand-alone, I remembered that I had this problem before. It was caused by corrupted jar on my local maven repository. The solution was to simply destroy the repository and rebuild it.…

more »