Навигация
 
 
 
 
Languages
 
 

Ответить на комментарий

New project with maven (small help note)


  Tagged

Once in a while I need to make small java applications maybe for testing some library, maybe as helper applications. As for me the fastest way to do this, is use maven archetype mechanism. But new project creation command not very user friendly since it required several parameters that you need to remember (‘-DarchetypeGroupId’ or ‘-DgroupId’). As solution you can make small help script and put it into your projects folder.

As quick solution I make small shell script (new_project.sh) that can be used for fast start:

#!/bin/sh

PROJECTNAME=$1
if test $# -eq 0
	then
		echo "Please include project name as first parameter"
		exit 1
fi

mvn archetype:create \
  -DarchetypeGroupId=org.apache.maven.archetypes \
  -DgroupId=com.kobyleha.$PROJECTNAME \
  -DartifactId=$PROJECTNAME

cd $PROJECTNAME
mvn install
mvn eclipse:eclipse

So now any time I need to have new project I just type:

./new_project.sh some_project_name

And then open already exists project in eclipse.

P.S. of course shell script can be much improved, as example it can be done as some wizard. Any way I think this small tip can help for someone in future.


Ответить

Содержание этого поля является приватным и не предназначено к показу.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Syntax highlight code surrounded by the {syntaxhighlighter OPTIONS}...{/syntaxhighlighter} tags.

Подробнее о форматировании

CAPTCHA
Защита от спам сообщений
 
 
 
 
 
 
  • emmie
  • hooligan
  • cupuyc
  • ESoImk
  • LeKz
 
 
 
© 2006-2009 kobyleha.com