Solved

Maven Hibernate MySQL related example

Posted on 2014-01-17
2
466 Views
Last Modified: 2014-01-28
Hi,

I was going through below link
http://www.developer.am/documentation/hibernate/?page=maven_hibernate_mysql

I am not clear on stp 1 and step 2


1. Generate project structure with Maven
In command prompt, Issue the “mvn archetype:generate” command, choose project #15 to create a quick start Maven’s java project, then fill in your project’s information – groupId , artifactId and pakage

E:workspace>mvn archetype:generate
[INFO] Scanning for projects...
...
Choose a number:  
(1/2/3....) 15: : 15
...
Define value for groupId: : com.developer.ammon
Define value for artifactId: : HibernateExample
Define value for version:  1.0-SNAPSHOT: :
Define value for package:  com.developer.ammon: : com.developer.ammon
[INFO] OldArchetype created in dir: E:workspaceHibernateExample
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------

2. Convert to Eclipse project

Issue the “mvn eclipse:eclipse” to convert the newly generated project to Eclipse’s style project
- See more at: http://www.developer.am/documentation/hibernate/?page=maven_hibernate_mysql#sthash.PgqTQdTZ.dpuf

why we need these steps.

please advise
Any links resources ideas highly appreciated. Thanks in advance
0
Comment
Question by:gudii9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
Mahesh Bhutkar earned 500 total points
ID: 39793557
The example you are referring uses Maven.
It is automation tool used to build the project. It manages jar file & it's dependencies which we placed inside lib folder of the project. It manages compatible versions. You can see the versions showing inside step1 for different different jars. This will simplify your project setup. You don't have to hunt & download the required dependency.

The above two steps you mention is a part of Maven Project setup for development.

Otherwise you have to create the project inside the eclipse & resolve all required dependency jars manually.
0
 
LVL 7

Author Comment

by:gudii9
ID: 39797785
I wonder what is

choose project #15

Can it be random number.

When I go to folde C:\gptest from the command prompt and gave command mvn archetype:generate

I got as below 16 not 15. I wonder why i have not got project 15 but instead  got project 16. what it means

>>Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 16: 16

How and where do i begin to start crerating this. I do not need eclispe right for these steps?

When I did first step it created HibernateExample with below pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.developer.ammon</groupId>
  <artifactId>HibernateExample</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>HibernateExample</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

I wonder why it has only junit jar entry and not any other entries. I also do not see Project ID 16 which i selectedm earlier in pom.xml. I wonder why?



Is there is any other detailed step by step link with screenshots on this. Please advise
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question