<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>apache-maven &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/apache-maven/</link>
	<description>Feed of posts on WordPress.com tagged "apache-maven"</description>
	<pubDate>Wed, 10 Feb 2010 08:27:51 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Apache Maven Beispiel]]></title>
<link>http://myminutes.wordpress.com/2009/10/30/apache-maven-beispiel/</link>
<pubDate>Fri, 30 Oct 2009 16:26:08 +0000</pubDate>
<dc:creator>dedeibel</dc:creator>
<guid>http://myminutes.wordpress.com/2009/10/30/apache-maven-beispiel/</guid>
<description><![CDATA[Maven ist ein build Tool und Framework für java, welches es sich zum Ziel gemacht hat dem Anwender m]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Maven ist ein build Tool und Framework für java, welches es sich zum Ziel gemacht hat dem Anwender möglichst viele Schritte abzunehmen. In der allmächtigen pom.xml werden alle relevanten Optionen konfiguriert und ansonsten mit Konventionen in Form von Verzeichnissturktur und Dateinamen gearbeitet.</p>
<p>Das Framework erhält durch seine Pluginfähigkeit eine gute Flexiblität und ermöglicht viele Aufgaben durch ein wenig Konfiguration zu lösen.</p>
<p>Ich will hier eine maven Version meines vorherigen <a href="http://myminutes.wordpress.com/2009/10/30/apache-ant-beispiel/">Apache ant Beispiels</a> zeigen, die zum gleichen Ergebnis führt. Zudem gibt es einen kleinen Unit-Test, da das Framework deren Einbindung direkt mitbringt.</p>
<p>(Die resource files und merge Datei liegen bewusst in einem Verzeichnis um herauszufinden wie man die Filter verwendet.)</p>
<h2>Code</h2>
<h3>Verzeichnisstruktur</h3>
<p>Die Grundstruktur von Maven ist dabei standardmäßig wie folgt:</p>
<pre class="brush: plain;">
pom.xml
src/main
src/resources
src/test
src/test/resources
</pre>
<p>Im Beispiel:</p>
<pre class="brush: plain;">
./pom.xml

./src
./src/main
./src/main/java
./src/main/java/de
./src/main/java/de/benjaminpeter
./src/main/java/de/benjaminpeter/print
./src/main/java/de/benjaminpeter/print/LoadFile.java
./src/main/java/de/benjaminpeter/print/Print.java

./src/main/resources
./src/main/resources/resources
./src/main/resources/resources/inputA
./src/main/resources/resources/inputB
./src/main/resources/resources/merge
./src/main/resources/resources/file

./src/test
./src/test/java
./src/test/java/de
./src/test/java/de/benjaminpeter
./src/test/java/de/benjaminpeter/print
./src/test/java/de/benjaminpeter/print/LoadFileTest.java

./src/test/resources
./src/test/resources/resources
./src/test/resources/resources/file
</pre>
<h3>Java src (analog zum ant Beispiel)</h3>
<pre class="brush: java;">
import java.io.*;
import java.lang.*;

public class LoadFile {
  public String load() throws FileNotFoundException, UnsupportedEncodingException, IOException {
    // File file = new File(&#34;resources/file&#34;);
    // FileInputStream fis = new FileInputStream(file);
    // Datei ist nun im jar, also muss sie anders geladen werden
    ClassLoader cl  = this.getClass().getClassLoader();
    InputStream fis = cl.getResourceAsStream(&#34;resources/file&#34;);
    // import groovy ... file.text ... :-/
    BufferedReader in = new BufferedReader(new InputStreamReader(fis));
    String str = &#34;&#34;;
    String ret = &#34;&#34;;
    while ((str = in.readLine()) != null) ret += str + '\n';
    return ret.substring(0, ret.length() - 1);
  }
}

import java.lang.*;

public class Print {
  public static void main(String[] args) {
    System.out.println(&#34;Hello.&#34;);
    try {
      System.out.println(&#34;Content:\n&#34;+
        new LoadFile().load());
    }
    catch (Exception e) {
      System.err.println(&#34;Error: &#34;+ e.getMessage());
    }
  }
}
</pre>
<h3>Ressourcen</h3>
<pre class="brush: plain;">
File: resources/file

A: Build @buildNumber@
If the writeList method doesn't
catch the checked exceptions
that can occur within it, the
writeList method must specify
that it can throw these
exceptions. Let's modify the
B:
original writeList method to
specify the exceptions it can
throw instead of catching
them. To remind you, here's
the original version of the
writeList method that won't
compile.
File: resources/inputA

A: Build @buildNumber@
If the writeList method doesn't
catch the checked exceptions
that can occur within it, the
writeList method must specify
that it can throw these
exceptions. Let's modify the
File: resources/inputB

B:
original writeList method to
specify the exceptions it can
throw instead of catching
them. To remind you, here's
the original version of the
writeList method that won't
compile.
File: resources/merge

#!/bin/sh
cat $1 $2 &#62; $3
</pre>
<p>Hierbei musste ich @date@ zu @buildNumber@ ändern, da es <em>ohne größeren Aufwand</em> nicht möglich properties in anderen properties zu verwenden. <em>(Falls es jemand besser weiß immer her damit, finde das durchaus wichtig)</em></p>
<h3>pom.xml</h3>
<pre class="brush: xml;">
&#60;project
   xmlns=&#34;http://maven.apache.org/POM/4.0.0&#34;
   xmlns:xsi=&#34;http://www.w3.org/2001/XMLSchema-instance&#34;
   xsi:schemaLocation=&#34;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&#34;&#62;
  &#60;!-- Basisinformationen zum Projekt --&#62;
  &#60;modelVersion&#62;4.0.0&#60;/modelVersion&#62;
  &#60;groupId&#62;de.benjaminpeter.print&#60;/groupId&#62;
  &#60;artifactId&#62;Print&#60;/artifactId&#62;
  &#60;packaging&#62;jar&#60;/packaging&#62;
  &#60;!-- Version des Projekts in maven, der Name des
       Jars kann noch einmal extra definiert werden! --&#62;
  &#60;version&#62;0.0.1&#60;/version&#62;
  &#60;name&#62;Print&#60;/name&#62;
  &#60;url&#62;http://maven.apache.org&#60;/url&#62;
  &#60;!-- Default dependency fuer Unit-Tests, bibliothek
     wird automatisch herunter geladen --&#62;
  &#60;dependencies&#62;
    &#60;dependency&#62;
      &#60;groupId&#62;junit&#60;/groupId&#62;
      &#60;artifactId&#62;junit&#60;/artifactId&#62;
      &#60;version&#62;3.8.1&#60;/version&#62;
      &#60;!-- scope:
           Gibt an, dass diese Abhaengigkeit nur
           zum Testen benötigt wird. Das heißt sie wird
           auch nur beim Ausführen der Tests
           heruntergeladen und ist im
           finalen jar/war nicht enthalten. --&#62;
      &#60;scope&#62;test&#60;/scope&#62;
    &#60;/dependency&#62;
  &#60;/dependencies&#62;
  &#60;build&#62;
    &#60;!-- Binde die resource &#34;resources/file&#34; ein, dies
         wird dynamisch erzeugt wie wir später sehen. --&#62;
    &#60;resources&#62;
      &#60;resource&#62;
        &#60;directory&#62;src/main/resources&#60;/directory&#62;
        &#60;includes&#62;
          &#60;include&#62;resources/file&#60;/include&#62;
        &#60;/includes&#62;
         &#60;!-- Zudem soll hier das
          Filtering aktiviert werden,
         das heißt wir lassen maven einen
         Platzhalter @buildNumber@ in der
         Datei ersetzen. --&#62;
        &#60;filtering&#62;true&#60;/filtering&#62;
      &#60;/resource&#62;
    &#60;/resources&#62;
    &#60;plugins&#62;
      &#60;!--
        Binde ein Plugin ein um die Build Nummer
        variabler erstellen zu können. Hiermit machen
        wir die Variable buildNumber vom aktuellen
        Datum abhängig.
        Auch das Plugin wird von maven bei Bedarf
        dynamisch herunter geladen. --&#62;
      &#60;plugin&#62;
        &#60;groupId&#62;org.codehaus.mojo&#60;/groupId&#62;
        &#60;artifactId&#62;buildnumber-maven-plugin&#60;/artifactId&#62;
        &#60;configuration&#62;
          &#60;format&#62;{0,date,yyyyMMdd}&#60;/format&#62;
          &#60;items&#62;
            &#60;item&#62;timestamp&#60;/item&#62;
          &#60;/items&#62;
        &#60;/configuration&#62;
        &#60;!-- Diese Block besagt, dass das Plugin in
             der validierungsphase (ganz am Anfang)
             ausgeführt werden soll. create ist dabei
             eine von mehreren Funktionen des Plugins
             die dabei aufgerufen werden soll. --&#62;
        &#60;executions&#62;
          &#60;execution&#62;
            &#60;phase&#62;validate&#60;/phase&#62;
            &#60;goals&#62;
              &#60;goal&#62;create&#60;/goal&#62;
            &#60;/goals&#62;
          &#60;/execution&#62;
        &#60;/executions&#62;
       &#60;/plugin&#62;
       &#60;!-- Mit dem jar Plugin können wir
          die Erzeugung des jar Files etwas
          anpassen. So setzen wir hier die
          MainClass fest um ein einfach
         ausführbares jar zu bekommen. --&#62;
       &#60;plugin&#62;
         &#60;groupId&#62;org.apache.maven.plugins&#60;/groupId&#62;
         &#60;artifactId&#62;maven-jar-plugin&#60;/artifactId&#62;
         &#60;configuration&#62;
           &#60;archive&#62;
            &#60;manifest&#62;
              &#60;mainClass&#62;Print&#60;/mainClass&#62;
              &#60;packageName&#62;&#60;/packageName&#62;
            &#60;/manifest&#62;
            &#60;manifestEntries&#62;
              &#60;mode&#62;development&#60;/mode&#62;
              &#60;url&#62;${pom.url}&#60;/url&#62;
            &#60;/manifestEntries&#62;
          &#60;/archive&#62;
        &#60;/configuration&#62;
      &#60;/plugin&#62;
      &#60;!-- exec Plugin, dies ermöglicht es alle
           Schweinereien zu machen die man
           sonst nicht hinbekommt.
           Wird hier auch zur Verfizierungsphase
           ausgeführt und ruft den Befehl &#34;merge&#34;
           aus dem resources Verzeichnis auf
          um die Datei &#34;file&#34; zu erzeugen.

           An dieser Stelle könnte man sicher auch
           ein Ant Plugin einbinden um komplexere
           Abläufe zu realisieren und Abhängigkeiten
           sowie bereits angelegte Dateien erkennen
           zu können. --&#62;
      &#60;plugin&#62;
        &#60;groupId&#62;org.codehaus.mojo&#60;/groupId&#62;
        &#60;artifactId&#62;exec-maven-plugin&#60;/artifactId&#62;
        &#60;version&#62;1.1&#60;/version&#62;
        &#60;executions&#62;
          &#60;execution&#62;
            &#60;phase&#62;verify&#60;/phase&#62;
            &#60;goals&#62;
              &#60;goal&#62;exec&#60;/goal&#62;
            &#60;/goals&#62;
          &#60;/execution&#62;
        &#60;/executions&#62;
        &#60;configuration&#62;
          &#60;executable&#62;./merge&#60;/executable&#62;
          &#60;workingDirectory&#62;${basedir}/src/main/resources/resources&#60;/workingDirectory&#62;
          &#60;arguments&#62;
            &#60;argument&#62;inputA&#60;/argument&#62;
            &#60;argument&#62;inputB&#60;/argument&#62;
            &#60;argument&#62;file&#60;/argument&#62;
          &#60;/arguments&#62;
        &#60;/configuration&#62;
      &#60;/plugin&#62;
    &#60;/plugins&#62;
    &#60;!-- Setze den Namen der jar Datei so, dass
         auch unsere im Plugin
         erzeugte buildNumber eingesetzt wird. --&#62;
    &#60;finalName&#62;${project.artifactId}-${buildNumber}&#60;/finalName&#62;
  &#60;/build&#62;
  &#60;properties&#62;
    &#60;!-- Funktioniert leider nicht :-/ --&#62;
    &#60;date&#62;${buildNumber}&#60;/date&#62;
  &#60;/properties&#62;
&#60;/project&#62;
</pre>
<h2>Ausführung</h2>
<h3>Build</h3>
<pre class="brush: plain;">
$ mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Print
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/net/java/dev/jna/jna/3.0.5/jna-3.0.5.pom
Downloading: http://repo1.maven.org/maven2/net/java/dev/jna/jna/3.0.5/jna-3.0.5.pom
[INFO] [buildnumber:create {execution: default}]
[INFO] Storing buildNumber: 20091030 at timestamp: 1256918122611
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 2 source files to /home/dedeibel/proggn/java/test/mvn-example/Print/target/classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 1 source file to /home/dedeibel/proggn/java/test/mvn-example/Print/target/test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: /home/dedeibel/proggn/java/test/mvn-example/Print/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running LoadFileTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] [jar:jar]
[INFO] Building jar: /home/dedeibel/proggn/java/test/mvn-example/Print/target/Print-20091030.jar
[INFO] [exec:exec {execution: default}]
[INFO] [install:install]
[INFO] Installing /home/dedeibel/proggn/java/test/mvn-example/Print/target/Print-20091030.jar to /home/dedeibel/.m2/repository/de/benjaminpeter/print/Print/0.0.1/Print-0.0.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 seconds
[INFO] Finished at: Fri Oct 30 16:55:26 CET 2009
[INFO] Final Memory: 31M/290M
[INFO] ------------------------------------------------------------------------
</pre>
<h3>Programm</h3>
<pre class="brush: plain;">
$ java -jar target/Print-20091030.jar
Hello.
Content:
A: Build 20091030
If the writeList method doesn't
catch the checked exceptions
that can occur within it, the
writeList method must specify
that it can throw these
exceptions. Let's modify the
B:
original writeList method to
specify the exceptions it can
throw instead of catching
them. To remind you, here's
the original version of the
writeList method that won't
compile.
</pre>
<h2>Fazit</h2>
<p>Den direkten Vergleich zwischen ant und maven fand ich sehr interessant. Im kleinen Beispiel kann man die Stärken von maven jedoch nur erahnen. So hätte es bei ant wieder einer extra Einbindung der Unit-Tests bedurft, die aber im Grunde für jedes Projekt gleich ist wenn man sich an die Konventionen hält. Weiterhin musste kein Finger krum gemacht werden um eine aktuelle Version der junit Abhängigkeit zu bekommen; ein großer Vorteil bei einem Umzug auf ein anderes System, sofort werden die benötigten Abhängigkeiten ohne Aufwand nachgezogen.</p>
<p>Der Teufel steckt im Detail, während das Anpassen des Dateinamens und Ausführen des merge Skripts bei ant ein Kinderspiel sind, da man hier direkt auf die Abhängigkeiten und jar Erstellung Einfluss hat, scheint der Weg bei Maven für alles ein Plugin installieren zu müssen doch etwas umständlich. Letztendlich ist es aber eine Gute Sache, da es Plugins für die Unterschiedlichsten Aufgaben gibt und diese einem wie maven selbst möglichst viel Arbeit abnehmen. Allgemein sollte man sich vielleicht weniger mit Details aufhalten und gerade bei Verwendung von Frameworks Kompromisse eingehen und sich an die Gegebenheiten gewöhnen. Bei großen Projekten ist es auch so schwer genug die Übersicht zu behalten.</p>
<h2>Quellen</h2>
<p><a href="http://maven.apache.org/">Apache maven</a><br />
<a href="http://maven.apache.org/guides/getting-started/">Maven getting started</a></p>
<p><em>Die Vernachlässigung von tollen Namespaces für meine Klassen sie mir verziehen.</em></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ Maven Cargo Pulgin to support hot deployment in Tomcat]]></title>
<link>http://rajaysh.wordpress.com/2009/10/29/maven-cargo-pulgin-to-support-hot-deployment-in-tomcat/</link>
<pubDate>Thu, 29 Oct 2009 22:27:24 +0000</pubDate>
<dc:creator>R@JE$H</dc:creator>
<guid>http://rajaysh.wordpress.com/2009/10/29/maven-cargo-pulgin-to-support-hot-deployment-in-tomcat/</guid>
<description><![CDATA[The following is the sample snippet used to perform remote deployment in tomcat using cargo plugin ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>The following is the sample snippet used to perform remote deployment in tomcat using cargo plugin</p>
<p style="text-align:left;">&#60;build&#62;<br />
&#60;plugins&#62;<br />
&#60;plugin&#62;<br />
&#60;groupId&#62;org.codehaus.cargo&#60;/groupId&#62;<br />
&#60;artifactId&#62;cargo-maven2-plugin&#60;/artifactId&#62;<br />
&#60;configuration&#62;<br />
&#60;container&#62;<br />
&#60;containerId&#62;tomcat5x&#60;/containerId&#62;<br />
&#60;type&#62;remote&#60;/type&#62;<br />
&#60;/container&#62;<br />
&#60;configuration&#62;<br />
&#60;type&#62;runtime&#60;/type&#62;<br />
&#60;properties&#62;<br />
&#60;cargo.tomcat.manager.url&#62;http://localhost:8080/manager/html&#60;/cargo.tomcat.manager.url&#62;<br />
&#60;cargo.remote.username&#62;admin&#60;/cargo.remote.username&#62;<br />
&#60;cargo.remote.password&#62;admin&#60;/cargo.remote.password&#62;<br />
&#60;/properties&#62;<br />
&#60;deployables&#62;<br />
&#60;deployable&#62;<br />
&#60;groupId&#62;groupId&#60;/groupId&#62;<br />
&#60;artifactId&#62;artifactId&#60;/artifactId&#62;<br />
&#60;type&#62;war&#60;/type&#62;<br />
&#60;/deployable&#62;<br />
&#60;/deployables&#62;<br />
&#60;/configuration&#62;<br />
&#60;/configuration&#62;<br />
&#60;/plugin&#62;<br />
&#60;/plugins&#62;<br />
&#60;/build&#62;</p>
<p>&#8211;&#62; check your  %TOMAT_HOME%/conf/tomcat-users.xml for tomcat manager user name and password</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Notes on the Spring-WS tutorial]]></title>
<link>http://razvanp.wordpress.com/2009/09/26/notes-on-the-spring-ws-tutorial/</link>
<pubDate>Sat, 26 Sep 2009 18:42:21 +0000</pubDate>
<dc:creator>razvanp</dc:creator>
<guid>http://razvanp.wordpress.com/2009/09/26/notes-on-the-spring-ws-tutorial/</guid>
<description><![CDATA[Today I have reviewed a proof of concept I have done in order to decide which Web Services framework]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Today I have reviewed a proof of concept I have done in order to decide which Web Services framework matches the requirements of a bioinformatics project. Because of forgetting to store a file in the versioning system, I had to review the whole tutorial and to look for the file within the Spring tutorial. What is interesting, until now nobody published the full content of the Spring-WS tutorial.</p>
<p>So, here is my pom.xml. I am using Apache Maven2 in order to strictly enforce the versions of the JAR files. Nobody is constrained to use Maven, but without it, it would be very difficult to sort out the transient dependencies.</p>
<pre>&#60;?xml version="1.0" encoding="UTF-8"?&#62;
&#60;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&#62;
 &#60;modelVersion&#62;4.0.0&#60;/modelVersion&#62;
 &#60;groupId&#62;com.razvan.hr&#60;/groupId&#62;
 &#60;artifactId&#62;holidayService&#60;/artifactId&#62;
 &#60;packaging&#62;war&#60;/packaging&#62;
 &#60;version&#62;1.0-SNAPSHOT&#60;/version&#62;
 &#60;name&#62;holidayService Spring-WS Application&#60;/name&#62;
 &#60;url&#62;http://www.springframework.org/spring-ws&#60;/url&#62;
 &#60;build&#62;
 &#60;finalName&#62;holidayService&#60;/finalName&#62;
 &#60;plugins&#62;
 &#60;plugin&#62;
 &#60;groupId&#62;org.mortbay.jetty&#60;/groupId&#62;
 &#60;version&#62;6.1.9&#60;/version&#62;
 &#60;artifactId&#62;maven-jetty-plugin&#60;/artifactId&#62;
 &#60;/plugin&#62;
 &#60;/plugins&#62;
 &#60;/build&#62;
 &#60;dependencies&#62;
 &#60;dependency&#62;
 &#60;groupId&#62;org.springframework.ws&#60;/groupId&#62;
 &#60;artifactId&#62;spring-ws-core&#60;/artifactId&#62;
 &#60;version&#62;1.5.8&#60;/version&#62;
 &#60;/dependency&#62;
 &#60;dependency&#62;
 &#60;groupId&#62;jdom&#60;/groupId&#62;
 &#60;artifactId&#62;jdom&#60;/artifactId&#62;
 &#60;version&#62;1.0&#60;/version&#62;
 &#60;/dependency&#62;
 &#60;dependency&#62; &#60;!-- required by AbstractJDomPayloadEndpoint --&#62;
 &#60;groupId&#62;jaxen&#60;/groupId&#62;
 &#60;artifactId&#62;jaxen&#60;/artifactId&#62;
 &#60;version&#62;1.1&#60;/version&#62;
 &#60;scope&#62;runtime&#60;/scope&#62;
 &#60;/dependency&#62;
 &#60;dependency&#62;
 &#60;groupId&#62;javax.xml.soap&#60;/groupId&#62;
 &#60;artifactId&#62;saaj-api&#60;/artifactId&#62;
 &#60;version&#62;1.3&#60;/version&#62;
 &#60;scope&#62;runtime&#60;/scope&#62;
 &#60;/dependency&#62;
 &#60;dependency&#62;
 &#60;groupId&#62;com.sun.xml.messaging.saaj&#60;/groupId&#62;
 &#60;artifactId&#62;saaj-impl&#60;/artifactId&#62;
 &#60;version&#62;1.3&#60;/version&#62;
 &#60;scope&#62;runtime&#60;/scope&#62;
 &#60;/dependency&#62;
 &#60;dependency&#62;
 &#60;groupId&#62;xalan&#60;/groupId&#62;
 &#60;artifactId&#62;xalan&#60;/artifactId&#62;
 &#60;version&#62;2.7.1&#60;/version&#62;
 &#60;/dependency&#62;
 &#60;/dependencies&#62;
&#60;/project&#62;
</pre>
<p>I am using the jetty plugin in order to be able to run the application right from the command line; xalan dependency is required in order to avoid the exception &#8220;java.lang.IllegalStateException: Could not find SAAJ on the classpath&#8221; thrown by Spring-WS, corrected in a newer version of xalan.</p>
<p>Also according to the tutorial, the file spring-ws-servlet.xml, a regular Spring context file, describes the external interface of the Web Service and the associated Java classes. This file has to be placed in the src/main/webapp/WEB-INF directory.</p>
<pre>&#60;?xml version="1.0" encoding="UTF-8"?&#62;
&#60;beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"&#62;

 &#60;bean id="holidayEndpoint" class="com.razvan.hr.ws.HolidayEndpoint"&#62;
 &#60;/bean&#62;

 &#60;bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping"&#62;
 &#60;property name="mappings"&#62;
 &#60;props&#62;
 &#60;prop key="{http://mycompany.com/hr/schemas}HolidayRequest"&#62;holidayEndpoint&#60;/prop&#62;
 &#60;/props&#62;
 &#60;/property&#62;
 &#60;property name="interceptors"&#62;
 &#60;bean class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor" /&#62;
 &#60;/property&#62;
 &#60;/bean&#62;

 &#60;bean id="holiday" class="org.springframework.ws.wsdl.wsdl11.DynamicWsdl11Definition"&#62;
 &#60;property name="builder"&#62;
 &#60;bean class="org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder"&#62;
 &#60;property name="schema" value="/WEB-INF/hr.xsd" /&#62;
 &#60;property name="portTypeName" value="HumanResource" /&#62;
 &#60;property name="locationUri" value="http://localhost:8080/holidayService/" /&#62;
 &#60;/bean&#62;
 &#60;/property&#62;
 &#60;/bean&#62;

&#60;/beans&#62;</pre>
<p>And here is the implementation of com.razvan.hr.ws.HolidayEndpoint. According to Maven customaries, this have to be placed in the src/main/java subdirectory of the project. I have tried to keep the implementation minimal by avoiding further service instantiations, unrelated to Spring-WS:</p>
<pre>package com.razvan.hr.ws;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.commons.logging.Log;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.Namespace;
import org.jdom.xpath.XPath;
import org.springframework.ws.server.endpoint.AbstractJDomPayloadEndpoint;

public class HolidayEndpoint extends AbstractJDomPayloadEndpoint {

 private XPath startDateExpression;

 private XPath endDateExpression;

 private XPath nameExpression;

 public HolidayEndpoint() throws JDOMException {
 Namespace namespace = Namespace.getNamespace("hr", "http://mycompany.com/hr/schemas");
 startDateExpression = XPath.newInstance("//hr:StartDate");
 startDateExpression.addNamespace(namespace);
 endDateExpression = XPath.newInstance("//hr:EndDate");
 endDateExpression.addNamespace(namespace);
 nameExpression = XPath.newInstance("concat(//hr:FirstName,' ',//hr:LastName)");
 nameExpression.addNamespace(namespace);
 }

 protected Element invokeInternal(Element holidayRequest) throws Exception {
 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
 Date startDate = dateFormat.parse(startDateExpression.valueOf(holidayRequest));
 Date endDate = dateFormat.parse(endDateExpression.valueOf(holidayRequest));
 String name = nameExpression.valueOf(holidayRequest);

 // do something meaningful with the extracted data.
 System.out.println("Start date: "+startDate+" end Date: "+ endDate+" Employee: "+name);
 return null;
 }
}
</pre>
<p>My final file structure is:</p>
<pre>&#124;-- pom.xml
`-- src
 `-- main
   &#124;-- java
   &#124;   `-- com
   &#124;       `-- razvan
   &#124;           `-- hr
   &#124;               `-- ws
   &#124;                   `-- HolidayEndpoint.java
   `-- webapp
     `-- WEB-INF
        &#124;-- hr.xsd
        &#124;-- spring-ws-servlet.xml
        `-- web.xml</pre>
<p>The web.xml is pretty standard for Spring applications:</p>
<pre>&#60;?xml version="1.0" encoding="UTF-8"?&#62;
&#60;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"&#62;

 &#60;display-name&#62;Spring test application&#60;/display-name&#62;

 &#60;servlet&#62;
 &#60;servlet-name&#62;spring-ws&#60;/servlet-name&#62;
 &#60;servlet-class&#62;org.springframework.ws.transport.http.MessageDispatcherServlet&#60;/servlet-class&#62;
 &#60;/servlet&#62;

 &#60;servlet-mapping&#62;
 &#60;servlet-name&#62;spring-ws&#60;/servlet-name&#62;
 &#60;url-pattern&#62;/*&#60;/url-pattern&#62;
 &#60;/servlet-mapping&#62;

&#60;/web-app&#62;</pre>
<p>This is the whole Web Service application. In order to run the application try from the command line:</p>
<pre>mvn clean install jetty:run</pre>
<p>This will compile the war file and start an instance of the jetty web server.</p>
<p>By accessing the address: http://localhost:8080/holidayService/holiday.wsdl you can see the generated WSDL associated to your described web service. While leaving the jetty running, you may attempt to create a client, in order to see the message printed within the invokeInternal method. Following it will be described a Java client, but it is possible to build your client using any other language or platform.</p>
<p>Using the Eclipse wizard create a new empty Java project, than create using the wizard a new &#8220;Web Service Client&#8221;. Provide the address of the wsdl and you will have a bunch of Java classes describing your web service and the required XML parsers dependencies in your newly created project. Create a new main class in the default package named TestWs.java, with the following content:</p>
<pre>import java.math.BigInteger;
import java.util.Date;

import com.mycompany.hr.schemas.EmployeeType;
import com.mycompany.hr.schemas.HolidayRequest;
import com.mycompany.hr.schemas.HolidayType;
import com.mycompany.hr.schemas.HumanResource;
import com.mycompany.hr.schemas.HumanResourceServiceLocator;

public class TestWs {
 public static void main(String[] args) {
 try {
 HumanResourceServiceLocator loc = new HumanResourceServiceLocator();
 HumanResource myserv = loc.getHumanResourcePort();

 HolidayType ht = new HolidayType(new Date(), new Date());
 EmployeeType et = new EmployeeType(new BigInteger("100"), "Razvan",
 "Popovici");
 HolidayRequest req = new HolidayRequest(ht, et);

 myserv.holiday(req);
 } catch (Exception e) {
 e.printStackTrace();
 }
 System.out.println("OK!");

 }
}</pre>
<p>Run the class, and you will be able to observe the message in the maven window.</p>
<p>A few conclusions of the test are:</p>
<p>- Spring-WS is a great approach if the schema definitions of the data model already exists.</p>
<p>- The required xalan dependency is a bug in Spring-WS dependency requirements, fortunately Maven made possible the correction.</p>
<p>- The element wsdl:definitions is optional, the tutorial worked without it as well.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Maven quirk ( archetype-j2ee-simple )]]></title>
<link>http://hardikmehta.wordpress.com/2009/07/09/maven-quirk/</link>
<pubDate>Thu, 09 Jul 2009 19:03:17 +0000</pubDate>
<dc:creator>hardikmehta</dc:creator>
<guid>http://hardikmehta.wordpress.com/2009/07/09/maven-quirk/</guid>
<description><![CDATA[Update: The issue has been fixed. There were two points. 1. I was using the wrong (deprecated) goal ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><div style="background-color:#F2F2F2;">
<p style="padding-left:60px;"><strong>Update:</strong></p>
<p style="padding-left:60px;">The issue has been fixed. There were two points.</p>
<p style="padding-left:60px;">1. I was using the wrong (deprecated) goal archetype:create instead of archetype:generate.</p>
<p style="padding-left:60px;">2. With the plugin archetype-j2ee-simple there is a bug which is already reported <a title="ARCHETYPE-228" href="http://jira.codehaus.org/browse/ARCHETYPE-228" target="_blank">here</a>.</p>
<p style="padding-left:60px;">I got my answer from Antony Stubbs on <a title="Stackoverflow" href="http://stackoverflow.com/questions/1082012/maven-archetype-j2ee-simple-generates-a-failing-project/1146961#1146961" target="_blank">Stackoverflow</a>.</p>
</div>
<p style="text-align:justify;">At last I also decided to join the maven[1] bandwagon, I will start using maven for managing my projects. Convention over configuration  sounds  indeed a nice idea.  When I first heard about maven  I didn&#8217;t have a good &#8220;feeling&#8221; about it, may be because I was too comfortable with ant and believe to be able to achieve any task with it. But now after reading some documentation and articles about maven, I came to realise it is completely new paradigm than ant. In my opinion the best aspect of maven is that you always have the big picture of your project in mind instead of a small task or operation to be done.  I started liking maven and  also started learning it.  For reference I have started following  Maven: The Definitive Guide[2]. Another great advantage could be that if you know maven and a join a new team which also uses maven for project management, you don&#8217;t have to spend hours or may be days trying to figure out the structure of their project and being able to build it.</p>
<p style="text-align:justify;">Although I started liking maven, sometimes it feels like a strange tool, where you have to configure a lot to achieve your goal. if you want some custom stuff in your project. I also find it annoying that by default the compiler-plugin assumes you want to build for java 1.4 or java 1.3.  Moreover, because there are always so called sensible or obvious defaults assumed, in maven world, not all the obvious defaults are obvious to you and you have to know the documentation well to be able to know what those defaults are. and how you can achieve something different. It feels somewhat like javadocs, until you get used to the apis you need frequently, you have to rely on auto-completion of your IDE or have the javadoc always open. There is no wonder that the second part of the book, I mentioned contains only the maven reference.</p>
<p style="text-align:justify;">But, yes, I am here to talk about the quirk of maven which I encountered during my learning process. I am just a maven beginner, so may be this is normal behavior, but I don&#8217;t think so.</p>
<p style="text-align:justify;">So, while starting to learn maven, I started with a contrived JavaEE application (brave huh), which is taken as example in the very good book EJB 3 in Action[3]. I searched the net and found out about the maven archetype j2ee-simple <a title="Maven archetype j2ee simple" href="http://maven.apache.org/plugins/maven-archetype-plugin/examples/j2ee-simple.html" target="_blank">here.</a> I used following commandline to generate the stubs of a simple JavaEE project, actually I was interested in the standard directory structure.</p>
<p style="text-align:justify;">
<pre class="brush: bash;">mvn archetype:create -DgroupId=com.hardik -DartifactId=ActionBazaar -DarchetypeArtifactId=maven-archetype-j2ee-simple</pre>
<p style="text-align:justify;">
<p style="text-align:justify;">The project was created perfectly, but by default it was not compiling. When I executed mvn intall I had following errors.</p>
<p style="text-align:justify;">
<pre class="brush: java;">$ mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).

Project ID: unknown

Reason: Could not find the model file '/home/hardik/projects/ActionBazaar/site'. for project unknown

[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Could not find the model file '/home/hardik/projects/ActionBazaar/site'. for project unknown
    at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:432)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:300)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Could not find the model file '/home/hardik/projects/ActionBazaar/site'. for project unknown
    at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1575)
    at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:506)
    at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
    at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:632)
    at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:515)
    at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:588)
    at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:419)
    ... 12 more
Caused by: java.io.FileNotFoundException: /home/hardik/projects/ActionBazaar/site (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:106)
    at hidden.org.codehaus.plexus.util.xml.XmlReader.&lt;init&gt;(XmlReader.java:124)
    at hidden.org.codehaus.plexus.util.xml.XmlStreamReader.&lt;init&gt;(XmlStreamReader.java:67)
    at hidden.org.codehaus.plexus.util.ReaderFactory.newXmlReader(ReaderFactory.java:118)
    at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1570)
    ... 18 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: &lt; 1 second
[INFO] Finished at: Thu Jul 09 18:44:31 CEST 2009
[INFO] Final Memory: 1M/4M

[INFO] ------------------------------------------------------------------------</pre>
<p style="text-align:justify;">
<p style="text-align:justify;">It is talking about some model file for the site module. The site module is generally the &#8220;website&#8221; of your project that maven generates just by looking at your pom.xml file. I removed the site module from the module list of the pom file and it started working. But I still wonder why the default project structure doesn&#8217;t build. I am sure this is incorrect behavior.</p>
<p style="text-align:justify;">If someone has had the same problem, and was able to fix, please let me know.</p>
<p style="text-align:justify;">
<p style="text-align:justify;"><strong>References:</strong></p>
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<ol>
<li><a title="apache-maven" rel="imdb" href="http://maven.apache.org/" target="_blank">Apache-maven</a></li>
<li><a title="Maven Book" href="http://www.sonatype.com/books/maven-book/reference/" target="_blank">Maven: The Definitive Guide</a></li>
<li> <a title="EJB 3 In Action" href="http://www.manning.com/panda/" target="_blank">EJB 3 in Action</a></li>
</ol>
<p style="text-align:justify;">
<p style="text-align:justify;">
<div id="_mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:23px;width:1px;height:1px;">$ mvn install<br />
[INFO] Scanning for projects&#8230;<br />
[INFO] &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
[ERROR] FATAL ERROR<br />
[INFO] &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
[INFO] Error building POM (may not be this project&#8217;s POM).Project ID: unknown</p>
<p>Reason: Could not find the model file &#8216;/home/hardik/projects/ActionBazaar/site&#8217;. for project unknown</p>
<p>[INFO] &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
[INFO] Trace<br />
org.apache.maven.reactor.MavenExecutionException: Could not find the model file &#8216;/home/hardik/projects/ActionBazaar/site&#8217;. for project unknown<br />
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:432)<br />
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:300)<br />
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)<br />
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)<br />
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />
at java.lang.reflect.Method.invoke(Method.java:597)<br />
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)<br />
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)<br />
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)<br />
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)<br />
Caused by: org.apache.maven.project.ProjectBuildingException: Could not find the model file &#8216;/home/hardik/projects/ActionBazaar/site&#8217;. for project unknown<br />
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1575)<br />
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:506)<br />
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)<br />
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:632)<br />
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:515)<br />
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:588)<br />
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:419)<br />
&#8230; 12 more<br />
Caused by: java.io.FileNotFoundException: /home/hardik/projects/ActionBazaar/site (No such file or directory)<br />
at java.io.FileInputStream.open(Native Method)<br />
at java.io.FileInputStream.&#38;lt;init&#62;(FileInputStream.java:106)<br />
at hidden.org.codehaus.plexus.util.xml.XmlReader.&#38;lt;init&#62;(XmlReader.java:124)<br />
at hidden.org.codehaus.plexus.util.xml.XmlStreamReader.&#38;lt;init&#62;(XmlStreamReader.java:67)<br />
at hidden.org.codehaus.plexus.util.ReaderFactory.newXmlReader(ReaderFactory.java:118)<br />
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1570)<br />
&#8230; 18 more<br />
[INFO] &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
[INFO] Total time: &#60; 1 second<br />
[INFO] Finished at: Thu Jul 09 18:44:31 CEST 2009<br />
[INFO] Final Memory: 1M/4M<br />
[INFO] &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Apache Maven vs. Apache Ant (Part 2)]]></title>
<link>http://trapthespark.wordpress.com/2008/12/28/apache-maven-vs-apache-ant-part-2/</link>
<pubDate>Mon, 29 Dec 2008 03:27:09 +0000</pubDate>
<dc:creator>Mark De Lanoy</dc:creator>
<guid>http://trapthespark.wordpress.com/2008/12/28/apache-maven-vs-apache-ant-part-2/</guid>
<description><![CDATA[Earlier I blogged about my recent experiences with Apache Maven, i.e. Apache Maven vs. Apache Ant.  ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Earlier I blogged about my recent experiences with Apache Maven, i.e. <a href="http://trapthespark.wordpress.com/2008/12/14/apache-maven-vs-apache-ant/">Apache Maven vs. Apache Ant</a>.  Several of the major issues were had were:</p>
<ul>
<li>Performance &#8211; Maven&#8217;s performance (compared to Apache Ant) is horrible.  It repeats steps throughout the build (doesn&#8217;t skip anything and worse repeats some steps).  It&#8217;s constantly calling out to the Internet looking for  SNAPSHOT&#8217;s (per target/goal) as if somehow it magically changed mid-build.  A hack for repeated SNAPSHOT searches is to review all dependencies you have to remove as many SNAPSHOT&#8217;s on 3rd party components (wherever possible).  This isn&#8217;t foolproof as some of your dependencies might have dependencies on SNAPSHOT&#8217;s.  (For the ultimate hack you could tweak all of the POM&#8217;s in question but that&#8217;s painful and error prone and the next time you update something it could all get blown away.)  Another hack is to shut off your Internet connection.  The lack of a connection makes Maven stop looking (brilliant).</li>
<li>Scalability &#8211; Maven is a memory hog. The more complex (i.e. more nested components leveraging the reactor) your build process becomes the more memory consumed.  Here you need to tweak MAVEN_OPTS environment variable.</li>
</ul>
<p>I was recently able to make some performance improvements to help Apache Maven, i.e.</p>
<ul>
<li>Got a new laptop App MacBook Pro (2.6Ghz, 4 G RAM, HD w 7200 RPM)&#8230; not sure what exactly has sped things up but I suspect its the hard drive (as everything else is marginally better, i.e. 0.30 GHz faster CPU, 1G more RAM).</li>
<li>Tweaked the MAVEN_OPTS </li>
</ul>
<p>Originally I had the following MAVEN_OPTS settings: <strong><em>setenv </em></strong><strong><em>MAVEN_OPTS &#8220;-Xmx640m&#8221; <span style="font-style:normal;font-weight:normal;">but I was getting errors for &#8220;out of perm space&#8221; so I used the following MAVEN_OPTS settings:</span></em></strong></p>
<p><strong><em>setenv MAVEN_OPTS &#8220;-Xms128m -Xmx640m -</em></strong><span><strong><em>Dsun</em></strong></span><strong><em>.</em></strong><span><strong><em>rmi</em></strong></span><strong><em>.</em></strong><span><strong><em>dgc</em></strong></span><strong><em>.client.gcInterval=3600000 -</em></strong><span><strong><em>Dsun</em></strong></span><strong><em>.</em></strong><span><strong><em>rmi</em></strong></span><strong><em>.</em></strong><span><strong><em>dgc</em></strong></span><strong><em>.server.gcInterval=3600000 -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=640m -Xverify:none&#8221;</em></strong></p>
<p>But as the number of components were built it locked the system.  I suspect the issue is the garbage collection settings.  So I reduced the MAVEN_OPTS settings to the following:</p>
<p><strong><em>setenv MAVEN_OPTS &#8220;-Xms128m -Xmx640m </em></strong><strong><em>-XX:MaxPermSize=640m&#8221;</em></strong></p>
<p>This immediately helped get further in the build process.  Eventually it ran out of heap memory so now the MAVEN_OPTS settings are as follows:</p>
<p><strong><em>setenv MAVEN_OPTS &#8220;-Xms128m -Xmx1280m -XX:MaxPermSize=640m&#8221;</em><span style="font-weight:normal;"> which seems to have done the trick.  I&#8217;m now able to do complete builds </span><em>(mvn clean install)</em><em> </em><span style="font-weight:normal;">with these settings without doing hacks like shutting off my network connections, tweaking POM&#8217;s, etc.</span></strong></p>
<p><strong><span style="font-weight:normal;">But&#8230; need to get this working for creating sites, </span><em>(i.e. mvn site)</em><span style="font-weight:normal;"> as well as getting this running with integration tests&#8230; (I have quite a few).</span></strong></p>
<p>In the meantime I&#8217;ve been reading the <a href="http://www.manning.com/loughran/">Ant In Action</a> book (which is quite good).  I&#8217;ve basically re-examined my entire Ant build process (and theory).  So I&#8217;ve started creating scripts from scratch trying to incorporate concepts from the book, i.e.</p>
<ul>
<li>Declaring &#8220;beaucoup&#8221; ANT properties that can be overridden in a property file (or passed in properties from parent ANT scripts).</li>
<li>Importing ANT tasks (both life cycle tasks that can be overridden as needed as well as common functionality).</li>
<li>Potentially leveraging IVY for dependency management.</li>
<li>Potentially leveraging SmartFrog for deployment management (conceptually cool project).</li>
<li>Getting JBoss Seam&#8217;s testing to work with ANT (shouldn&#8217;t be an issue as JBoss Seam uses ANT primarily).</li>
</ul>
<p>Fingers crossed but making progress&#8230;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Apache Maven vs. Apache Ant]]></title>
<link>http://trapthespark.wordpress.com/2008/12/14/apache-maven-vs-apache-ant/</link>
<pubDate>Sun, 14 Dec 2008 03:42:49 +0000</pubDate>
<dc:creator>Mark De Lanoy</dc:creator>
<guid>http://trapthespark.wordpress.com/2008/12/14/apache-maven-vs-apache-ant/</guid>
<description><![CDATA[For doing software builds in the Java world&#8230; most people use either Ant or Maven.  I&#8217;ve ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>For doing software builds in the Java world&#8230; most people use either Ant or Maven.  I&#8217;ve used both&#8230;</p>
<p>From a requirements perspective I need a continuous integration/build process that can do the following:</p>
<ul>
<li>Dependency Management &#8211; In one place identify the components and their versions that are included in this project.  Ideally the same dependency management system can deal with child dependencies automatically.</li>
<li>Support some form of reuse across the components (in terms of the build scripts, ideally there&#8217;s no large scripts that have redundant text across the commands, difficult to maintain/keep consistent)</li>
<li>Support for hierarchical projects composed of numerous components (must scale and allow complexity).</li>
<li>Allow quick builds (most perform)</li>
<li>Ideally create a project Web site (documentation)</li>
<li>At least create project reports per component.</li>
</ul>
<p>I started in the Ant world, i.e. oodles of ANT scripts on big projects.  My main issue was the complexity of the ANT scripts after awhile and the lack of reuse when you had a multi-component.  But it was fast and it could do anything, i.e. powerful.  I experimented on/off with Maven over the years.  Finally got it working this year.  Everything as advertised except really slow when there&#8217;s an Internet connection (and just slow in general).  And needed to break large projects up and build them separately (or them crash early, i.e. PermSpace errors).  With command lines like the following:</p>
<p><strong><em>MAVEN_OPTS &#8220;-Xms128m -Xmx640m -</em></strong><span><strong><em>Dsun</em></strong></span><strong><em>.</em></strong><span><strong><em>rmi</em></strong></span><strong><em>.</em></strong><span><strong><em>dgc</em></strong></span><strong><em>.client.gcInterval=3600000 -</em></strong><span><strong><em>Dsun</em></strong></span><strong><em>.</em></strong><span><strong><em>rmi</em></strong></span><strong><em>.</em></strong><span><strong><em>dgc</em></strong></span><strong><em>.server.gcInterval=3600000 -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=640m -Xverify:none&#8221;</em></strong></p>
<p>It didn&#8217;t crash on the mini-builds&#8230; but when trying to build everything it would just slow down and ultimately lock the machine.  I was really attracted to the Development Web site that was created with mvn site but if the system can&#8217;t perform nor scale&#8230; it&#8217;s not worth it.  Looking at Seam and Hibernate.. they appear to get by just fine.  And then there&#8217;s trying to get the JBOSS Embedded Server running in Maven&#8230;  I&#8217;ve searched alot/experimented and just not sure what I&#8217;m missing there.  Time to thrown in the towel.  So now I&#8217;m going to move back to Ant.  In the past few years&#8230; it appears as though Ivy has caught on so perhaps Dependency Management.  Appears to be some templating/reuse concepts (although that may have been there awhile and I overlooked it).  Not sure how much can be templated so will be interested to investigate.</p>
<p>So in retrospect&#8230; Maven is nice for small projects.  Mine appears massive (i.e. many components, a lot of code generation, etc.).  So time to go back to Apache Ant.  Also need to get a wiki like http://www.SeamFramework.org and http://in.relation.to (i.e. the documentation posted to Al Gore&#8217;s Internet).</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA["So what?" test for software]]></title>
<link>http://razvanp.wordpress.com/2008/07/10/so-what-test-for-software/</link>
<pubDate>Thu, 10 Jul 2008 14:43:28 +0000</pubDate>
<dc:creator>razvanp</dc:creator>
<guid>http://razvanp.wordpress.com/2008/07/10/so-what-test-for-software/</guid>
<description><![CDATA[It is widely known that any published text must pass the &#8220;so what?&#8221; quality gate. The fo]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>It is widely known that any published text must pass the &#8220;so what?&#8221; quality gate. The following post tries to extend this to software.</p>
<p>Imagine that you have a scripted language code (in my sample, apache maven) which allows the caller to provide values to one or more variables.</p>
<p>Within the pom.xml file, there is a line like:</p>
<pre>&#60;commandlineArgs&#62;${data.directory}&#60;/commandlineArgs&#62;</pre>
<p>And the caller is able to provide a value to the variable, with the call</p>
<pre>mvn install -Ddata.directory=/home/theuser</pre>
<p>So far so good, but what about if the structure is much complicated, and the user misspells the variable name in the command line call? In this case, no error or warning is issued, the variable uses the default value. This only because the interpretor is unable to question &#8220;so what?&#8221; the command line.</p>
<p>The implementation of such a feature is difficult: the software should be able to keep track of the variables, their definition source and the amount of accesses. If an user defined variable had no accesses then is as good candidate for the &#8220;so what?&#8221;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Setting Local Repository in Maven]]></title>
<link>http://webappeng.wordpress.com/2008/06/04/setting-local-repository-in-maven/</link>
<pubDate>Wed, 04 Jun 2008 22:45:00 +0000</pubDate>
<dc:creator>betala</dc:creator>
<guid>http://webappeng.wordpress.com/2008/06/04/setting-local-repository-in-maven/</guid>
<description><![CDATA[1. create build.properties file in the &#8220;Document and Settings/username&#8221; folder. 2. The b]]></description>
<content:encoded><![CDATA[1. create build.properties file in the &#8220;Document and Settings/username&#8221; folder. 2. The b]]></content:encoded>
</item>
<item>
<title><![CDATA[How to install jar in local Repository using Maven]]></title>
<link>http://webappeng.wordpress.com/2008/06/04/how-to-install-jar-in-local-repository-using-maven/</link>
<pubDate>Wed, 04 Jun 2008 20:08:00 +0000</pubDate>
<dc:creator>betala</dc:creator>
<guid>http://webappeng.wordpress.com/2008/06/04/how-to-install-jar-in-local-repository-using-maven/</guid>
<description><![CDATA[Use the following command maven jar:install This command will compile, build and deploy to the Local]]></description>
<content:encoded><![CDATA[Use the following command maven jar:install This command will compile, build and deploy to the Local]]></content:encoded>
</item>

</channel>
</rss>
