Repository Management with Nexus


20.2. Creating a New Maven Project

In this chapter, you will be creating a simple Maven project with a simple website that will be published to a Nexus Site repository. To create a new Maven project, use the archetype plugin’s archetype:generate goal on the command line, and supply the following identifiers:

  • groupId:
  • artifactId: sample-site
  • version: 1.0-SNAPSHOT
  • package:
~/examples$ mvn archetype:generate
[INFO] [archetype:generate {execution: default-cli}]
[INFO] Generating project in Interactive mode
Choose archetype:
1: internal -> appfuse-basic-jsf
13: internal -> maven-archetype-portlet (A simple portlet application)
14: internal -> maven-archetype-profiles ()
15: internal -> maven-archetype-quickstart ()
Choose a number:  (...14/15/16...) 15: : 15
Define value for groupId: :
Define value for artifactId: : sample-site
Define value for version:  1.0-SNAPSHOT: : 1.0-SNAPSHOT
Define value for package: :
Confirm properties configuration:
artifactId: sample-site
version: 1.0-SNAPSHOT
Y: :
[INFO] Parameter: groupId, Value:
[INFO] Parameter: packageName, Value:
[INFO] Parameter: package, Value:
[INFO] Parameter: artifactId, Value: sample-site
[INFO] Parameter: basedir, Value: /private/tmp
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] OldArchetype created in dir: /private/tmp/sample-site
[INFO] -------------------------------------------------------------

After running the archetype:generate command, you will have a new project in a sample-site/ subdirectory.