Showing posts with label Maven. Show all posts
Showing posts with label Maven. Show all posts

Monday, June 22, 2009

Base Test Class with Maven

I've got some base Test classes (with settings for Spring, Wicket, etc) that I want to reuse in my integration tests, and I've put them under a 'test' directory (instead of 'main'), but that means that they don't get built and included in the main artifact. Here's how I forced Maven to build it into a test artifact (in the build/plugins section):


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>


... and here's how I included it as a dependency in the other projects:


<dependency>
<groupId>com.max.services</groupId>
<artifactId>MaxServices</artifactId>
<version>1.0.2-SNAPSHOT</version>
</dependency>

Friday, March 14, 2008

maven 2 deploy-file command

I can never remember the vagaries of the deployment URL, etc!

Here is an example for activation.jar in our "soa" repository. Make sure to have the username/password for "soa-repo" in settings.xml, and probably the distributionManagement.repository in the pom.xml.


mvn deploy:deploy-file -DgroupId=javax.activation -DartifactId=activation -Dversion=1.0.2 \
-Dpackaging=jar -Dfile=/home/trent/dl/jaf-1.0.2/activation.jar \
-DrepositoryId=soa-repo \
-Durl=scp://soa@soa.dev.hq.icentris/home/soa/tomcat/webapps/ROOT/repository2