o adding a guide for attached tests

o adding a guide for deployment using external ssh command


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@326158 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2005-10-18 17:05:29 +00:00
parent c2c5b3893f
commit 3e185a491a
3 changed files with 153 additions and 1 deletions

View File

@ -0,0 +1,80 @@
------
Guide to using attached tests
------
Jason van Zyl
------
12 October 2005
------
Guide to using attached tests
Many times you may want to resuse the tests that you have created for a project in another. For example if you have
written <<<foo-core>>> and it contains test code in the <<<${basedir}/src/test/java>>> it would be useful to package
up those compiled tests in a JAR and deploy them for general resuse. To do this you would configure the
<<<maven-jar-plugin>>> as follows:
+----+
<project>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
+----+
* Installing the attached test JAR
In order to install the attached test JAR you simply use the standard install phase by executing
the following command:
+----+
m2 install
+----+
* Deploying the attached test JAR
In order to deploy the attached test JAR you simply use the standard deploy phase by executing
the following command:
+----+
m2 deploy
+----+
* Using the attached test JAR
In order to use the attached test JAR that was created above you simply specify a dependency on the main
artifact with a specified type of <<<tests>>>:
+----+
<project>
...
<dependencies>
<dependency>
<groupId></groupId>
<artifactId></artifactId>
<version>1.0-SNAPSHOT</version>
<type>tests</type>
</dependency>
</depdendnecies>
...
</project>
+----+

View File

@ -40,7 +40,7 @@ Guide to deploying with FTP
<distributionManagement> <distributionManagement>
<repository> <repository>
<id>ftp-repository</id> <id>ftp-repository</id>
<url>ftp://repository.mycompany.com</url> <url>ftp://repository.mycompany.com/repository</url>
</repository> </repository>
</distributionManagement> </distributionManagement>

View File

@ -0,0 +1,72 @@
------
Guide to deploying with an external SSH command
------
Jason van Zyl
------
12 October 2005
------
Guide to deploying with an external SSH command
In order to deploy artifacts using FTP you must first specify the use of an FTP server in the
<<distributionManagement>> element of your POM as well as specifying an <<<extension>>> in your
<<<build>>> element which will pull in the FTP artifacts required to deploy with FTP:
+----+
<project>
<parent>
<groupId>com.stchome</groupId>
<artifactId>mavenFull</artifactId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.1-SNAPSHOT</version>
<name>Maven Quick Start Archetype</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<!-- Enabling the use of FTP -->
<distributionManagement>
<repository>
<id>ssh-repository</id>
<url>scp://repository.mycompany.com/repository</url>
</repository>
</distributionManagement>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh-external</artifactId>
<version>1.0-alpha-4</version>
</extension>
</extensions>
</build>
</project>
+----+
Using the external ssh command means you don't need any additional configuration in your <<<settings.xml>>>
file as everything will be taken from the environment.
You should, of course, make sure that you can login into the specified SSH server by hand before attempting the
deployment with Maven. Once you have verified that everything is setup correctly you can now deploy your artifacts
using Maven:
+----+
m2 deploy
+----+