Archive

Posts Tagged ‘eclispe’

How to create a simple web app project with maven and eclipse and push to git

February 13th, 2015 No comments

here are normally 2 ways to build a simple web app project with maven and eclipse.

1. Using Maven Command line tool to  simple web app project
2. Use Eclipse to build simple  maven web project

Using Maven Command line tool to  simple web app project

Before we dive into details, let us understand what is archetype which we will be talking about in this blog ?

Archetype is a Maven project templating toolkit. An archetype is defined as an original pattern or model from which all other things of the same kind are made

Using Maven Command line tool to  simple web app project

To generate a simple maven web app project do this but the simple approach which I would advice is use command prompt

$ mvn archetype:generate -DgroupId=com.skg
-DartifactId=MyWebApp
-DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

Use Eclipse to build simple  maven web project

Select

File–>New–>Project

Chose Maven Project

use this archetype

ma

Will create a simple web project in eclipse for you

 

To build a simple project (non web based) and push to it

 

mvn archetype:generate -DgroupId=com.skg.social -DartifactId=socialIntegration -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

git eclipse:eclipse

Steps
1. Create a eclipse project using command line
2. go to directory of your porject for eg helloSpring
3. git init
4. git add * (adds all files recursively in directory to git)
5. git commit -m “first message”
6. Create a repo on git through their UI or command line
7. git remote add origin https://<url>/<username>/<project-name>.git
8. git push -u origin –all # pushes up the repo and its refs for the first time

This displays the remote url which is configured
git config remote.origin.url

git push origin local-name:remote-name