|
MavenHowTo
Tellurium Maven Guide.
IntroductionTellurium has converted its project structure to use Maven. This document will explain the steps necessary to retrieve the Maven artifacts. PrerequisitesYou will need to be running Maven version 2.0.9, downloadable from http://maven.apache.org/download.html. If you never installed Maven before, please follow the official Maven Installation Guide. settings.xmlHere is a sample settings.xml that will allow you to automatically include Tellurium artifacts in your Maven project. This should go in your ~/.m2/settings.xml file: <settings>
<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>kungfuters-public-snapshots-repo</id>
<name>Kungfuters.org Public Snapshot Repository</name>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>http://maven.kungfuters.org/content/repositories/snapshots</url>
</repository>
<repository>
<id>kungfuters-public-releases-repo</id>
<name>Kungfuters.org Public Releases Repository</name>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>http://maven.kungfuters.org/content/repositories/releases</url>
</repository>
</repositories>
</profile>
</profiles>
</settings>DependencyTo include Tellurium as a dependency in your project, add the following to your pom.xml: <dependencies>
...
<dependency>
<groupId>tellurium</groupId>
<artifactId>tellurium-core</artifactId>
<version>0.6.0</version>
<scope>compile</scope>
</dependency>
...
</dependencies>Build Tellurium from SourceIf you want to build Tellurium from source, you can check out the trunk code using subversion command, svn checkout http://aost.googlecode.com/svn/trunk/ tellurium or using mvn command, mvn scm:checkout -DconnectionUrl=scm:svn:http://aost.googlecode.com/svn/trunk -DcheckoutDirectory=tellurium Be aware that the Maven command calls the subversion client to do the job and you must have the client installed in your system. If you want to build the whole project, just use mvn clean install and Maven will compile source code and resources, compile test code and test resources, run all tests, and then install all artifacts to your local repository under YOUR_HOME/.m2/repository. Sometimes, tests may break and if you still want to proceed, please use the ignore flag mvn clean install -Dmaven.test.failure.ignore=true If you want to build an individual project, just go to that project directory and run the same command as above. If you like to run the tests, use command mvn test The sub-projects under the tools directory include Tellurium Maven archetypes and trump code, you may not really want to build them by yourself. For trump, the artifacts include a .xpi file. The assembly project just creates a set of tar files and you may not need to build it either. Create a New Tellurium Test Project using Tellurium Maven ArchetypeTellurium provides two maven archetypes, i.e., tellurium-junit-archetype and tellurium-testng-archetype for Tellurium JUnit test project and Tellurium TestNG test project, respectively. Run the following maven command to create a new JUnit project mvn archetype:generate -DgroupId=your_group_id -DartifactId=your_artifact_id -DarchetypeArtifactId=tellurium-junit-archetype -DarchetypeGroupId=tellurium -DarchetypeVersion=0.6.0 Without adding the Tellurium Maven repository, you can specify it in the command line as mvn archetype:generate -DgroupId=your_group_id -DartifactId=your_artifact_id -DarchetypeArtifactId=tellurium-junit-archetype -DarchetypeGroupId=tellurium -DarchetypeVersion=0.6.0 \ -DarchetypeRepository=http://maven.kungfuters.org/content/repositories/releases For TestNG project, you should use a different archetype mvn archetype:generate -DgroupId=your_group_id -DartifactId=your_artifact_id -DarchetypeArtifactId=tellurium-testng-archetype -DarchetypeGroupId=tellurium -DarchetypeVersion=0.6.0 If you want to see a detailed example on how to create a new Tellurium test project, you can read Ten Minutes to Tellurium How to Create a Maven Archetype from an Existing ProjectYou can create a Maven archetype from scratch, for example, Tellurium Maven Archetypes are created in this way. But in some cases, your project may be pretty complicated and you want to create the Maven archetype from a template project. The guide on How to Create a Maven Archetype From an Existing Project walks you through all the steps to create a Maven Archetype from an existing project. Build informationTo find regular build information updates, see http://kungfuters.org/tellurium. There you will find information about the project as well as unit test and coverage reports. Useful Maven Plugins and CommandsMaven Help Plugin
Maven Dependency Plugin
Maven Archetype Plugin
Maven IDE ConfigurationEclipseInstall Maven Plug-in
Configure Maven Plug-in
Import Projects
NetbeansInstall Maven PluginNetbeans does not come with automatic support for Maven, you will need to install the plugin.
Configure Maven Plugin
Import Projects
IntelliJIntelliJ IDEA has Maven Plugin installed by default. Configure Maven Plug-in
Import Projects
Subversion ClientsTo check out code from google code SVN, you should use SVN client plugins in IDEs or you can use a standalone SVN client tools such as
Reference Material |
Sign in to add a comment