I'm using maven 2. I wrote a simple shell script that primes the local maven repository with the versions of the jars that weren't available yet from ibiblio. Then made dependencies on them in my pom.xml so they get included in the war. Its not the most elegant solutions, but I didn't want to set up a maven repository.
pom.xml
Code:
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>foo</groupId>
<artifactId>foo</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Foo Web Application</name>
<packaging>war</packaging>
<build>
<defaultGoal>war:inplace</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>tomcat5x</containerId>
<zipUrlInstaller>
<url>http://www.apache.org/dist/tomcat/tomcat-5/v5.5.16/bin/apache-tomcat-5.5.16.zip</url>
</zipUrlInstaller>
</container>
<configuration>
<home>${project.build.directory}/tomcat5x</home>
<deployables>
<deployable>
<location>${basedir}/src/main/webapp</location>
</deployable>
</deployables>
</configuration>
</configuration>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.9</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>ejb</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.0.cr1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.1beta9</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.1beta7</version>
</dependency>
<!-- Hibernate Dependencies -->
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.6rc1</version>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm-attrs</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.0</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.1_3</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>jta</groupId>
<artifactId>jta</artifactId>
<version>unknown</version>
</dependency>
<!-- End Hibernate Dependecies -->
<!-- Hibernate Entity Manager Dependencies -->
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-archive-browsing</artifactId>
<version>5.0.0alpha</version>
</dependency>
<!-- End Hibernate Entity Manager Dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>1.2.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
<version>1.2.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>opensymphony</groupId>
<artifactId>sitemesh</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>jmock</groupId>
<artifactId>jmock</artifactId>
<version>1.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.postgres</groupId>
<artifactId>jdbc</artifactId>
<version>8.1</version>
</dependency>
</dependencies>
</project>
Shell script:
Code:
#!/bin/sh
mvn install:install-file -Dfile=lib/javax/persistence/ejb/3.0/ejb3-persistence.jar -DgroupId=javax.persistence -DartifactId=ejb -Dversion=3.0 -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -Dfile=lib/org/hibernate/hibernate-annotations/3.1beta9/hibernate-annotations.jar -DgroupId=org.hibernate -DartifactId=hibernate-annotations -Dversion=3.1beta9 -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -Dfile=lib/org/hibernate/hibernate-entitymanager/3.1beta7/hibernate-entitymanager.jar -DgroupId=org.hibernate -DartifactId=hibernate-entitymanager -Dversion=3.1beta7 -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -Dfile=lib/org/hibernate/hibernate/3.2.0.cr1/hibernate3.jar -DgroupId=org.hibernate -DartifactId=hibernate -Dversion=3.2.0.cr1 -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -Dfile=lib/org/postgresql/jdbc/8.1/postgresql-jdbc-8.1.jar -DgroupId=org.postgres -DartifactId=jdbc -Dversion=8.1 -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -Dfile=lib/jta/jta/unknown/jta.jar -DgroupId=jta -DartifactId=jta -Dversion=unknown -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -Dfile=lib/javassist/javassist/3.1/javassist.jar -DgroupId=javassist -DartifactId=javassist -Dversion=3.1 -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -Dfile=lib/org/jboss/jboss-archive-browsing/5.0.0alpha/jboss-archive-browsing.jar -DgroupId=org.jboss -DartifactId=jboss-archive-browsing -Dversion=5.0.0alpha -Dpackaging=jar -DgeneratePom=true
Code: