Précédent: Preparing |
Haut: Preparing |
Suivant: Diving
In |
The contents of this document are a work in progress
The chapter gets you to jump start into Plexus Component development. While a scan through of 'Concepts' would be helpful, it is not really required.
Where ever deemed neccessary cross-references are provided to make it easy for a new developer to reference the required material.
The tutorial assumes you have Maven 2.0.x+ setup and have an internet connection and are able to download required Maven artifacts from online repositories.
For the purpose of this tutorial we will develop a Plexus Website Monitor component.
Lets get started!
Plexus has some archetypes available that can make initial project setups a breeze. We use one such archetype for our Plexus component here. From the command prompt, change directory to the location where you wish to set up the new Plexus Component project. Run the following command from the command line to setup an initial project structure
mvn archetype:create -DarchetypeGroupId=org.codehaus.plexus -DarchetypeArtifactId=plexus-archetype-component-simple -DarchetypeVersion=1.0-alpha-1-SNAPSHOT -DgroupId=org.codehaus.plexus -DartifactId=plexus-website-monitor-component -DpackageName=org.codehaus.plexus.tutorial -Dpackaging=jar -DremoteRepositories=http://snapshots.repository.codehaus.org/
Cool! At this point you've created a basic project structure that should give you a jump-start into development.
More info on archetype creation and usage can be found here on the Maven website.
The following table explains the options that we used above.
| Commandline Option | Description | Required |
| -DarchetypeGroupId | "groupId" for the archetype we want to use | Yes |
| -DarchetypeArtifact | "artifactId" for the archetype we want to use | Yes |
| -DarchetypeVersion | "version" for the archetype we want to use | Yes |
| -DgroupId | "groupId" for the project to be generated | Yes |
| -DartifactId | "artifactId" for the project to be generated | Yes |
| -DpackageName | Base package name to be use for any Java sources being copied over | No |
| -Dpackaging | Packaging to be used for the created project | No |
| -DremoteRepositories | Comma-separated list of repositories to lookup to retrieve archetype | No |
E:\workspaces\plexus-docs\plexus-website-monitor-component>mvn eclipse:eclipse
The project resources that we setup so far can be downloaded from this link here:
Précédent: Preparing |
Haut: Preparing |
Suivant: Diving
In |