Introduction

This document will walk you through creating a new project with Maven.  You'll only need to go through this process once per project, at its inception.

Assumptions

This document assumes that you have done this: How-To: Install Maven  and properly set up: settings.xml - For Licensed Customers and Partners.  It assumes you have secured access to the Jive Maven repository, and have a local SVN repository for your own customizations.

If you are reading this document to get some information about joining an existing maven project, start with Step 4 after checking out the existing project.

Step 1: Create a new base project

New project templates in Maven are called archetypes.  You will want to run the archetype in the top level directory where you store your projects. For example, if you store your code in~/code you'll cd into that directory.

Run this command (with the 3 substitutions listed below):

mvn archetype:create -e -DarchetypeGroupId=com.jivesoftware.maven -DarchetypeArtifactId=maven-sbs-archetype -DgroupId=com.jivesoftware.dummycustomer -DartifactId=dummyCustomerSite -DarchetypeVersion=3.0.x -DremoteRepositories=http://maven-secure.jivesoftware.com/archiva/repository/jive.internal

Substitutions

groupId

The namespaced group where this project should live.  e.g. com.jivesoftware.intel

artifactId

The name of this project, e.g., openPort

If you've configured your settings.xml file correctly, Maven will download all that it needs and complete without error.  You will have a nice new folder called "dummyCustomerSite" in your current directory.

Step 2: Add plugins

Any time you want to add a new plugin, you will run the following command from within your new project directory.  In the above example that would be from within "dummyCustomerSite".

mvn archetype:create -e -DarchetypeGroupId=com.jivesoftware.maven -DarchetypeArtifactId=maven-sbs-plugin-archetype -DgroupId=com.jivesoftware.module1 -DartifactId=module1 -DarchetypeVersion=3.0.x -DremoteRepositories=http://maven-secure.jivesoftware.com/archiva/repository/jive.internal

Substitutions

groupId

the namespaced group where this project should live.  e.g. com.jivesoftware.intel

artifactId

the name of this plugin e.g., virus-scan

Maven will register the plugin with the root pom.xml so if you run package or compile from the root directory, the child plugin will be packaged as well.

Step 3: Add to SVN

export SVN_EDITOR=vi (for Mac/*nix) OR set SVN_EDITOR=edit (for Windows)


svn mkdir -m "setup"  https://svn.yourserver.com/svn/<customer-project>


svn import -m "importing original project" . https://svn.yourserver.com/svn/<customer-project>/trunk


svn mkdir -m "setup"  https://svn.yourserver.com/svn/<customer-project>/branches


svn mkdir -m "setup" https://svn.yourserver.com/svn/<customer-project>/tags

Substitutions

<customer-project>

The name of your customer project

When the editor appears, add a comment and then write and quit

svn co https://svn.jivesoftware.com/svn/ext/customer/<customer-project>/trunk/ .

svn propedit svn:ignore .

target


projectFilesBackup


dummyCustomerSite.iml


dummyCustomerSite.iws


dummyCustomerSite.ipr


.DS_STORE

Step 4: Set up your database

Your default development database should be PostgreSQL.  If you have it installed, it should be straightforward for you to manually create a new database from the command line or pgAdmin.

The database name must be the format <artifactId>-<customer.version>.  For example, dummyCustomerSite-1.0-SNAPSHOT.  Encoding UTF8 is recommended.

Step 5: Build your project

Step 6: Generate IDE project files

See the steps here Maven: How to use with IDEA